loki/0040755000076500007650000000000010060041262010765 5ustar heathheathloki/autom4te.cache/0040755000076500007650000000000010057617254013611 5ustar heathheathloki/autom4te.cache/output.00100644000076500007650000051117510057617254015241 0ustar heathheath@%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.57. @%:@ @%:@ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @%:@ Free Software Foundation, Inc. @%:@ This configure script is free software; the Free Software Foundation @%:@ gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="lokisrc/loki.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT extra_cflags DMALLOC_INC DMALLOC_LIB DMALLOC_FLAGS LEX LEXLIB LEX_OUTPUT_ROOT YACC RANLIB AR SED CP GREP MV COMPRESS CHMOD PERL MAKEDEPEND CPP EGREP ALLOCA LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME @%:@@%:@ --------- @%:@@%:@ @%:@@%:@ Platform. @%:@@%:@ @%:@@%:@ --------- @%:@@%:@ hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ Core tests. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX @%:@@%:@ ---------------- @%:@@%:@ @%:@@%:@ Cache variables. @%:@@%:@ @%:@@%:@ ---------------- @%:@@%:@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------- @%:@@%:@ @%:@@%:@ Output files. @%:@@%:@ @%:@@%:@ ------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF @%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers include/config.h" echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi ac_default_prefix=`pwd` dm_search="$includedir,$libdir \ /usr/local/include,/usr/local/lib \ /usr/include,/usr/lib \ $HOME/include,$HOME/lib" echo checking for DMALLOC library for inclib in $dm_search do tst_inc=`echo $inclib | tr ',' ' ' | awk '{print $1}'` tst_lib=`echo $inclib | tr ',' ' ' | awk '{print $2}'` echo Looking for dmalloc.h in $tst_inc and libdmalloc.a in $tst_lib if test -r $tst_inc/dmalloc.h && test -r $tst_lib/libdmalloc.a then echo found. DMALLOC_INC="-I$tst_inc" DMALLOC_LIB="-L$tst_lib -ldmalloc" DMALLOC_FLAGS="-DUSE_DMALLOC \$(DMALLOC_INC)" break fi done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF @%:@ifndef __cplusplus choke me @%:@endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$GCC" = "xyes"; then extra_cflags='-W -Wall -pedantic -ffloat-store -Wno-long-long' else extra_cflags="" fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF @%:@define YYTEXT_POINTER 1 _ACEOF fi fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RANLIB in [\\/]* | ?:[\\/]*) ac_cv_path_RANLIB="$RANLIB" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RANLIB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_RANLIB" && ac_cv_path_RANLIB=":" ;; esac fi RANLIB=$ac_cv_path_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar" ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_CP" && ac_cv_path_CP="cp" ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then echo "$as_me:$LINENO: result: $CP" >&5 echo "${ECHO_T}$CP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep" ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then echo "$as_me:$LINENO: result: $GREP" >&5 echo "${ECHO_T}$GREP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then echo "$as_me:$LINENO: result: $MV" >&5 echo "${ECHO_T}$MV" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gzip compress", so it can be a program name with args. set dummy gzip compress; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_COMPRESS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $COMPRESS in [\\/]* | ?:[\\/]*) ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin//usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_COMPRESS" && ac_cv_path_COMPRESS="compress" ;; esac fi COMPRESS=$ac_cv_path_COMPRESS if test -n "$COMPRESS"; then echo "$as_me:$LINENO: result: $COMPRESS" >&5 echo "${ECHO_T}$COMPRESS" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "chmod", so it can be a program name with args. set dummy chmod; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CHMOD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CHMOD in [\\/]* | ?:[\\/]*) ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_CHMOD" && ac_cv_path_CHMOD="chmod" ;; esac fi CHMOD=$ac_cv_path_CHMOD if test -n "$CHMOD"; then echo "$as_me:$LINENO: result: $CHMOD" >&5 echo "${ECHO_T}$CHMOD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "makedepend", so it can be a program name with args. set dummy makedepend; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MAKEDEPEND+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAKEDEPEND in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEDEPEND="$MAKEDEPEND" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/X11R5/bin:/usr/bin/X11:/usr/openwin/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKEDEPEND="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_MAKEDEPEND" && ac_cv_path_MAKEDEPEND=":" ;; esac fi MAKEDEPEND=$ac_cv_path_MAKEDEPEND if test -n "$MAKEDEPEND"; then echo "$as_me:$LINENO: result: $MAKEDEPEND" >&5 echo "${ECHO_T}$MAKEDEPEND" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for sin in -lm" >&5 echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); int main () { sin (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_sin=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5 echo "${ECHO_T}$ac_cv_lib_m_sin" >&6 if test $ac_cv_lib_m_sin = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for accept in -lsocket" >&5 echo $ECHO_N "checking for accept in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); int main () { accept (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_accept=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_accept" >&5 echo "${ECHO_T}$ac_cv_lib_socket_accept" >&6 if test $ac_cv_lib_socket_accept = yes; then LIBS="-lsocket -lnsl $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@ifdef __STDC__ @%:@ include @%:@else @%:@ include @%:@endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @%:@define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_SYS_WAIT_H 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h limits.h values.h unistd.h sys/systeminfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define size_t unsigned _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF @%:@define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF @%:@define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 echo "configure:1694: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_socklen_t=yes else rm -rf conftest* ac_cv_type_socklen_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 if test $ac_cv_type_socklen_t = no; then cat >> confdefs.h <<\EOF #define socklen_t int EOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @%:@define const _ACEOF fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in memcpy regcomp strtod strtol gethostname popen snprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in atexit on_exit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in memmove bcopy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done ac_config_files="$ac_config_files Makefile libsrc/Makefile prepsrc/Makefile prepsrc/compat/Makefile lokisrc/Makefile test/Makefile utils/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libsrc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsrc/Makefile" ;; "prepsrc/Makefile" ) CONFIG_FILES="$CONFIG_FILES prepsrc/Makefile" ;; "prepsrc/compat/Makefile" ) CONFIG_FILES="$CONFIG_FILES prepsrc/compat/Makefile" ;; "lokisrc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lokisrc/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@extra_cflags@,$extra_cflags,;t t s,@DMALLOC_INC@,$DMALLOC_INC,;t t s,@DMALLOC_LIB@,$DMALLOC_LIB,;t t s,@DMALLOC_FLAGS@,$DMALLOC_FLAGS,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@RANLIB@,$RANLIB,;t t s,@AR@,$AR,;t t s,@SED@,$SED,;t t s,@CP@,$CP,;t t s,@GREP@,$GREP,;t t s,@MV@,$MV,;t t s,@COMPRESS@,$COMPRESS,;t t s,@CHMOD@,$CHMOD,;t t s,@PERL@,$PERL,;t t s,@MAKEDEPEND@,$MAKEDEPEND,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@ALLOCA@,$ALLOCA,;t t s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi loki/autom4te.cache/requests0100644000076500007650000001141710057617254015410 0ustar heathheath# This file was created by autom4te. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/share/autoconf' ], [ '/usr/share/autoconf/autoconf/autoconf.m4f', 'configure.in' ], { 'AC_C_CONST' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'AC_PROG_AWK' => 1, 'AC_TYPE_SIGNAL' => 1, 'AC_FUNC_FORK' => 1, 'AC_FUNC_CHOWN' => 1, 'AC_FUNC_STRTOD' => 1, 'AC_C_INLINE' => 1, 'm4_pattern_allow' => 1, 'AC_CHECK_LIB' => 1, 'AC_FUNC_OBSTACK' => 1, 'AC_PROG_RANLIB' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'AC_FUNC_MMAP' => 1, 'AC_TYPE_OFF_T' => 1, 'AC_FUNC_FSEEKO' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AC_PROG_CPP' => 1, 'AC_PROG_LEX' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_PROG_CC' => 1, 'AC_CANONICAL_HOST' => 1, 'AC_FUNC_SETVBUF_REVERSED' => 1, 'AC_CONFIG_FILES' => 1, 'AC_PROG_LN_S' => 1, 'AC_PROG_INSTALL' => 1, 'AC_STRUCT_TIMEZONE' => 1, 'AC_PROG_YACC' => 1, 'AC_HEADER_STAT' => 1, 'AC_HEADER_STDC' => 1, 'AC_FUNC_ERROR_AT_LINE' => 1, 'AC_DECL_SYS_SIGLIST' => 1, 'AC_PROG_CXX' => 1, 'AC_FUNC_STRFTIME' => 1, 'AM_PROG_CC_C_O' => 1, 'AC_FUNC_STRERROR_R' => 1, 'AC_HEADER_DIRENT' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'AC_PROG_MAKE_SET' => 1, 'AC_FUNC_CLOSEDIR_VOID' => 1, 'AC_PROG_LIBTOOL' => 1, 'AC_FUNC_UTIME_NULL' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_PROG_GCC_TRADITIONAL' => 1, 'AC_FUNC_MALLOC' => 1, 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, 'AC_CHECK_TYPES' => 1, 'AC_FUNC_MBRTOWC' => 1, 'm4_pattern_forbid' => 1, 'AC_REPLACE_FNMATCH' => 1, 'AC_CHECK_HEADERS' => 1, 'AC_C_VOLATILE' => 1, 'AM_CONDITIONAL' => 1, 'AC_FUNC_STRNLEN' => 1, 'AC_PATH_X' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_HEADER_SYS_WAIT' => 1, 'AC_STRUCT_TM' => 1, 'AC_FUNC_GETGROUPS' => 1, 'AC_LIBSOURCE' => 1, 'AC_CHECK_FUNCS' => 1, 'AC_FUNC_VPRINTF' => 1, 'AH_OUTPUT' => 1, 'AC_TYPE_SIZE_T' => 1, 'AC_CHECK_MEMBERS' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_INIT' => 1, 'AC_FUNC_STRCOLL' => 1, 'AC_FUNC_WAIT3' => 1, 'AC_FUNC_GETMNTENT' => 1, 'AC_FUNC_MKTIME' => 1, 'include' => 1, 'AC_TYPE_UID_T' => 1, 'AC_FUNC_SELECT_ARGTYPES' => 1, 'AC_SUBST' => 1, 'AC_STRUCT_ST_BLOCKS' => 1, 'm4_include' => 1, 'AC_FUNC_ALLOCA' => 1, 'AC_TYPE_PID_T' => 1, 'AC_FUNC_LSTAT' => 1, 'AC_TYPE_MODE_T' => 1, 'AC_FUNC_GETLOADAVG' => 1, 'AC_FUNC_SETPGRP' => 1, 'AC_FUNC_MEMCMP' => 1, 'AC_FUNC_GETPGRP' => 1, 'AC_FUNC_REALLOC' => 1, 'AC_HEADER_MAJOR' => 1, 'AC_FUNC_STAT' => 1, 'AM_MAINTAINER_MODE' => 1, 'AC_HEADER_TIME' => 1 } ], 'Request' ) ); loki/autom4te.cache/traces.00100644000076500007650000003523010057617254015153 0ustar heathheathm4trace:configure.in:2: -1- AC_INIT([lokisrc/loki.c]) m4trace:configure.in:2: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.in:2: -1- m4_pattern_forbid([_AC_]) m4trace:configure.in:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.in:2: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.in:2: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.in:2: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.in:2: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.in:2: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) m4trace:configure.in:2: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.in:2: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.in:2: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.in:2: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.in:2: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.in:2: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.in:2: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.in:2: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.in:2: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.in:2: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.in:2: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.in:2: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.in:2: -1- AC_SUBST([datadir], ['${prefix}/share']) m4trace:configure.in:2: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.in:2: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.in:2: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.in:2: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.in:2: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.in:2: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.in:2: -1- AC_SUBST([infodir], ['${prefix}/info']) m4trace:configure.in:2: -1- AC_SUBST([mandir], ['${prefix}/man']) m4trace:configure.in:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.in:2: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) m4trace:configure.in:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.in:2: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) m4trace:configure.in:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.in:2: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) m4trace:configure.in:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.in:2: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) m4trace:configure.in:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.in:2: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) m4trace:configure.in:2: -1- AC_SUBST([build_alias]) m4trace:configure.in:2: -1- AC_SUBST([host_alias]) m4trace:configure.in:2: -1- AC_SUBST([target_alias]) m4trace:configure.in:2: -1- AC_SUBST([DEFS]) m4trace:configure.in:2: -1- AC_SUBST([ECHO_C]) m4trace:configure.in:2: -1- AC_SUBST([ECHO_N]) m4trace:configure.in:2: -1- AC_SUBST([ECHO_T]) m4trace:configure.in:2: -1- AC_SUBST([LIBS]) m4trace:configure.in:4: -1- AC_CONFIG_HEADERS([include/config.h]) m4trace:configure.in:5: -1- AC_PROG_MAKE_SET m4trace:configure.in:5: -1- AC_SUBST([SET_MAKE]) m4trace:configure.in:30: -1- AC_PROG_CC m4trace:configure.in:30: -1- AC_SUBST([CC]) m4trace:configure.in:30: -1- AC_SUBST([CFLAGS]) m4trace:configure.in:30: -1- AC_SUBST([LDFLAGS]) m4trace:configure.in:30: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.in:30: -1- AC_SUBST([CC]) m4trace:configure.in:30: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.in:30: -1- AC_SUBST([CC]) m4trace:configure.in:30: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.in:30: -1- AC_SUBST([CC]) m4trace:configure.in:30: -1- AC_SUBST([CC]) m4trace:configure.in:30: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.in:30: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.in:30: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.in:36: -1- AC_SUBST([extra_cflags]) m4trace:configure.in:37: -1- AC_SUBST([DMALLOC_INC]) m4trace:configure.in:38: -1- AC_SUBST([DMALLOC_LIB]) m4trace:configure.in:39: -1- AC_SUBST([DMALLOC_FLAGS]) m4trace:configure.in:40: -1- AC_PROG_LEX m4trace:configure.in:40: -1- AC_SUBST([LEX]) m4trace:configure.in:40: -1- AC_CHECK_LIB([fl], [yywrap], [LEXLIB="-lfl"], [AC_CHECK_LIB(l, yywrap, LEXLIB="-ll")]) m4trace:configure.in:40: -1- AC_CHECK_LIB([l], [yywrap], [LEXLIB="-ll"]) m4trace:configure.in:40: -1- AC_SUBST([LEXLIB]) m4trace:configure.in:40: -1- AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root]) m4trace:configure.in:40: -1- AC_DEFINE_TRACE_LITERAL([YYTEXT_POINTER]) m4trace:configure.in:40: -1- AH_OUTPUT([YYTEXT_POINTER], [/* Define to 1 if `lex\' declares `yytext\' as a `char *\' by default, not a `char[]\'. */ #undef YYTEXT_POINTER]) m4trace:configure.in:41: -1- AC_PROG_YACC m4trace:configure.in:41: -1- AC_SUBST([YACC]) m4trace:configure.in:42: -1- AC_SUBST([RANLIB], [$ac_cv_path_RANLIB]) m4trace:configure.in:43: -1- AC_SUBST([AR], [$ac_cv_path_AR]) m4trace:configure.in:44: -1- AC_SUBST([SED], [$ac_cv_path_SED]) m4trace:configure.in:45: -1- AC_SUBST([CP], [$ac_cv_path_CP]) m4trace:configure.in:46: -1- AC_SUBST([GREP], [$ac_cv_path_GREP]) m4trace:configure.in:47: -1- AC_SUBST([MV], [$ac_cv_path_MV]) m4trace:configure.in:48: -1- AC_SUBST([COMPRESS], [$ac_cv_path_COMPRESS]) m4trace:configure.in:49: -1- AC_SUBST([CHMOD], [$ac_cv_path_CHMOD]) m4trace:configure.in:50: -1- AC_SUBST([PERL], [$ac_cv_path_PERL]) m4trace:configure.in:51: -1- AC_SUBST([MAKEDEPEND], [$ac_cv_path_MAKEDEPEND]) m4trace:configure.in:54: -1- AC_CHECK_LIB([m], [sin]) m4trace:configure.in:54: -1- AH_OUTPUT([HAVE_LIBM], [/* Define to 1 if you have the `m\' library (-lm). */ #undef HAVE_LIBM]) m4trace:configure.in:54: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBM]) m4trace:configure.in:55: -1- AC_CHECK_LIB([socket], [accept], [LIBS="-lsocket -lnsl $LIBS"], [], [-lnsl]) m4trace:configure.in:57: -1- AC_HEADER_STDC m4trace:configure.in:57: -1- AC_PROG_CPP m4trace:configure.in:57: -1- AC_SUBST([CPP]) m4trace:configure.in:57: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.in:57: -1- AC_SUBST([CPP]) m4trace:configure.in:57: -1- AC_SUBST([EGREP]) m4trace:configure.in:57: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.in:57: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) m4trace:configure.in:58: -1- AC_HEADER_SYS_WAIT m4trace:configure.in:58: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_WAIT_H]) m4trace:configure.in:58: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H]) m4trace:configure.in:59: -1- AC_CHECK_HEADERS([fcntl.h limits.h values.h unistd.h sys/systeminfo.h]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_VALUES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_SYS_SYSTEMINFO_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H]) m4trace:configure.in:59: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) m4trace:configure.in:59: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.in:61: -1- AC_TYPE_MODE_T m4trace:configure.in:61: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) m4trace:configure.in:61: -1- AH_OUTPUT([mode_t], [/* Define to `int\' if does not define. */ #undef mode_t]) m4trace:configure.in:62: -1- AC_TYPE_OFF_T m4trace:configure.in:62: -1- AC_DEFINE_TRACE_LITERAL([off_t]) m4trace:configure.in:62: -1- AH_OUTPUT([off_t], [/* Define to `long\' if does not define. */ #undef off_t]) m4trace:configure.in:63: -1- AC_TYPE_PID_T m4trace:configure.in:63: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) m4trace:configure.in:63: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ #undef pid_t]) m4trace:configure.in:64: -1- AC_TYPE_SIZE_T m4trace:configure.in:64: -1- AC_DEFINE_TRACE_LITERAL([size_t]) m4trace:configure.in:64: -1- AH_OUTPUT([size_t], [/* Define to `unsigned\' if does not define. */ #undef size_t]) m4trace:configure.in:65: -1- AC_FUNC_ALLOCA m4trace:configure.in:65: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA_H]) m4trace:configure.in:65: -1- AH_OUTPUT([HAVE_ALLOCA_H], [/* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H]) m4trace:configure.in:65: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ALLOCA]) m4trace:configure.in:65: -1- AH_OUTPUT([HAVE_ALLOCA], [/* Define to 1 if you have `alloca\', as a function or macro. */ #undef HAVE_ALLOCA]) m4trace:configure.in:65: -1- AC_LIBSOURCE([alloca.c]) m4trace:configure.in:65: -1- AC_SUBST([ALLOCA], [alloca.$ac_objext]) m4trace:configure.in:65: -1- AC_DEFINE_TRACE_LITERAL([C_ALLOCA]) m4trace:configure.in:65: -1- AH_OUTPUT([C_ALLOCA], [/* Define to 1 if using `alloca.c\'. */ #undef C_ALLOCA]) m4trace:configure.in:65: -1- AC_DEFINE_TRACE_LITERAL([CRAY_STACKSEG_END]) m4trace:configure.in:65: -1- AH_OUTPUT([CRAY_STACKSEG_END], [/* Define to one of `_getb67\', `GETB67\', `getb67\' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c\' support on those systems. */ #undef CRAY_STACKSEG_END]) m4trace:configure.in:65: -1- AH_OUTPUT([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ @%:@undef STACK_DIRECTION]) m4trace:configure.in:65: -1- AC_DEFINE_TRACE_LITERAL([STACK_DIRECTION]) m4trace:configure.in:103: -1- AC_C_CONST m4trace:configure.in:103: -1- AC_DEFINE_TRACE_LITERAL([const]) m4trace:configure.in:103: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ #undef const]) m4trace:configure.in:106: -1- AC_FUNC_VPRINTF m4trace:configure.in:106: -1- AC_CHECK_FUNCS([vprintf], [ AC_CHECK_FUNC(_doprnt, [AC_DEFINE(HAVE_DOPRNT, 1, [Define to 1 if you don't have `vprintf' but do have `_doprnt.'])])]) m4trace:configure.in:106: -1- AH_OUTPUT([HAVE_VPRINTF], [/* Define to 1 if you have the `vprintf\' function. */ #undef HAVE_VPRINTF]) m4trace:configure.in:106: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DOPRNT]) m4trace:configure.in:106: -1- AH_OUTPUT([HAVE_DOPRNT], [/* Define to 1 if you don\'t have `vprintf\' but do have `_doprnt.\' */ #undef HAVE_DOPRNT]) m4trace:configure.in:107: -1- AC_CHECK_FUNCS([memcpy regcomp strtod strtol gethostname popen snprintf]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_MEMCPY], [/* Define to 1 if you have the `memcpy\' function. */ #undef HAVE_MEMCPY]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_REGCOMP], [/* Define to 1 if you have the `regcomp\' function. */ #undef HAVE_REGCOMP]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_STRTOD], [/* Define to 1 if you have the `strtod\' function. */ #undef HAVE_STRTOD]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_STRTOL], [/* Define to 1 if you have the `strtol\' function. */ #undef HAVE_STRTOL]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_GETHOSTNAME], [/* Define to 1 if you have the `gethostname\' function. */ #undef HAVE_GETHOSTNAME]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_POPEN], [/* Define to 1 if you have the `popen\' function. */ #undef HAVE_POPEN]) m4trace:configure.in:107: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the `snprintf\' function. */ #undef HAVE_SNPRINTF]) m4trace:configure.in:108: -1- AC_CHECK_FUNCS([atexit on_exit], [break]) m4trace:configure.in:108: -1- AH_OUTPUT([HAVE_ATEXIT], [/* Define to 1 if you have the `atexit\' function. */ #undef HAVE_ATEXIT]) m4trace:configure.in:108: -1- AH_OUTPUT([HAVE_ON_EXIT], [/* Define to 1 if you have the `on_exit\' function. */ #undef HAVE_ON_EXIT]) m4trace:configure.in:109: -1- AC_CHECK_FUNCS([memmove bcopy], [break]) m4trace:configure.in:109: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the `memmove\' function. */ #undef HAVE_MEMMOVE]) m4trace:configure.in:109: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the `bcopy\' function. */ #undef HAVE_BCOPY]) m4trace:configure.in:113: -1- AC_CONFIG_FILES([Makefile libsrc/Makefile prepsrc/Makefile \ prepsrc/compat/Makefile lokisrc/Makefile \ test/Makefile utils/Makefile]) m4trace:configure.in:113: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.in:113: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) loki/Changes0100644000076500007650000003021410060041244012255 0ustar heathheath4 Jun 2004(SCH) - Fixed bug when using si_mode with QTLs and lm_ratio>0 3 Jun 2004(SCH) - Fixed bug in gen_pen() with genetics groups 24 Feb 2004(SCH) - Fixed printing bug in IBD estimates with dummy founders 16 Jan 2004(SCH) - Fixed bug when ids are shared between families and individuals. 9 Jan 2004 (EWD) - Merge in QTL genotype printing code 30 Oct 2003(SCH) - Add support for >32 segregating alleles using the -DUSE_LONGLONG switch (needs more testing). This whole section should be rewritten to remove the limit on allele numbers. - Add dump file support for IBD estimation runs - Modified peeling sequence determination to use node weights, and to pick the best of 4 greedy strategies. 29 Oct 2003(SCH) - Fix compile warnings about aliasing from gcc3.3 - Add command line switches to prep and loki to redirect output files -d sets the directory for output and intermediate files -f sets the prefix for output files (normally 'loki') Note that the -d option does *not* affect the control and parameter files Note also that the existing -d option for Loki (to set the dump file to restart from) has been changed to -f. 15 April 2003(SCH) - Finally (hopefully) fix problem with crash when no log file specified - Synchronize prep code from current and release versions - Rationalize missing data code matching as suggested by Dan Weeks to allow for numeric matching. Updated manual accordingly 21 March 2003(SCH) - Merge in bugfix for control_parse problem with arrays in File statement from current - Fix bug with dummy pedigree members where sex was not being initialized - Fix bug on Alpha in seg_pen 21 February 2003(SCH) - Merge in bugfix for seg_pen with genetic groups from current 19 February 2003(SCH) - Fix memory corruption in IBD code when singleton component is larger than first component 13 February 2003(SCH) - Fix bug in IBD reporting on Alphas - Fix bug in Merlin IBD output with singletons 16 December 2002(SCH) - Fix bug in reporting inbreeding coefficients - Remove reporting of loop breakers in log file (not correct in any case...) - Stop printing dummy individuals to logfile if pruned 30 October 2002 (SCH) - Lots of changes (not all today...) - Redo IBD output code. Now can output in SOLAR format, with proper translation of IDs - Alter Missing command so that general classes of variables can be specified (Pedigree/Genotypes/Factors/Real) - Set sensible defaults for Missing (all categorical variables) - Allow both haplotype to come together in a data field to allow reading of genotypes like 118/120. Add GS variable which determines character that separates genotypes in this case. - Add skip option to file command - causes Loki to skip a numnber of lines at the top of a data file. - Alter documentation to reflect above changes. - Put binary tree code into library. Remove redundant copies of code. 11 September 2002 (SCH) - Fix bug that caused Loki to hang if performing a segregation analysis and a total map length was not set. 2 August 2002 (SCH) - Reorganize source code into separate prep and loki directories to make it easier to reuse bits of the code 23 July 2002 (SCH) - Modify IBD output code so that be default, all zeros are not printed - Fix IBD output bug with >1 location - Add options for calculating IBD matrices on a grid or at every marker - Remove references to TDT and IBS analyses (old, broken) 12 July 2002 (SCH) - Modify IBD estimation code so that fixed values are not calculated - Remove printing bug in no marker data case 10 July 2002 (SCH) - Change default to CONSTANT for all variables. Add MULTIPLE keyword to set multiple records for variables. Add multiple_records system variable to switch back to default behaviour 9 July 2002 (SCH) - Add checks for failure to open log file in Loki 2 July 2002 (SCH) - Add code to support parallel RNGs 28 June 2002 (SCH) - Clean up bugs found when testing on Ellen's Alphas fix unitialized variable (flag) bug in loki_sample.c make conversion of genotype to alleles robust to rounding errors 25 June 2002 (SCH) - Fix memory allocation bug in Solaris - Remove globals from loki_peel.c - Finish splitting loki_peel.c 24 June 2002 (SCH) - Fix bug when M-sampler is used and allele frequencies are specified - Add new tests ** Version 2.4.2 18 June 2002 (SCH) - Too many changes to list. New sampling code, many bug fixes, many new features. I'll try and keep this list more up to date in future ** Version 2.3.0_beta 30 August 2000 (SCH) - Change Makefiles so they work with OSF1 make as well as GNU make - Add README_optimization to test/ to warn of difficulties with compiler optimization flags that affect math operaitons. 29 August 2000 (SCH) - Fix overdominant flag so it now works again. 28 August 2000 (SCH) - Change storage of factors in control_parse.y and read_data.c to a balanced binary tree rather than a hash table. Rewrite recode_factor() to further increase speed. 23 August 2000 (SCH) - Implement t-distributed error models. Not fully tested as yet - don't use. 16 August 2000 (SCH) - Implement polygenic and uncorrelated random effects into loki. Rewrite effect sampling so that *all* model effects (QTL, candidate genes, fixed effects and random effects) are updated simultaneously using sparse Gaussian elimination. 15 August 2000 (SCH) - Begin splitting source files into smaller units ** Version 2.2.1_r2 29 Feb 2000 (SCH) - Fix problem in read_binfiles.c where a component with no phenotype data but some genotype data would crash on peeling the trait locus. - Bug fix to control_parse.y to prevent crashing when trace_affect or trace_censored were used. - Lump components with single individuals together to simplify handling. 25 Feb 2000 (SCH) - Bug fix to write_data.c and read_binfiles.c which would cause genotype data to be scrambled when an individual had genotype data but no phenotype data. Not normally a problem for the L-Sampler as the raw genotype data is not used, but did affect the M-Sampler. - Changes to Makefiles to allow compilation in FreeBSD 23 Feb 2000 (SCH) - Changes to M sampler and ibd handling code to clear up several bugs and allow use of sloppy segregation patterns (better mixing) from the L sampler. 22 Feb 2000 (SCH) - Modify TL_Birth_Death() again to avoid Ve problems with censored traits. ** Version 2.2.1_r1 9 Feb 2000 (SCH) - Fix TL_Birth_Death() so it works again with censored traits (broken in 2.2.0_r3) 8 Feb 2000 (SCH) - Modified output routines for loki.pos so that sample_from limit is honoured. - Fixed bug in restrict_data() which prevented conditions with unary minus operators from working correctly. - Fixed memory allocation bug in loki_complex_peelop() which caused writing to random pointers in some circumstances when candidate genes were used. 28 Jan 2000 (SCH) - Add code to SampleLoop() to output QTL position every iteration to loki.pos. Only outputs when a change occurs. 22 Jan 2000 (SCH) - Fixed bug added in 2.2.1 in loki_init(). ** Version 2.2.1 21 Jan 2000 (SCH) - Changed start_time/end_time processing so elapsed, system, and user time is written to the dumpfiles, allowing more accurate total times to be printed to the logfiles in the case of the program being stopped. Note that the new read_dump() routine will still read in the old dump files which lack this time information. Note also that the time information is written as doubles which may lose some accuracy, but is (I think) portable. - Changed the order of statements in loki_init() to get around optimization bug in gcc 2.95.2 on Ultras. - Made it so alleles which are no longer found in the dataset after restriction statements and genotype cleaning, are deleted from the appropriate marker. 20 Jan 2000 (SCH) - Changed loki_sample() so the model is now printed out to the output file. - Fixed bug in read_dump() where a dumpfile would not be read in correctly if a censored data model was used. ** Version 2.2.0_r5 18 Jan 2000 (SCH) - Removed bug (introduced in 2.2.0_r4) with censored or affected data where indicator variable was marked as not required and removed. - Change libsrc/Makefile.in and lokisrc/Makefile.in so that it is easier to enable libdmalloc usage (just uncomment the appropriate lines in the makefiles. ** Version 2.2.0_r4 12 Jan 2000 (SCH) - Cleanup restrict code so that unsed restrictions and variables are not kept. - fix bug in restrict_data.c which prevented restrictions on everything (i.e., with null affected list) from taking affect. - Change param_parse.y so files can be 'included' using include "file". ** Version 2.2.0_r3 Nov/Dec 1999 (SCH) - Change reversible jump steps so that ve is changed simultanously with number of QTL to improve acceptance ratio. **Note** that only add and delete steps are now active as split/combine steps are broken! - Change sample_effects() in loki_sample.c so that QTL effects and covariate effects are sampled jointly - again to improve mixing. **NOTE** This has the side effect of breaking the no_overdominant flag. Correct bug in sample_effects() where the wrong covariate levels were used for discrete covariates. ** Version 2.2.0_r2 16 Oct 1999 (SCH) - Binary file formats changed so that they are (almost) platform independent. 17 Sep 1999 (SCH) - Many changes to all files, see summaries below - Long-standing bug causing random crashes after weeks of running tracked down to RNG occasionally producing zeros and ones. Corrected. - IBD routines now in main distribution, though not documented as user interface not necessarily stable. - Quantitative analyses can now be stopped and restarted which allows long runs with unstable systems, and simplifies bug tracking. - Output format changed yet again, but "OUTPUT TYPE" option in parameter file allows previous formats to be selected. - M and LM sampler routines present, but not fully integrated. - Genotype error correcting routines added. Use 'set correct_errors 1' in control file to activate. A subset of genotypes wil be zeroed leading to a consistent configuration. Very handy, but use with caution. ** Version 2.1.4_r1 21 Mar 1998 (SCH) - setup_ped.c: Change output of component sizes - individual component sizes are not now listed. Change formatting out output for pruned individuals. Sort components in descending size order. - param_parse.y, param_lex.l, loki_sample.c, loki.h: Add LIMIT variances option so lower limits on variance components can be set. 16-21 Mar 1998 (SCH) - most files: Allow specification of sex specific maps. Change sampling routines for genotypes and loci positions to reflect this. Change output routines and loki_ext accordingly. 20 Mar 1998 (SCH) - control_parse.y, write_report.c: Add OUTPUT option to allow pedigree to be written to a datafile after pruning and recoding. - setup_ped.c: Added checks for close inbreeding/weird inbreeding patterns. ** Version 2.1.4 15 Mar 1998 (SCH) - most files...: Enable GROUP command for specification of genetic groups. Added GROUP ORDER command for parameter file to specify order that multiple allele frequencies appear. FREQUENCY statements can now take multiple allele frequencies (if multiple groups exist). Modified calculation of founder probabilities to use group frequencies; ditto for sampling frequencies. Modifiy reversible jump steps to account for multiple sets of allele frequencies. 1 Mar 1998 (SCH) - recode_factors.c: Change consistency checks for genetic data so now genotypes rather than haplotypes are checked for consistency. 28 Feb 1998 (SCH) - loki.c: Write starting seedfile to to logfile. - read_data.c setup_ped.c control_parse.y write_data.c read_binfiles.c loki_init.c: Allow sex to be specified using sex command. Check sex against pedigree data. Modify input/output routines for loki.out to allow for sex information. - control_lex.l control_parse.y: Fix looping bug for control files. Fix some small bugs concerning format clauses. 27 Feb 1998 (SCH) - read_data.c: Allow blank records in datafiles. - setup_ped.c: Add code to count pedigree loops. ** Version 2.1.3 26 Feb 1998 (SCH) gen_elim.c - gen_elim.c: Fix bug when pruning (level=2) resulted in singletons. loki/configure0100755000076500007650000051015410057617254012717 0ustar heathheath#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="lokisrc/loki.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT extra_cflags DMALLOC_INC DMALLOC_LIB DMALLOC_FLAGS LEX LEXLIB LEX_OUTPUT_ROOT YACC RANLIB AR SED CP GREP MV COMPRESS CHMOD PERL MAKEDEPEND CPP EGREP ALLOCA LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers include/config.h" echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi ac_default_prefix=`pwd` dm_search="$includedir,$libdir \ /usr/local/include,/usr/local/lib \ /usr/include,/usr/lib \ $HOME/include,$HOME/lib" echo checking for DMALLOC library for inclib in $dm_search do tst_inc=`echo $inclib | tr ',' ' ' | awk '{print $1}'` tst_lib=`echo $inclib | tr ',' ' ' | awk '{print $2}'` echo Looking for dmalloc.h in $tst_inc and libdmalloc.a in $tst_lib if test -r $tst_inc/dmalloc.h && test -r $tst_lib/libdmalloc.a then echo found. DMALLOC_INC="-I$tst_inc" DMALLOC_LIB="-L$tst_lib -ldmalloc" DMALLOC_FLAGS="-DUSE_DMALLOC \$(DMALLOC_INC)" break fi done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$GCC" = "xyes"; then extra_cflags='-W -Wall -pedantic -ffloat-store -Wno-long-long' else extra_cflags="" fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RANLIB in [\\/]* | ?:[\\/]*) ac_cv_path_RANLIB="$RANLIB" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RANLIB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_RANLIB" && ac_cv_path_RANLIB=":" ;; esac fi RANLIB=$ac_cv_path_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AR in [\\/]* | ?:[\\/]*) ac_cv_path_AR="$AR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_AR" && ac_cv_path_AR="ar" ;; esac fi AR=$ac_cv_path_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) ac_cv_path_SED="$SED" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed" ;; esac fi SED=$ac_cv_path_SED if test -n "$SED"; then echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_CP" && ac_cv_path_CP="cp" ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then echo "$as_me:$LINENO: result: $CP" >&5 echo "${ECHO_T}$CP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GREP in [\\/]* | ?:[\\/]*) ac_cv_path_GREP="$GREP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep" ;; esac fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then echo "$as_me:$LINENO: result: $GREP" >&5 echo "${ECHO_T}$GREP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MV+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) ac_cv_path_MV="$MV" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv" ;; esac fi MV=$ac_cv_path_MV if test -n "$MV"; then echo "$as_me:$LINENO: result: $MV" >&5 echo "${ECHO_T}$MV" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gzip compress", so it can be a program name with args. set dummy gzip compress; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_COMPRESS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $COMPRESS in [\\/]* | ?:[\\/]*) ac_cv_path_COMPRESS="$COMPRESS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin//usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_COMPRESS="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_COMPRESS" && ac_cv_path_COMPRESS="compress" ;; esac fi COMPRESS=$ac_cv_path_COMPRESS if test -n "$COMPRESS"; then echo "$as_me:$LINENO: result: $COMPRESS" >&5 echo "${ECHO_T}$COMPRESS" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "chmod", so it can be a program name with args. set dummy chmod; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CHMOD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CHMOD in [\\/]* | ?:[\\/]*) ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_CHMOD" && ac_cv_path_CHMOD="chmod" ;; esac fi CHMOD=$ac_cv_path_CHMOD if test -n "$CHMOD"; then echo "$as_me:$LINENO: result: $CHMOD" >&5 echo "${ECHO_T}$CHMOD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="perl" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "makedepend", so it can be a program name with args. set dummy makedepend; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MAKEDEPEND+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAKEDEPEND in [\\/]* | ?:[\\/]*) ac_cv_path_MAKEDEPEND="$MAKEDEPEND" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/bin:/usr/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/X11R5/bin:/usr/bin/X11:/usr/openwin/bin" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKEDEPEND="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_MAKEDEPEND" && ac_cv_path_MAKEDEPEND=":" ;; esac fi MAKEDEPEND=$ac_cv_path_MAKEDEPEND if test -n "$MAKEDEPEND"; then echo "$as_me:$LINENO: result: $MAKEDEPEND" >&5 echo "${ECHO_T}$MAKEDEPEND" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for sin in -lm" >&5 echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); int main () { sin (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_sin=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5 echo "${ECHO_T}$ac_cv_lib_m_sin" >&6 if test $ac_cv_lib_m_sin = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for accept in -lsocket" >&5 echo $ECHO_N "checking for accept in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); int main () { accept (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_accept=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_accept" >&5 echo "${ECHO_T}$ac_cv_lib_socket_accept" >&6 if test $ac_cv_lib_socket_accept = yes; then LIBS="-lsocket -lnsl $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h limits.h values.h unistd.h sys/systeminfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 echo "configure:1694: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_socklen_t=yes else rm -rf conftest* ac_cv_type_socklen_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 if test $ac_cv_type_socklen_t = no; then cat >> confdefs.h <<\EOF #define socklen_t int EOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in memcpy regcomp strtod strtol gethostname popen snprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in atexit on_exit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done for ac_func in memmove bcopy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF break fi done ac_config_files="$ac_config_files Makefile libsrc/Makefile prepsrc/Makefile prepsrc/compat/Makefile lokisrc/Makefile test/Makefile utils/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libsrc/Makefile" ) CONFIG_FILES="$CONFIG_FILES libsrc/Makefile" ;; "prepsrc/Makefile" ) CONFIG_FILES="$CONFIG_FILES prepsrc/Makefile" ;; "prepsrc/compat/Makefile" ) CONFIG_FILES="$CONFIG_FILES prepsrc/compat/Makefile" ;; "lokisrc/Makefile" ) CONFIG_FILES="$CONFIG_FILES lokisrc/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@extra_cflags@,$extra_cflags,;t t s,@DMALLOC_INC@,$DMALLOC_INC,;t t s,@DMALLOC_LIB@,$DMALLOC_LIB,;t t s,@DMALLOC_FLAGS@,$DMALLOC_FLAGS,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@YACC@,$YACC,;t t s,@RANLIB@,$RANLIB,;t t s,@AR@,$AR,;t t s,@SED@,$SED,;t t s,@CP@,$CP,;t t s,@GREP@,$GREP,;t t s,@MV@,$MV,;t t s,@COMPRESS@,$COMPRESS,;t t s,@CHMOD@,$CHMOD,;t t s,@PERL@,$PERL,;t t s,@MAKEDEPEND@,$MAKEDEPEND,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@ALLOCA@,$ALLOCA,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi loki/configure.in0100644000076500007650000000646307747701374013335 0ustar heathheathdnl Process this file with autoconf to produce a configure script. AC_INIT(lokisrc/loki.c) AC_CONFIG_HEADER(include/config.h) AC_PROG_MAKE_SET ac_default_prefix=`pwd` dm_search="$includedir,$libdir \ /usr/local/include,/usr/local/lib \ /usr/include,/usr/lib \ $HOME/include,$HOME/lib" echo checking for DMALLOC library for inclib in $dm_search do tst_inc=`echo $inclib | tr ',' ' ' | awk '{print $1}'` tst_lib=`echo $inclib | tr ',' ' ' | awk '{print $2}'` echo Looking for dmalloc.h in $tst_inc and libdmalloc.a in $tst_lib if test -r $tst_inc/dmalloc.h && test -r $tst_lib/libdmalloc.a then echo found. DMALLOC_INC="-I$tst_inc" DMALLOC_LIB="-L$tst_lib -ldmalloc" DMALLOC_FLAGS="-DUSE_DMALLOC \$(DMALLOC_INC)" break fi done dnl Checks for programs. AC_PROG_CC if test "x$GCC" = "xyes"; then extra_cflags='-W -Wall -pedantic -ffloat-store -Wno-long-long' else extra_cflags="" fi AC_SUBST(extra_cflags) AC_SUBST(DMALLOC_INC) AC_SUBST(DMALLOC_LIB) AC_SUBST(DMALLOC_FLAGS) AC_PROG_LEX AC_PROG_YACC AC_PATH_PROG(RANLIB,ranlib,:,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(AR,ar,ar,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(SED,sed,sed,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(CP,cp,cp,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(GREP,grep,grep,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(MV,mv,mv,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(COMPRESS,gzip compress,compress,$PATH:/bin:/usr/bin:/usr/local/bin//usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(CHMOD,chmod,chmod,$PATH:/bin:/usr/bin:/usr/ccs/bin:/usr/sbin:/etc) AC_PATH_PROG(PERL,perl,perl,$PATH:/bin:/usr/bin:/usr/local/bin) AC_PATH_PROG(MAKEDEPEND,makedepend,:,$PATH:/bin:/usr/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/X11R5/bin:/usr/bin/X11:/usr/openwin/bin) dnl Checks for libraries. AC_CHECK_LIB(m, sin) AC_CHECK_LIB(socket,accept,LIBS="-lsocket -lnsl $LIBS",,-lnsl) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h values.h unistd.h sys/systeminfo.h) AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_FUNC_ALLOCA echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 echo "configure:1694: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[[^a-zA-Z_0-9]])socklen_t[[^a-zA-Z_0-9]]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_socklen_t=yes else rm -rf conftest* ac_cv_type_socklen_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 if test $ac_cv_type_socklen_t = no; then cat >> confdefs.h <<\EOF #define socklen_t int EOF fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS(memcpy regcomp strtod strtol gethostname popen snprintf) AC_CHECK_FUNCS(atexit on_exit,break) AC_CHECK_FUNCS(memmove bcopy,break) AC_OUTPUT(Makefile libsrc/Makefile prepsrc/Makefile \ prepsrc/compat/Makefile lokisrc/Makefile \ test/Makefile utils/Makefile) loki/COPYING0100644000076500007650000000244507522474411012041 0ustar heathheathRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. loki/data/0040755000076500007650000000000007606246716011725 5ustar heathheathloki/data/gaw9_d1a1-150100644000076500007650000024357007445627300013551 0ustar heathheath 1 1 33 11 25 33 64 21 46 31 65 62 47 65 61 63 14 1 2 42 22 61 23 44 12 46 31 76 16 25 11 26 33 44 1 3 42 12 46 11 56 22 42 13 46 67 74 65 31 34 11 1 4 13 22 24 32 45 22 44 11 75 63 77 21 56 53 44 1 5 42 21 14 32 65 22 26 13 64 21 44 73 64 57 43 1 6 44 21 46 33 43 22 44 11 55 71 41 22 26 66 14 1 7 13 21 22 21 55 12 42 11 65 35 47 75 25 33 32 1 8 12 12 25 33 46 11 88 12 66 66 44 16 34 33 22 1 9 44 22 21 23 55 22 18 33 66 66 84 51 35 36 43 1 10 13 22 23 33 45 22 12 33 55 66 44 25 33 66 14 1 11 34 22 42 32 55 22 56 33 67 16 55 51 36 44 44 1 12 11 22 42 33 57 22 44 31 76 62 45 15 31 33 44 1 13 34 12 12 23 57 22 26 13 62 66 74 55 25 64 43 1 14 44 11 24 33 47 12 42 33 65 63 77 16 16 36 43 1 15 44 22 52 23 25 21 22 14 75 61 44 16 31 66 33 1 16 13 11 22 13 47 22 41 13 75 13 24 55 64 34 14 1 17 31 12 12 62 85 22 62 12 56 36 45 51 61 66 21 1 460 34 12 56 32 44 11 64 13 57 21 72 51 16 33 44 1 461 32 12 51 33 44 12 66 11 56 26 75 51 16 33 44 1 462 32 12 51 33 44 12 66 11 56 26 75 51 16 33 44 1 463 43 12 42 13 54 22 44 11 47 66 77 62 35 35 14 1 464 41 12 42 13 54 22 44 11 45 63 77 61 36 33 14 1 678 12 12 21 33 44 12 86 21 66 66 47 65 41 33 24 1 679 41 22 42 33 44 22 44 11 55 73 47 21 26 63 14 1 680 41 12 62 33 34 22 44 11 55 13 17 21 66 63 44 1 681 44 11 64 31 35 22 44 11 54 16 17 26 63 63 41 1 987 43 21 62 32 45 11 64 11 56 23 74 57 12 33 43 1 988 34 12 52 32 45 12 61 13 56 26 74 51 15 36 43 1 989 24 22 12 32 45 22 61 13 66 26 78 55 15 36 43 1 990 34 12 51 33 45 12 68 13 56 26 74 51 15 36 43 1 991 34 12 51 33 45 12 68 13 56 26 78 55 13 33 44 1 992 44 12 41 13 56 22 42 11 76 62 74 27 56 55 44 1 1118 43 12 41 33 75 22 28 33 56 36 78 65 63 63 34 1 1119 43 11 45 33 74 21 26 31 65 62 77 15 11 33 44 1 1120 31 12 12 23 54 22 24 11 25 63 47 51 56 43 34 1 1121 34 11 16 23 53 22 24 11 65 61 71 52 26 66 44 1 1122 12 22 21 33 74 22 46 33 76 66 48 15 35 36 43 1 1123 14 22 42 32 55 22 41 33 76 66 48 15 35 36 43 1 1124 14 22 42 32 55 22 41 33 76 66 48 15 35 36 43 1 1125 33 21 35 33 54 21 26 31 55 62 47 55 31 63 44 1 1126 14 22 22 32 45 22 11 33 56 66 44 51 35 66 44 1 1241 43 11 65 33 35 22 48 13 56 16 14 21 65 66 43 1 1242 43 11 45 13 54 21 46 11 45 62 77 65 31 33 14 1 1243 44 12 41 13 55 22 48 13 46 66 74 61 35 36 13 1 1244 14 22 22 32 45 22 45 13 56 31 75 15 63 34 44 1 1245 13 22 24 33 45 22 45 13 56 36 75 11 66 34 44 1 1246 13 22 24 33 45 22 45 13 56 31 75 15 63 34 44 1 1247 13 22 24 33 45 22 45 13 56 31 75 15 63 34 44 1 1418 43 22 54 23 25 22 25 13 76 66 45 11 36 64 34 1 1419 33 12 24 33 75 22 15 33 56 31 45 55 63 34 14 1 1476 41 22 22 22 58 22 56 11 55 33 74 55 31 46 41 1 1477 11 22 22 32 45 22 42 12 56 36 75 11 61 36 41 2 18 33 11 44 23 44 22 24 11 65 66 45 71 33 35 33 2 19 11 11 32 12 54 12 28 31 65 66 42 61 26 36 44 2 20 11 21 22 23 74 22 12 34 56 67 52 15 12 34 32 2 21 34 22 22 33 87 12 42 13 62 66 55 75 66 56 21 2 22 14 21 22 33 83 21 64 33 67 66 55 55 61 23 34 2 23 34 12 22 13 55 11 66 11 65 11 82 16 13 63 14 2 24 42 21 24 13 85 11 62 31 56 31 45 55 42 66 42 2 25 42 11 43 22 45 22 67 11 46 66 12 11 11 33 11 2 26 13 11 42 13 46 12 66 31 77 66 42 52 44 46 42 2 27 32 12 21 21 84 21 76 13 62 21 44 26 11 63 23 2 28 41 21 23 61 87 12 26 31 76 23 58 41 15 33 42 2 29 33 11 26 62 56 22 22 31 26 62 75 22 51 74 44 2 30 33 12 21 12 48 22 42 11 57 66 44 62 34 53 32 2 31 34 21 52 32 75 22 46 11 56 63 44 67 21 63 43 2 32 44 22 24 22 74 22 48 41 55 23 45 55 32 33 42 2 33 41 12 22 23 55 22 66 23 56 63 65 77 14 53 42 2 34 42 11 12 62 74 22 24 11 56 16 15 11 31 34 23 2 35 34 22 42 32 63 22 46 11 37 66 72 47 43 76 31 2 36 31 22 24 16 65 12 62 31 26 61 54 12 36 66 14 2 37 33 12 13 31 57 22 42 31 64 76 44 41 62 33 33 2 38 41 12 14 51 65 21 42 21 72 61 45 14 16 73 13 2 39 11 22 24 34 46 22 44 32 55 76 41 55 21 73 42 2 40 33 22 54 11 45 22 66 11 65 61 45 14 61 34 44 2 41 44 12 12 12 45 11 42 33 26 66 45 55 23 46 14 2 465 31 11 42 22 44 22 28 11 65 66 42 71 36 56 34 2 466 31 11 42 22 44 22 28 11 65 66 42 71 36 36 34 2 467 31 11 42 22 44 21 22 13 66 66 44 76 32 33 34 2 468 31 11 42 22 44 22 28 11 65 66 52 16 32 53 34 2 469 13 22 22 23 78 21 14 31 52 66 55 15 16 46 21 2 470 13 12 22 33 48 21 24 41 66 66 55 17 16 35 32 2 682 41 11 22 32 34 11 42 33 76 66 54 56 12 33 43 2 683 11 21 22 32 84 21 62 33 66 66 54 57 63 23 33 2 684 41 21 22 32 54 12 68 11 65 16 82 11 16 66 14 2 685 43 21 24 32 54 12 62 11 56 16 24 67 33 33 43 2 686 41 21 22 32 54 12 68 11 55 16 24 61 36 36 44 2 687 33 11 24 12 54 12 62 11 66 16 84 17 13 63 13 2 688 33 11 24 12 54 12 62 11 66 16 84 17 13 63 13 2 689 43 21 24 32 54 12 62 11 56 16 24 67 33 33 43 2 690 13 12 32 13 78 21 64 11 66 36 85 17 56 35 22 2 691 43 22 22 63 88 11 24 31 76 26 55 47 16 35 42 2 993 32 11 44 23 45 21 22 11 66 61 45 75 32 56 32 2 994 14 12 22 21 48 21 86 13 55 63 24 15 64 66 44 2 995 32 11 44 23 45 21 22 11 66 61 45 75 32 56 32 2 996 32 11 43 22 45 22 27 11 66 66 52 11 31 53 31 2 1081 31 21 24 31 84 11 46 13 27 66 54 55 64 64 14 2 1082 11 21 24 21 74 21 16 33 57 66 54 15 14 44 24 2 1083 33 21 22 33 86 12 46 11 27 66 52 52 64 66 12 2 1084 31 21 24 31 84 11 46 13 27 66 54 52 64 66 12 2 1127 24 22 12 12 44 12 68 31 25 26 42 21 16 66 24 2 1128 24 12 22 23 85 21 76 11 66 21 48 21 11 66 21 2 1129 21 21 12 12 44 12 78 31 25 16 42 61 16 36 34 2 1130 34 12 22 63 55 21 26 31 25 61 72 26 53 73 44 2 1131 31 11 22 62 54 22 28 31 25 66 74 21 56 46 44 2 1132 31 11 22 62 64 22 28 11 65 26 54 26 13 43 44 2 1133 31 11 62 22 64 22 28 11 65 26 54 21 16 46 44 2 1134 43 21 42 21 45 21 86 11 56 31 58 51 23 33 23 2 1135 43 21 44 22 44 22 82 11 56 36 54 57 23 33 23 2 1136 43 21 24 22 74 22 42 41 56 26 44 57 33 33 43 2 1137 43 21 44 22 44 22 82 11 56 36 58 51 21 36 23 2 1138 43 21 22 21 45 21 86 11 56 31 58 51 21 36 21 2 1248 43 22 22 33 58 11 64 11 56 16 25 67 36 35 42 2 1249 33 12 42 23 48 22 26 11 66 63 48 61 35 33 42 2 1250 31 21 23 31 57 12 66 11 56 13 28 61 35 33 42 2 1251 34 11 42 22 45 22 26 11 66 63 44 77 31 33 33 2 1252 33 12 45 23 57 12 64 11 66 13 84 16 12 66 14 2 1253 43 22 21 32 54 12 64 11 55 16 24 66 33 35 43 2 1254 33 11 42 21 44 22 24 11 65 66 44 76 33 35 33 2 1255 43 22 41 22 48 22 22 11 67 66 44 72 34 33 42 2 1350 34 21 21 36 87 12 42 11 75 21 51 41 13 33 42 2 1351 42 21 22 62 84 12 44 11 66 66 55 71 61 54 23 2 1352 44 21 21 66 87 12 22 31 75 21 51 41 13 33 42 2 1353 44 21 21 66 87 12 22 31 75 61 51 71 61 54 23 2 1420 13 22 41 42 68 22 42 21 57 66 14 52 14 33 22 2 1421 32 11 12 32 58 22 47 31 66 72 44 42 61 36 32 2 1422 32 11 12 32 58 21 46 31 66 71 48 41 61 36 31 2 1423 34 12 12 33 55 21 46 31 66 71 48 41 61 36 31 2 1424 44 12 14 12 44 12 48 31 25 63 45 55 22 43 12 2 1425 11 21 42 62 54 22 28 11 65 16 44 21 66 66 44 2 1463 43 22 24 23 46 22 84 11 53 66 27 14 64 67 43 2 1464 24 22 22 22 43 22 86 11 57 66 22 17 63 66 41 2 1465 43 22 24 23 43 22 86 31 27 26 42 27 13 66 21 2 1466 43 22 24 23 46 22 84 11 23 26 47 24 14 67 23 2 1467 31 12 22 63 55 22 26 33 26 63 75 27 54 73 42 2 1468 44 21 22 32 55 12 66 12 55 16 26 67 31 35 44 2 1478 33 12 44 21 45 22 26 11 65 61 45 74 31 34 34 2 1479 41 22 24 31 55 11 62 11 52 11 25 64 36 33 43 3 42 13 22 24 24 74 12 66 13 31 11 54 12 21 63 13 3 43 31 11 24 23 44 22 42 31 25 43 56 55 16 34 34 3 44 33 11 22 14 44 21 25 23 76 26 24 65 34 54 41 3 45 41 21 12 12 44 22 42 11 62 61 44 51 62 57 23 3 46 43 11 42 32 46 12 52 33 65 73 44 67 42 36 42 3 47 43 21 52 33 77 22 62 33 73 66 47 11 66 36 43 3 48 43 11 42 22 44 22 64 41 66 76 71 22 14 65 41 3 49 33 12 24 41 55 22 24 31 66 65 54 56 26 74 43 3 50 41 12 44 21 75 12 22 11 66 66 84 56 14 43 11 3 51 42 22 22 42 44 22 68 11 55 66 44 11 14 33 44 3 52 42 22 44 22 54 22 44 11 67 65 48 65 56 35 12 3 53 44 12 12 32 55 21 42 33 56 66 44 11 11 33 43 3 54 42 11 42 41 57 22 46 13 26 61 45 55 35 74 44 3 55 13 21 62 22 82 22 24 11 52 16 57 15 43 66 14 3 56 34 22 22 32 45 22 56 13 56 11 45 55 43 43 33 3 57 41 22 21 33 55 22 64 31 76 63 42 55 41 33 33 3 58 31 12 22 24 55 22 66 13 65 16 25 15 61 36 12 3 59 41 21 42 26 54 12 78 31 66 63 54 55 34 34 14 3 60 11 11 42 13 76 22 64 31 55 13 44 75 23 33 43 3 61 43 22 42 22 45 12 66 33 67 31 25 11 13 67 44 3 62 33 11 24 21 45 11 62 11 52 66 55 51 33 53 44 3 63 33 11 42 13 51 22 27 13 62 11 55 11 23 33 41 3 64 43 11 64 34 48 22 54 11 25 61 84 72 44 33 21 3 65 41 21 22 24 75 22 48 13 27 12 67 65 21 33 31 3 66 41 11 32 22 54 22 66 32 25 76 74 14 66 34 24 3 67 32 11 21 33 45 22 81 33 56 66 55 76 31 64 43 3 68 41 11 44 12 75 22 64 13 65 67 44 77 36 45 42 3 69 14 21 26 23 75 22 45 11 55 66 45 25 61 43 22 3 70 13 12 41 62 55 22 87 33 65 62 42 15 63 36 34 3 71 31 12 22 42 75 11 88 33 25 61 24 16 61 33 43 3 471 33 11 22 32 74 22 24 31 36 66 77 12 61 66 34 3 472 43 21 52 32 74 22 64 31 76 67 47 12 61 36 44 3 473 11 21 24 23 74 12 62 11 35 13 56 15 26 64 14 3 474 13 21 22 22 74 12 64 13 32 14 55 15 21 63 13 3 475 33 21 42 42 44 22 64 33 12 14 55 15 21 63 13 3 476 31 11 22 42 44 12 52 31 62 61 44 51 42 47 13 3 477 31 11 22 12 44 22 22 21 72 21 24 61 32 57 43 3 478 31 11 22 42 44 12 52 31 72 21 24 61 32 57 43 3 479 33 11 22 24 65 22 22 33 56 36 45 75 22 67 24 3 480 43 11 42 34 45 12 52 33 66 76 45 65 42 37 44 3 481 43 12 44 31 45 12 54 31 66 75 44 65 42 37 44 3 692 41 21 22 42 44 22 62 11 52 61 44 11 12 37 43 3 693 43 21 22 44 44 21 65 13 56 66 44 15 14 34 41 3 694 43 21 42 22 54 22 44 13 62 64 45 65 51 33 13 3 695 41 12 42 22 77 11 26 11 63 61 85 51 12 46 11 3 696 43 12 44 41 55 22 44 11 26 65 44 55 32 77 44 3 697 23 11 24 13 74 21 65 33 66 17 54 56 54 43 44 3 698 23 11 24 13 74 21 65 33 66 17 54 56 54 43 44 3 699 44 11 44 43 54 21 45 13 26 67 44 56 52 47 44 3 700 23 12 24 11 75 22 65 33 66 17 54 56 54 43 44 3 701 44 11 44 43 54 21 45 13 26 67 44 56 34 73 44 3 702 34 22 25 33 47 22 54 11 56 17 47 52 41 46 34 3 703 43 21 22 32 44 22 54 11 56 17 47 52 41 46 34 3 704 34 22 25 33 47 22 56 13 57 16 44 51 41 46 34 3 705 13 21 62 24 84 21 25 13 57 11 54 11 42 67 13 3 706 11 21 62 22 84 22 22 11 52 11 54 51 32 67 43 3 997 33 11 22 21 44 22 42 12 67 62 72 26 13 65 44 3 998 31 11 22 31 74 22 22 32 37 62 72 16 63 65 34 3 1085 34 12 22 42 55 21 22 33 66 66 54 51 21 73 43 3 1086 34 11 21 43 55 22 24 33 65 66 54 51 21 73 44 3 1087 33 11 24 24 64 22 26 33 51 31 45 71 22 66 21 3 1088 33 12 24 44 54 22 26 33 61 61 55 51 22 76 41 3 1089 33 12 24 44 54 22 26 33 61 61 55 51 22 76 41 3 1090 33 11 22 42 54 22 24 33 62 64 55 55 21 73 43 3 1091 33 11 22 42 54 22 24 33 62 64 55 55 21 73 43 3 1092 33 11 22 22 64 22 24 33 52 34 45 75 21 63 23 3 1093 33 11 22 42 54 22 26 33 51 31 45 71 22 66 21 3 1094 33 11 22 42 54 22 24 33 62 64 55 55 21 73 43 3 1095 33 12 24 24 64 22 26 33 51 31 45 71 22 66 41 3 1139 43 21 42 24 55 12 72 33 66 66 55 55 32 37 14 3 1140 43 21 42 24 54 12 76 33 61 61 55 51 32 36 11 3 1141 13 11 22 64 45 22 82 13 66 36 45 55 42 47 44 3 1142 13 11 42 14 75 22 64 33 52 34 45 55 31 33 33 3 1143 33 11 22 22 44 12 64 13 22 64 55 17 32 36 42 3 1144 33 11 42 12 56 12 24 13 22 64 55 15 31 33 43 3 1145 43 21 12 32 56 22 42 13 65 33 24 57 12 36 32 3 1146 43 21 24 34 54 22 66 33 75 63 44 57 42 36 32 3 1147 43 21 24 34 54 22 66 33 71 61 45 51 42 36 31 3 1148 33 11 42 12 54 22 26 13 61 11 55 11 22 36 11 3 1149 33 11 42 14 55 22 22 13 65 13 54 17 22 36 42 3 1150 33 11 42 12 54 22 26 13 61 11 55 11 22 36 41 3 1354 13 11 22 12 44 22 24 23 72 24 25 65 31 53 43 3 1355 13 11 22 14 45 22 22 23 72 24 25 65 31 53 43 3 1356 33 11 22 34 45 22 22 23 76 26 25 65 32 57 44 3 1357 33 11 22 22 45 22 46 11 66 61 72 25 11 66 42 3 1358 33 11 22 14 45 22 26 23 75 26 25 65 31 56 42 3 1359 33 11 24 24 68 22 25 31 12 16 58 17 24 63 12 3 1360 33 21 44 44 48 22 64 31 15 11 54 12 24 63 11 3 1361 34 21 46 43 44 22 65 31 12 16 58 17 24 63 12 3 1362 34 12 24 42 54 21 26 33 66 63 52 51 23 77 44 3 1426 13 11 22 24 45 22 62 33 26 76 75 15 62 47 44 3 1427 13 11 22 24 45 22 62 23 56 66 45 45 62 47 44 3 1428 44 22 22 22 76 22 42 13 25 13 64 67 22 36 32 3 1429 44 12 64 32 55 21 57 13 56 66 55 55 13 33 21 3 1430 43 11 62 34 54 22 56 13 51 61 55 51 12 36 21 3 1480 31 11 44 42 45 22 64 33 15 17 54 17 26 65 12 3 1481 44 21 24 31 57 22 66 31 16 16 54 17 23 64 14 3 1482 33 11 22 23 44 22 68 33 15 16 55 17 23 66 14 3 1483 41 22 42 22 45 11 68 33 62 36 22 11 36 73 44 3 1484 31 11 24 42 55 22 67 33 55 62 52 55 13 66 24 4 72 34 11 24 52 45 22 26 11 66 66 74 57 31 76 33 4 73 43 21 12 31 57 21 68 13 65 15 46 25 61 64 34 4 74 44 12 24 33 55 22 24 33 57 63 24 56 22 63 43 4 75 13 21 24 43 62 22 72 31 67 71 58 55 36 34 12 4 76 44 22 26 31 45 21 86 11 27 66 42 11 63 43 23 4 77 24 12 64 23 45 12 12 13 62 16 28 71 14 43 13 4 78 43 12 32 32 77 12 85 31 52 63 54 27 63 47 24 4 79 14 22 46 63 24 22 42 33 56 61 54 26 41 43 32 4 80 41 22 16 34 56 21 42 11 57 31 42 21 13 53 41 4 81 34 12 42 31 47 21 82 12 26 16 42 15 43 54 13 4 82 11 22 42 32 75 21 76 11 61 66 44 61 63 36 44 4 83 33 11 24 32 58 22 68 31 26 66 44 45 33 43 24 4 84 22 12 24 13 54 22 45 41 67 11 42 77 12 46 43 4 85 13 21 42 12 78 22 85 13 66 56 75 74 56 35 34 4 86 44 12 21 33 36 12 62 33 24 63 75 75 33 46 41 4 87 34 22 22 12 42 22 86 32 64 11 52 56 26 33 34 4 88 11 21 24 32 44 22 68 31 65 16 55 12 26 53 23 4 89 33 22 22 21 84 11 64 11 56 62 74 27 13 64 33 4 90 14 21 22 21 85 22 68 11 67 16 42 44 31 33 11 4 91 11 22 22 32 77 21 66 33 66 66 75 75 36 36 34 4 92 12 21 42 22 44 22 12 11 66 61 44 55 33 65 44 4 93 41 11 22 36 64 22 66 13 55 61 57 55 31 16 33 4 94 44 11 22 23 57 22 64 13 65 16 44 67 23 37 24 4 95 41 21 43 26 53 12 56 12 65 23 52 66 54 66 31 4 96 44 22 22 63 75 22 66 33 76 63 44 65 35 36 24 4 97 32 11 12 12 75 11 74 21 65 13 87 71 32 66 44 4 98 44 21 24 33 43 22 66 13 72 56 34 16 31 37 14 4 482 43 22 62 32 47 22 25 31 62 13 44 67 43 47 34 4 483 13 22 42 62 27 22 45 31 52 63 54 27 46 44 32 4 484 14 22 22 43 64 22 78 31 62 76 54 51 66 44 22 4 485 14 22 26 41 65 21 76 31 67 76 52 51 63 43 23 4 486 14 22 22 43 64 22 76 31 67 76 54 51 36 34 12 4 487 34 12 26 43 64 22 78 31 62 76 54 51 36 34 12 4 488 33 11 22 51 47 21 28 13 65 65 76 55 31 74 34 4 489 44 12 21 53 45 22 26 11 66 61 74 52 31 74 34 4 490 44 22 44 33 55 22 42 33 72 36 48 61 24 33 33 4 491 44 12 24 33 55 22 22 33 52 66 28 51 24 63 43 4 492 44 22 44 33 55 22 42 33 72 36 48 61 24 33 33 4 493 42 21 46 32 54 21 41 31 76 31 48 61 24 33 33 4 707 31 12 42 34 46 22 87 13 26 17 45 15 46 54 12 4 708 44 22 22 13 74 12 88 11 22 16 44 15 46 54 12 4 709 11 22 62 44 66 12 27 13 76 17 25 15 36 34 12 4 710 14 22 66 41 65 11 26 11 77 16 22 11 13 53 43 4 711 24 21 42 15 54 22 42 41 66 16 47 75 13 47 43 4 712 34 12 26 33 54 22 68 31 26 67 45 45 33 43 21 4 999 31 22 22 22 75 21 56 11 21 36 44 71 33 76 44 4 1096 31 12 24 56 42 22 24 13 65 66 75 52 34 74 33 4 1097 33 12 22 12 77 12 85 31 52 53 64 57 16 44 42 4 1098 33 12 22 52 47 22 25 11 62 63 74 57 36 74 32 4 1099 33 12 22 12 77 12 85 31 52 53 64 57 16 44 42 4 1100 41 22 42 34 56 22 47 33 76 36 44 61 26 34 32 4 1101 41 22 42 34 56 22 47 33 76 37 45 65 23 33 31 4 1102 44 22 42 33 54 22 47 33 76 37 45 65 23 33 31 4 1103 41 22 42 34 56 22 27 33 26 67 85 15 43 33 31 4 1104 41 22 42 34 56 22 47 33 26 67 85 15 43 33 31 4 1105 41 22 44 31 57 22 28 31 26 65 87 17 45 33 33 4 1106 44 12 22 33 53 21 26 33 22 66 87 17 43 34 34 4 1363 43 22 42 31 54 21 44 31 76 32 44 67 21 36 33 4 1364 13 22 22 41 64 21 74 31 66 72 54 57 33 34 13 4 1365 13 22 22 41 64 21 74 31 66 72 44 67 23 34 33 4 1366 43 22 42 31 54 21 44 31 76 32 44 67 23 34 33 4 1367 43 22 42 32 57 21 78 33 65 75 56 55 31 34 14 4 1368 13 21 22 41 67 21 78 33 65 75 56 55 31 34 14 4 1369 43 21 42 32 57 22 25 31 22 63 84 17 46 34 32 4 1370 13 22 22 42 67 22 75 33 65 75 56 55 31 34 14 4 1371 13 21 42 31 57 21 28 33 25 75 56 55 31 34 14 4 1372 44 21 22 31 45 22 78 31 67 76 52 54 31 33 11 4 1373 44 21 42 31 55 22 48 31 77 36 42 64 23 33 31 4 1374 44 21 22 31 45 22 78 31 67 76 52 54 31 33 11 4 1375 44 22 42 32 52 22 46 32 76 31 45 65 22 33 23 4 1376 13 22 22 41 64 22 78 33 66 61 45 15 62 43 23 4 1377 31 22 22 53 47 22 26 13 66 66 77 57 33 73 23 4 1378 31 22 22 23 77 22 56 13 26 36 47 77 63 43 23 4 1379 31 22 22 22 77 21 56 13 26 36 45 75 66 46 24 4 1380 31 22 22 22 77 21 56 13 26 36 45 75 66 46 24 4 1381 31 22 22 22 77 21 56 13 26 36 45 75 66 46 24 4 1382 31 22 22 23 77 22 56 13 26 36 45 75 66 46 24 4 1383 31 11 24 52 44 22 28 11 65 66 75 51 32 75 32 4 1384 31 11 22 53 44 22 26 33 56 61 55 51 32 75 32 4 1385 31 22 24 22 74 22 51 11 26 36 44 75 63 46 24 4 1431 43 12 42 31 34 22 68 33 26 66 44 61 16 74 42 4 1432 43 12 42 31 34 22 68 13 76 51 35 15 32 33 13 4 1433 43 12 24 33 65 22 64 13 57 13 74 56 12 63 33 4 1434 13 12 22 63 45 22 64 33 57 13 74 56 12 63 33 4 1485 13 21 22 42 65 21 74 31 65 73 47 71 32 46 34 4 1486 44 21 42 32 55 22 44 33 75 36 44 67 23 37 24 4 1487 14 12 44 22 45 21 85 11 56 63 52 16 24 56 21 4 1488 14 12 44 26 43 22 86 11 56 62 55 16 25 56 23 4 1489 14 12 22 33 45 22 66 33 66 13 54 15 25 56 24 4 1490 14 12 22 53 45 22 26 33 67 16 54 56 33 73 34 5 99 34 12 22 32 86 12 72 31 66 63 45 15 46 63 24 5 100 13 22 21 36 57 21 41 11 66 66 55 67 66 41 33 5 101 32 21 52 62 67 22 27 23 62 66 54 74 46 46 11 5 102 31 12 62 32 57 22 86 13 51 21 54 15 11 63 43 5 103 43 12 42 33 75 22 41 31 75 11 54 12 23 64 44 5 104 13 22 24 12 54 22 44 13 66 66 45 51 33 43 33 5 105 41 12 25 26 57 21 68 31 55 36 54 25 42 64 41 5 106 34 11 25 32 54 12 44 31 67 61 54 57 41 64 44 5 107 14 11 62 22 65 12 64 31 56 66 45 65 33 34 44 5 108 44 21 22 23 54 22 66 13 66 16 44 56 33 33 21 5 109 23 11 22 36 74 22 76 11 65 61 64 11 36 33 33 5 110 44 12 24 33 75 22 22 11 56 11 58 15 34 42 44 5 111 42 12 42 63 42 22 46 13 76 66 55 65 16 53 12 5 112 41 21 12 23 46 21 46 11 76 17 45 51 13 46 11 5 113 43 22 24 21 75 22 66 33 25 63 42 21 31 33 44 5 114 44 11 32 12 54 21 76 13 46 66 55 45 33 42 12 5 115 31 22 22 23 55 22 24 13 56 66 25 45 14 43 34 5 116 11 21 41 34 41 21 72 13 56 17 52 61 62 46 24 5 117 44 12 42 32 44 21 82 13 25 62 54 61 63 67 44 5 118 34 22 12 32 45 22 47 11 55 66 55 51 61 63 44 5 494 33 22 42 23 45 22 41 31 65 61 54 12 33 34 34 5 495 14 21 24 13 57 22 44 13 67 61 45 51 32 46 34 5 496 34 21 44 23 47 22 44 33 67 61 54 12 33 34 34 5 497 34 21 44 23 47 22 44 33 67 61 55 11 32 36 34 5 498 14 21 24 13 57 22 44 33 67 61 55 11 32 36 34 5 499 41 22 22 23 65 22 24 11 66 36 55 16 46 64 23 5 500 31 12 22 33 85 12 74 31 66 66 45 16 46 64 23 5 501 33 21 56 63 65 22 28 21 65 62 55 71 41 46 14 5 502 21 12 22 22 77 22 76 33 21 61 44 45 61 66 14 5 503 23 11 26 23 75 22 78 31 25 62 45 41 61 46 14 5 504 33 21 56 62 67 22 26 23 61 61 54 75 41 43 13 5 713 43 12 24 22 54 22 44 11 65 61 54 52 33 44 44 5 714 43 22 24 22 54 22 64 13 66 11 44 52 33 34 24 5 715 44 11 24 33 47 22 64 33 67 61 44 62 33 34 13 5 716 31 12 22 22 47 22 46 13 71 11 44 75 11 46 44 5 717 31 12 22 61 45 22 64 13 57 11 45 11 62 36 34 5 718 12 11 26 33 65 12 68 11 65 72 55 11 31 66 14 5 719 12 11 22 32 67 12 67 13 62 76 54 14 36 64 11 5 720 12 11 22 32 67 12 67 13 62 76 54 14 36 64 11 5 721 44 11 24 33 77 22 24 13 57 11 55 11 32 46 44 5 722 11 22 52 63 75 12 84 11 56 66 45 56 26 44 13 5 1000 33 21 42 23 45 21 47 33 66 66 54 11 34 36 32 5 1001 43 11 42 33 48 21 47 33 66 66 54 11 34 36 32 5 1002 31 22 42 23 45 22 44 31 66 66 55 16 36 34 33 5 1003 33 12 64 21 75 22 66 33 15 13 42 51 11 33 34 5 1004 33 22 54 61 65 22 26 23 65 63 52 71 41 43 14 5 1005 33 22 54 61 65 22 26 23 65 63 52 71 41 43 14 5 1006 34 22 52 62 67 22 26 23 62 66 54 72 43 43 14 5 1007 32 12 62 33 52 22 86 13 56 26 55 75 46 43 11 5 1008 32 12 62 33 52 22 86 13 56 26 55 15 11 65 41 5 1151 43 11 22 23 45 11 67 33 66 66 54 41 34 43 13 5 1152 33 21 22 23 58 21 47 33 66 66 54 51 44 36 42 5 1386 31 22 44 13 54 22 67 31 55 31 25 16 16 34 42 5 1387 31 21 51 64 61 21 22 23 66 67 52 71 42 46 14 5 1388 31 22 54 63 64 22 27 21 65 61 55 76 46 44 12 5 1389 31 21 51 64 61 21 27 21 65 61 55 76 46 44 12 5 1390 33 22 45 26 46 22 42 32 66 66 55 17 34 34 31 5 1391 33 22 45 26 46 22 42 32 66 66 55 17 34 34 31 5 1392 13 22 25 36 56 22 42 12 66 66 55 67 64 44 31 5 1393 33 22 45 26 46 22 42 32 66 66 55 17 34 44 31 5 1491 34 22 52 62 64 21 22 23 65 62 54 71 43 47 14 5 1492 34 22 52 62 65 22 27 31 65 66 55 11 31 33 34 5 1493 34 22 52 22 45 22 44 31 65 66 55 15 36 36 34 6 119 13 21 42 32 65 12 28 33 65 61 75 55 23 66 32 6 120 44 11 22 21 87 22 42 31 51 13 54 75 33 66 24 6 121 44 12 66 44 54 11 86 31 56 67 65 72 15 46 44 6 122 44 21 22 11 77 22 62 11 51 63 55 55 16 33 34 6 123 12 21 43 61 68 11 84 33 52 33 54 12 56 33 33 6 124 44 11 24 32 54 22 81 33 65 63 54 56 66 66 44 6 125 43 11 23 33 45 12 44 31 67 56 25 16 61 63 22 6 126 24 11 42 26 54 22 46 11 56 66 54 65 61 36 44 6 127 22 12 24 25 75 12 24 23 66 61 27 67 23 63 32 6 128 31 22 66 21 34 21 72 11 66 66 45 15 46 63 44 6 129 32 12 21 31 54 22 64 33 66 61 45 15 41 77 32 6 130 34 11 61 13 54 12 44 33 67 66 72 76 61 44 44 6 131 42 22 22 32 27 12 22 13 76 26 65 65 41 73 43 6 132 11 22 12 31 35 22 71 32 66 13 56 62 34 43 44 6 133 44 11 62 32 25 21 46 41 65 66 44 16 43 43 42 6 134 33 21 62 23 45 22 64 33 55 62 45 12 26 64 42 6 505 42 11 23 11 78 21 24 13 12 33 54 52 66 33 43 6 506 41 12 24 16 76 21 28 13 15 33 55 51 65 33 33 6 507 44 11 22 33 54 22 84 31 67 66 55 56 61 63 42 6 508 44 11 22 33 54 21 84 33 66 65 52 51 66 66 42 6 509 44 11 42 23 45 22 14 31 57 36 45 66 61 63 42 6 510 43 11 22 22 85 22 48 33 55 11 55 75 32 66 23 6 511 43 11 22 22 85 22 48 33 55 11 55 75 32 66 23 6 723 42 11 23 61 48 21 64 13 62 63 44 52 16 63 43 6 724 44 11 62 42 58 12 84 33 55 61 65 77 13 46 42 6 725 24 21 12 13 45 22 44 31 67 16 55 56 11 73 22 6 726 24 21 12 13 45 22 44 31 67 66 45 16 41 73 32 6 727 24 21 12 13 45 22 44 31 67 16 55 56 11 73 22 6 728 24 21 12 13 45 22 41 33 65 63 44 16 46 76 32 6 729 34 11 24 32 54 22 61 31 67 66 45 16 41 73 32 6 730 24 21 12 13 45 22 44 31 67 16 55 56 41 73 34 6 1009 41 12 24 36 46 21 48 13 75 63 55 61 15 33 23 6 1010 41 12 26 31 54 21 82 31 66 66 54 51 64 66 44 6 1011 43 12 26 32 43 12 87 31 66 66 54 51 64 66 44 6 1012 32 12 24 25 55 22 84 33 56 11 57 57 23 63 32 6 1013 32 12 24 25 55 22 84 33 56 11 57 57 23 63 33 6 1014 32 12 24 25 55 22 84 33 56 11 57 57 23 63 32 6 1015 42 12 24 25 85 22 44 33 56 11 57 77 33 63 22 6 1016 42 12 24 25 85 22 44 33 56 11 57 77 33 63 22 6 1153 14 21 22 12 58 22 14 33 65 11 55 67 33 46 42 6 1154 34 21 62 22 48 22 64 33 55 21 55 27 63 46 22 6 1155 42 12 14 35 45 22 44 33 66 61 77 77 63 43 42 6 1156 33 11 62 12 55 12 48 33 65 61 75 75 62 46 43 6 1157 33 11 62 12 55 12 48 33 65 61 75 75 62 46 43 6 1394 24 21 42 53 54 22 44 31 67 16 75 76 31 33 22 6 1395 34 11 22 53 54 22 84 31 57 16 55 56 21 63 32 6 1396 24 22 44 56 56 21 88 33 55 13 55 51 25 63 33 6 1397 24 21 42 53 54 22 44 31 67 16 75 76 31 33 22 6 1398 24 22 42 53 52 21 42 31 67 12 56 56 24 63 33 6 1399 24 22 42 53 52 21 42 31 67 12 76 56 24 67 34 6 1435 42 12 24 25 55 12 64 13 56 61 47 67 33 33 22 6 1436 44 11 61 33 24 22 44 43 66 66 47 17 46 44 44 7 135 41 11 24 62 54 22 68 31 62 31 74 72 16 36 42 7 136 44 21 42 32 87 22 22 11 66 36 54 52 44 76 23 7 137 41 12 22 32 65 11 86 11 25 21 44 51 13 34 44 7 138 41 22 22 62 54 22 22 33 55 66 55 51 21 74 44 7 139 21 12 12 41 55 22 16 11 61 36 75 72 12 46 22 7 140 44 12 21 22 55 22 26 34 51 11 45 66 13 63 23 7 141 23 22 32 33 57 22 44 34 67 12 55 62 31 53 31 7 142 42 21 22 24 15 21 24 13 55 66 45 16 34 34 41 7 143 11 12 22 63 75 21 65 33 51 21 84 62 12 66 21 7 144 43 21 22 63 47 22 64 33 67 16 74 55 31 62 31 7 145 23 11 42 22 27 22 46 31 56 66 45 51 11 44 21 7 146 43 12 42 33 45 22 64 33 66 67 45 11 52 73 34 7 147 32 22 22 53 55 21 84 13 61 16 42 15 63 63 31 7 148 44 22 22 31 73 12 44 11 13 11 44 55 66 46 43 7 149 42 11 42 62 45 22 42 11 11 66 54 15 32 36 24 7 150 44 12 22 22 74 22 26 31 46 17 55 14 36 76 42 7 151 44 11 62 62 74 22 42 11 26 26 52 11 31 43 42 7 152 33 21 62 13 73 22 62 13 56 61 54 33 23 66 34 7 153 44 11 21 31 45 22 44 31 65 61 54 75 36 37 24 7 154 41 11 21 31 34 11 54 13 66 61 44 11 36 36 24 7 155 14 21 42 12 55 12 64 11 65 22 74 26 11 33 43 7 512 31 22 22 36 77 22 46 43 75 22 58 26 11 36 12 7 513 21 21 32 36 57 22 46 33 65 12 58 62 32 36 11 7 514 11 22 22 21 55 12 66 11 51 16 45 12 32 46 42 7 515 11 22 22 21 55 12 66 11 51 16 45 12 32 46 42 7 516 42 11 21 34 65 12 81 11 26 23 47 57 11 34 42 7 517 41 12 22 31 65 12 86 11 21 26 45 52 12 36 42 7 518 14 21 22 22 45 22 22 33 55 61 54 56 21 73 43 7 519 14 21 22 22 45 22 22 33 55 61 54 16 11 46 42 7 520 14 11 42 22 47 22 62 31 66 36 74 72 14 36 43 7 521 14 12 44 23 48 22 82 11 26 13 45 25 64 67 22 7 731 44 11 42 33 46 21 68 31 66 73 57 17 21 34 42 7 732 24 11 42 22 25 22 42 33 55 61 44 56 11 43 23 7 733 41 22 22 61 45 22 66 31 61 16 75 51 33 64 34 7 734 31 12 22 32 75 21 46 31 75 61 44 51 13 24 14 7 735 41 22 22 62 45 21 66 31 75 61 44 51 13 24 14 7 736 41 22 22 61 45 22 66 31 61 16 75 52 32 66 32 7 1017 14 21 22 62 75 22 62 33 55 21 84 66 11 66 22 7 1018 34 21 22 32 75 22 42 43 75 21 54 26 11 36 12 7 1019 34 21 22 32 75 22 62 33 55 21 84 66 11 66 22 7 1020 31 22 22 32 74 22 42 43 75 26 55 21 11 34 14 7 1021 14 21 22 62 75 22 62 33 55 26 85 61 11 64 24 7 1022 14 12 22 63 77 21 64 31 51 21 84 25 26 64 14 7 1023 24 22 32 31 53 22 64 31 53 21 84 25 26 36 13 7 1024 24 22 32 33 57 21 44 31 61 11 54 65 36 36 13 7 1025 12 22 22 13 55 21 64 13 11 66 52 25 23 63 21 7 1026 43 12 22 35 65 12 88 11 21 26 42 55 13 33 41 7 1027 13 22 22 15 55 22 68 11 16 61 54 21 26 66 23 7 1028 12 22 22 13 55 21 64 13 21 66 52 25 23 63 21 7 1107 41 22 42 31 85 22 26 11 61 36 55 52 42 76 22 7 1108 11 12 42 32 85 21 26 11 65 31 54 51 43 74 24 7 1109 11 12 42 21 45 22 86 11 25 11 44 21 43 74 24 7 1110 44 12 22 22 71 22 24 13 65 66 45 26 44 64 31 7 1158 24 11 22 22 55 22 22 13 15 61 44 56 21 66 42 7 1159 24 11 22 22 55 22 22 13 15 61 44 56 21 66 42 7 1160 41 12 42 66 47 22 46 13 15 62 58 16 31 36 22 7 1161 41 12 22 32 44 22 42 33 65 66 55 71 31 33 41 7 1400 41 11 24 23 58 22 22 31 56 13 45 65 14 67 22 7 1401 41 12 22 22 55 21 26 31 55 11 44 61 13 64 24 7 1402 41 11 24 23 58 22 22 31 56 13 45 65 14 67 22 7 1403 31 22 24 23 58 22 22 31 56 13 45 65 14 67 22 7 1404 34 12 22 22 54 22 26 33 54 11 45 61 13 67 24 7 1405 34 22 22 32 74 22 46 41 76 27 55 24 16 37 14 7 1406 34 22 22 32 77 22 42 43 74 21 55 21 13 37 14 7 1407 13 12 46 21 47 22 86 11 25 16 45 23 42 76 23 7 1408 13 21 22 13 53 22 62 13 56 11 44 13 33 46 44 7 1409 13 12 46 21 47 22 86 11 25 16 45 23 42 76 23 7 1410 13 21 22 13 53 22 62 13 56 11 44 13 33 46 44 7 1411 13 21 22 13 43 22 82 13 26 11 44 23 43 76 24 7 1412 44 21 46 36 87 22 24 11 62 32 55 51 43 74 24 7 1413 44 21 42 32 84 22 22 11 66 36 52 51 41 73 22 7 1437 14 12 12 12 44 12 46 33 64 11 45 11 61 66 42 7 1438 14 12 12 12 44 12 46 33 64 61 45 11 33 37 24 7 1439 13 22 46 11 57 22 46 11 55 26 44 62 14 37 32 8 156 11 12 22 33 74 22 28 22 77 61 42 15 31 63 22 8 157 44 12 24 33 46 22 84 11 65 66 84 55 31 33 41 8 158 44 22 22 12 56 22 52 11 25 56 25 25 61 46 41 8 159 43 11 11 32 55 22 28 43 64 36 26 15 41 64 32 8 160 43 11 42 22 17 22 45 11 55 66 71 51 61 33 31 8 161 44 12 62 35 77 12 64 33 66 63 47 45 56 66 31 8 162 12 11 22 22 53 22 62 33 66 13 44 17 13 34 33 8 163 21 12 12 13 75 22 85 33 75 66 44 64 63 63 21 8 164 33 22 26 61 54 22 22 31 65 66 55 55 32 73 44 8 165 33 11 22 25 55 11 26 33 25 66 25 15 33 33 42 8 166 14 12 46 12 56 12 84 11 75 36 47 51 26 77 13 8 167 11 22 32 16 53 21 24 31 52 66 45 51 31 46 41 8 168 22 12 42 22 77 22 12 13 66 35 54 71 56 73 34 8 169 14 22 42 23 54 22 44 11 66 61 42 25 13 66 23 8 170 11 21 42 33 76 21 18 11 66 51 42 62 13 63 34 8 171 32 21 22 23 46 22 46 33 62 46 44 61 35 66 23 8 172 13 21 22 12 54 22 44 11 56 36 45 52 15 35 11 8 173 42 21 12 11 84 21 61 11 56 63 57 75 16 44 13 8 174 31 12 32 12 57 22 44 13 64 12 54 67 56 66 14 8 175 12 12 21 32 28 22 64 11 37 31 45 25 34 63 24 8 176 33 21 22 61 46 11 56 23 66 66 52 17 63 45 34 8 522 44 21 26 23 67 21 26 13 56 66 54 54 15 66 13 8 523 44 22 22 25 67 22 24 13 56 63 57 55 16 66 11 8 524 14 22 24 33 46 22 84 21 75 66 44 15 33 63 24 8 525 14 21 22 33 46 22 84 21 75 16 24 55 11 33 21 8 526 14 21 22 33 44 22 88 21 76 66 48 15 33 63 24 8 527 14 11 22 33 74 22 88 21 76 16 28 55 13 33 24 8 528 34 11 41 23 15 22 42 14 56 63 72 51 64 36 33 8 529 43 11 41 22 15 22 48 13 54 66 76 55 61 34 32 8 530 34 11 21 23 75 22 52 13 54 66 16 15 11 34 12 8 737 34 21 62 13 44 22 28 11 56 66 58 55 23 36 42 8 738 31 22 22 63 54 22 28 32 67 66 54 51 23 36 42 8 739 34 21 62 13 44 22 28 11 56 66 58 55 23 33 44 8 740 31 22 62 13 44 22 28 11 56 66 58 55 23 33 44 8 741 14 11 41 13 55 12 82 14 76 33 42 51 24 76 13 8 742 13 11 44 12 51 12 84 11 75 36 47 55 26 73 13 8 1029 41 22 23 21 63 21 24 11 52 66 55 41 51 66 31 8 1030 13 11 22 35 75 21 86 23 75 16 25 55 13 33 24 8 1031 13 11 22 35 75 21 86 23 75 16 25 55 13 33 22 8 1032 42 11 21 31 47 22 88 23 77 16 24 56 16 36 22 8 1033 41 21 42 32 63 22 42 13 56 63 44 57 33 34 43 8 1034 41 21 22 32 43 22 82 23 76 61 44 11 31 63 23 8 1035 41 21 42 32 65 22 46 13 56 61 44 51 31 34 43 8 1111 34 12 12 25 57 22 82 31 45 66 65 55 11 46 21 8 1112 34 12 42 25 17 22 44 13 56 63 77 55 66 36 31 8 1113 34 12 12 22 56 22 82 11 55 66 75 55 61 36 31 8 1114 44 12 42 22 16 22 42 11 55 66 75 55 61 36 31 8 1115 34 12 12 25 57 22 84 33 46 63 67 55 16 46 21 8 1116 44 12 42 22 16 22 42 11 55 66 75 55 61 36 31 8 1117 31 11 22 23 76 21 58 11 56 61 12 12 13 43 24 8 1162 34 12 32 12 56 22 42 11 65 16 55 65 51 66 11 8 1163 34 12 32 12 56 22 42 11 65 16 55 65 51 66 11 8 1164 24 21 22 23 74 22 28 31 66 56 48 15 63 36 42 8 1165 41 22 22 33 44 22 48 12 67 16 24 51 33 66 32 8 1166 41 22 22 33 44 22 48 12 67 16 24 51 33 66 32 8 1167 13 22 42 26 55 22 42 13 66 16 25 55 32 63 34 8 1168 11 22 42 23 54 22 48 12 67 66 44 21 13 66 22 8 1169 33 11 21 62 45 12 58 23 64 66 56 15 61 46 31 8 1170 14 22 22 12 56 22 42 11 55 36 45 55 11 36 11 8 1256 14 22 21 31 48 22 86 11 65 66 87 55 36 34 43 8 1257 44 12 22 35 47 22 82 11 65 66 85 55 31 36 41 8 1258 33 21 61 12 45 22 28 13 54 66 56 55 21 34 42 8 1259 34 22 62 15 47 22 22 11 55 66 55 55 21 36 41 8 1414 43 22 22 52 74 22 44 33 66 34 74 56 63 66 12 8 1415 42 21 22 53 76 22 46 33 62 36 74 51 65 66 13 8 1494 41 11 22 23 72 22 26 11 63 63 84 52 33 66 22 8 1495 22 22 21 22 78 22 24 31 67 51 45 15 64 33 44 8 1496 42 12 21 32 48 22 84 11 67 61 85 55 34 63 24 9 177 43 21 64 32 45 22 44 13 56 26 44 51 61 64 44 9 178 11 22 24 22 53 22 26 11 36 11 54 12 36 64 44 9 179 33 12 42 32 45 22 26 13 66 61 72 55 36 63 34 9 180 34 21 44 33 57 12 41 11 66 76 58 75 13 44 41 9 181 41 21 44 32 78 22 22 12 56 11 74 72 13 16 43 9 182 23 22 56 62 55 22 66 33 66 16 24 25 61 57 44 9 183 13 11 24 16 14 22 86 12 76 56 42 11 36 36 24 9 184 34 22 22 62 57 12 68 11 65 61 45 11 46 47 12 9 185 14 12 42 32 55 22 25 31 62 33 85 55 61 46 32 9 186 34 21 42 12 77 22 62 33 76 67 45 15 65 65 11 9 187 43 21 24 22 54 12 84 31 56 71 55 65 26 46 41 9 188 42 22 41 13 57 22 64 33 66 61 55 52 16 36 42 9 189 23 22 21 36 25 21 46 33 25 71 44 61 11 47 13 9 190 21 21 22 12 47 22 42 13 55 16 57 61 26 33 24 9 531 34 21 24 23 57 22 61 31 66 16 28 55 63 34 41 9 532 34 11 44 33 47 22 21 11 66 16 28 55 63 34 41 9 533 33 12 42 66 45 21 66 21 66 66 24 11 64 64 42 9 534 34 12 42 62 47 22 68 21 65 61 25 11 66 67 42 9 535 14 22 26 23 54 22 24 13 36 16 54 11 31 64 44 9 536 13 21 24 22 55 22 24 13 36 16 54 11 31 64 44 9 537 13 21 44 22 35 22 64 13 66 16 44 25 66 46 44 9 1036 42 12 45 36 75 22 16 13 66 61 82 52 36 45 14 9 1037 31 12 42 32 45 22 22 11 63 11 25 51 63 36 44 9 1038 33 11 44 32 45 22 24 13 66 16 24 51 61 34 44 9 1039 43 11 44 32 75 22 14 13 66 66 24 51 61 34 44 9 1040 33 11 44 32 75 22 14 13 66 66 84 51 31 44 14 9 1041 32 12 44 61 45 22 66 23 66 66 25 15 61 63 44 9 1042 42 22 21 23 77 22 84 13 56 16 55 15 61 63 44 9 1043 11 21 44 23 55 22 42 33 66 63 45 55 61 66 42 9 1044 34 12 42 22 55 22 42 33 66 63 48 55 66 64 43 9 1045 11 21 44 23 35 22 65 11 62 63 45 55 61 66 42 9 1046 44 22 64 33 47 22 42 31 65 61 47 17 31 61 44 9 1171 33 21 44 13 74 22 64 33 76 66 44 11 61 64 14 9 1222 34 11 44 63 47 22 61 21 66 66 22 15 66 63 44 9 1223 33 11 24 62 55 12 64 13 66 66 24 11 61 64 44 9 1224 33 21 24 62 55 12 64 13 66 66 44 11 41 64 44 9 1225 34 21 24 63 57 12 61 11 66 66 42 15 46 43 24 9 1416 13 21 24 22 54 22 24 11 36 11 55 15 36 66 41 9 1417 13 21 24 22 54 22 24 11 36 11 55 15 36 66 41 9 1440 34 21 14 63 57 12 61 31 56 16 42 11 16 76 34 9 1497 31 21 42 12 77 22 62 33 65 66 47 11 62 63 12 10 191 14 22 12 16 45 12 42 33 65 66 55 27 36 46 14 10 192 44 11 62 62 84 21 45 14 66 66 57 11 66 33 44 10 193 11 22 61 13 76 22 26 13 46 67 84 62 33 74 43 10 194 33 11 42 26 84 12 72 33 66 26 45 15 66 37 44 10 195 34 22 64 11 55 21 61 31 55 66 66 25 66 66 43 10 196 11 11 43 61 24 21 24 11 52 11 22 66 62 34 12 10 197 13 21 14 22 85 21 86 13 66 36 84 26 43 33 42 10 198 24 22 62 22 54 22 24 11 55 76 54 57 34 36 44 10 199 14 22 24 23 64 22 66 11 51 16 42 15 14 33 11 10 200 43 22 22 32 67 22 25 31 66 31 44 57 13 66 44 10 201 32 22 42 12 55 12 64 31 65 66 25 21 46 44 34 10 202 14 11 12 62 65 22 67 34 66 66 44 27 46 43 32 10 203 34 11 24 32 75 22 44 31 55 36 75 77 11 34 34 10 204 34 12 22 22 56 21 57 11 66 16 42 51 13 56 34 10 205 31 21 12 41 57 22 64 41 51 71 57 26 23 35 33 10 206 34 11 11 42 55 12 28 33 76 61 45 75 12 35 21 10 207 11 12 22 22 55 22 61 33 75 61 45 67 31 46 34 10 208 44 21 12 12 67 12 24 33 66 15 47 71 23 36 34 10 209 14 12 22 32 57 11 27 13 72 26 62 51 16 63 23 10 538 41 21 43 11 54 11 14 11 52 61 62 56 62 64 32 10 539 31 21 64 16 52 22 62 31 55 61 62 56 66 63 31 10 540 41 21 43 11 54 11 14 11 52 61 62 56 62 64 32 10 541 44 21 26 66 58 22 24 31 56 66 55 71 66 63 44 10 542 44 21 26 66 58 22 24 31 56 66 55 71 66 63 44 10 543 13 21 14 32 68 21 67 13 46 62 84 21 36 43 34 10 544 13 21 62 16 74 22 22 13 46 66 84 61 36 73 44 10 545 13 21 64 12 78 21 27 13 46 66 84 61 36 73 44 10 546 13 21 62 16 74 22 22 13 46 66 85 65 36 77 44 10 743 33 11 44 22 58 11 67 13 66 32 84 61 36 33 24 10 744 11 22 26 21 67 22 62 11 54 16 48 16 13 37 14 10 745 43 21 42 36 44 22 62 13 16 66 24 51 46 33 14 10 746 43 21 42 36 44 22 62 13 16 66 24 11 16 33 14 10 747 41 11 24 26 52 22 72 41 65 61 42 76 66 33 21 10 844 41 11 32 11 47 12 44 11 21 11 27 66 23 45 23 10 845 11 11 32 11 47 12 44 11 51 61 67 56 63 65 33 10 846 44 22 22 63 56 22 22 33 56 63 54 75 61 66 44 10 847 44 12 62 63 86 22 42 13 66 63 54 15 61 36 44 10 848 44 22 22 63 56 22 22 31 56 61 54 77 63 66 44 10 849 43 12 62 62 87 22 45 11 66 61 54 17 63 36 44 10 850 44 22 62 63 86 22 42 11 66 61 54 15 61 36 44 10 851 44 22 22 63 56 22 22 33 56 63 54 75 61 66 44 10 852 44 12 62 62 84 22 44 11 65 66 54 77 64 66 44 10 853 32 12 22 62 45 22 24 31 65 66 55 51 66 74 44 10 854 32 12 22 61 45 21 26 33 66 66 85 61 36 74 44 10 855 34 12 44 21 85 11 71 31 65 66 46 15 66 36 43 10 1172 34 12 22 33 76 22 42 33 56 33 74 75 11 36 34 10 1173 44 12 42 26 55 22 42 13 55 66 55 77 16 46 44 10 1174 34 11 26 26 58 22 54 11 66 16 45 51 16 53 34 10 1175 44 12 22 23 76 22 42 33 65 56 75 15 31 66 44 10 1176 44 12 22 26 76 22 42 33 66 53 74 15 31 66 44 10 1260 43 21 21 34 65 22 28 13 66 11 45 75 32 65 41 10 1261 41 21 62 62 85 22 46 13 67 66 54 16 63 34 43 10 1262 41 21 62 62 85 22 46 13 67 66 54 16 63 34 43 10 1263 41 21 62 62 85 22 46 13 67 66 54 16 63 34 43 10 1264 34 21 46 16 58 12 14 11 66 66 45 11 66 33 44 10 1265 33 12 42 22 87 12 75 31 66 61 44 17 63 36 44 10 1266 34 11 46 26 88 12 74 31 66 61 44 17 63 36 44 10 1267 44 21 46 16 58 12 14 11 56 66 65 51 66 63 34 10 1268 34 11 46 26 87 12 74 31 66 66 45 11 63 36 44 10 1441 14 11 26 36 58 12 74 31 26 66 25 11 66 33 34 11 210 31 22 24 32 77 22 84 13 32 61 85 65 53 64 41 11 211 44 21 22 62 46 22 26 33 57 66 55 27 26 54 23 11 212 24 12 62 32 65 22 68 11 56 16 42 55 11 63 34 11 213 44 21 12 34 13 22 44 33 57 61 75 56 25 73 43 11 214 31 21 42 14 56 22 24 31 55 36 44 56 63 33 13 11 215 23 21 24 23 74 12 67 13 72 32 54 52 56 63 44 11 216 42 11 24 12 44 21 24 11 75 61 44 42 13 36 24 11 217 24 11 22 32 57 12 62 33 65 66 54 11 41 34 23 11 218 41 11 46 23 56 22 66 11 46 76 44 15 66 66 43 11 219 34 12 62 12 44 22 44 13 56 63 78 55 11 77 24 11 220 24 21 24 23 76 22 66 13 65 36 45 55 33 41 42 11 221 34 21 24 36 57 22 46 13 55 66 44 12 12 43 14 11 222 41 21 12 25 14 21 12 13 66 66 42 22 11 27 42 11 223 41 11 22 33 44 12 86 31 76 62 44 56 46 67 13 11 224 21 11 22 33 55 12 64 31 65 26 45 17 56 43 43 11 225 11 21 22 24 44 11 12 43 25 66 54 27 31 74 24 11 226 21 11 22 22 47 22 16 13 77 66 56 52 35 36 31 11 227 34 11 22 33 67 21 42 32 64 56 52 15 36 34 31 11 228 43 12 42 62 57 22 44 33 56 67 42 25 22 36 14 11 229 23 21 22 24 74 22 42 12 66 67 22 16 16 66 24 11 230 41 22 61 42 56 12 66 32 62 66 45 61 56 67 34 11 547 14 22 42 26 74 22 42 33 25 16 55 52 32 45 13 11 548 34 21 42 22 76 22 46 33 27 16 55 57 36 44 13 11 549 34 22 22 36 74 22 82 13 35 66 85 67 56 64 43 11 550 42 11 22 13 45 21 26 13 76 66 44 41 11 34 23 11 551 24 11 42 22 47 12 42 13 55 16 44 21 14 33 22 11 552 22 11 42 23 45 11 46 13 56 16 45 21 34 63 42 11 553 42 11 22 13 45 21 46 13 56 16 45 21 34 63 42 11 554 12 12 22 42 67 21 46 11 57 63 45 65 35 36 34 11 555 33 21 44 13 54 22 27 33 52 32 44 52 66 33 14 11 556 42 11 26 43 36 22 46 31 75 11 54 65 21 76 43 11 557 42 21 16 33 15 22 48 31 56 66 72 55 21 33 34 11 558 44 22 12 32 15 22 48 31 55 61 74 55 21 76 43 11 748 34 11 62 14 43 22 44 13 57 61 75 56 12 77 24 11 749 44 12 41 33 61 22 64 33 55 66 57 55 32 17 24 11 750 24 22 21 23 71 22 64 13 65 36 47 55 32 47 44 11 751 44 12 42 32 65 22 68 31 55 61 54 55 31 16 23 11 752 44 12 41 33 61 22 64 33 55 66 57 55 32 17 24 11 753 24 22 41 33 61 22 64 33 55 66 57 55 32 16 23 11 754 22 11 22 32 54 11 64 31 65 21 44 12 53 46 44 11 755 22 11 22 33 55 11 66 31 65 21 44 12 53 46 44 11 756 44 12 42 66 74 22 62 33 55 66 48 26 25 36 44 11 757 33 22 22 33 57 22 48 11 53 66 45 17 16 44 13 11 758 33 22 22 33 57 22 48 31 53 66 48 26 25 36 44 11 856 42 11 26 23 65 22 68 31 26 16 52 55 31 43 14 11 857 44 12 21 23 61 22 64 33 75 66 57 75 62 43 33 11 858 42 11 26 23 65 22 68 31 76 16 52 55 31 43 13 11 859 14 21 44 22 75 22 46 31 24 17 54 51 36 46 14 11 860 44 21 24 62 45 22 26 31 54 67 54 21 26 56 34 11 861 21 12 22 32 54 11 61 34 65 66 54 17 41 34 24 11 862 21 11 22 32 54 11 61 34 62 66 55 12 43 37 22 11 863 21 11 22 34 54 11 62 33 65 66 54 17 41 34 24 11 864 21 11 42 23 44 12 46 11 56 12 44 16 46 37 23 11 865 41 11 22 23 74 22 26 31 56 62 44 16 46 37 23 11 866 41 11 42 23 44 12 46 11 56 12 44 26 16 37 23 11 867 41 11 22 23 74 22 26 31 56 66 44 15 44 36 21 11 868 41 11 22 23 74 12 46 11 56 12 44 26 16 37 23 11 869 14 11 22 43 65 21 46 13 56 66 54 51 51 64 43 11 870 22 21 22 23 75 12 62 11 77 36 54 54 51 63 42 11 871 22 21 22 23 75 11 66 13 76 36 54 51 51 64 43 11 872 22 21 22 23 75 11 46 13 56 66 44 61 31 34 33 11 873 24 21 22 41 64 22 42 11 57 36 54 54 51 63 42 11 874 31 11 42 35 44 21 72 31 26 26 44 22 61 32 44 11 1177 32 11 22 33 65 21 46 33 66 56 54 51 61 44 13 11 1178 22 12 22 22 47 21 16 11 77 63 55 55 35 36 34 11 1179 12 12 22 22 77 21 66 31 77 63 65 25 55 66 14 11 1180 12 11 22 23 75 21 66 33 76 66 64 21 51 64 13 11 1269 44 11 22 23 65 21 66 33 76 66 54 71 61 44 33 11 1270 44 21 12 33 15 21 46 33 56 66 74 51 21 34 33 11 1271 41 21 12 34 15 21 46 33 56 66 54 71 65 46 34 11 1272 44 11 24 16 45 22 24 13 75 66 44 42 12 33 21 11 1442 32 12 22 42 47 21 26 21 67 73 25 65 65 66 44 11 1443 44 21 62 43 55 11 66 33 66 66 44 61 51 64 33 12 231 33 22 22 21 54 11 42 11 63 63 75 14 66 36 14 12 232 14 11 22 43 46 12 88 11 62 66 45 15 32 43 34 12 233 43 11 22 26 58 22 44 34 62 11 77 76 26 33 14 12 234 14 21 22 21 35 22 81 32 76 76 57 13 16 77 12 12 235 34 21 22 32 17 22 26 13 66 62 42 75 66 37 44 12 236 23 12 24 62 57 22 42 11 66 12 58 56 44 66 24 12 237 41 22 24 31 75 22 14 11 65 11 54 57 31 44 32 12 238 33 21 22 33 55 12 66 11 66 31 85 16 16 66 34 12 239 12 22 22 22 54 11 44 13 62 66 55 65 16 44 44 12 240 41 22 12 13 64 11 24 11 64 36 45 65 42 17 34 12 241 44 21 44 63 55 22 26 13 66 61 14 15 16 73 44 12 242 33 11 42 32 47 22 45 11 61 36 45 61 24 34 11 12 559 31 21 22 24 54 11 48 11 66 66 74 11 63 34 13 12 560 34 21 22 13 46 12 28 11 32 36 55 45 62 63 44 12 561 32 21 22 36 15 22 24 11 66 61 45 75 64 36 42 12 562 32 21 22 36 15 22 24 11 66 61 45 75 64 36 42 12 563 33 22 24 32 17 22 22 11 66 62 48 76 64 36 44 12 564 31 12 22 62 83 22 48 43 26 16 77 63 66 37 41 12 565 44 12 22 22 53 22 48 33 67 17 75 71 61 37 41 12 759 13 21 42 16 58 22 44 14 52 11 47 76 16 43 24 12 760 11 22 42 16 58 22 44 14 52 11 47 76 16 43 24 12 761 12 21 22 36 45 12 44 11 46 61 55 55 24 76 42 12 762 42 21 12 16 65 12 24 11 66 31 45 65 44 16 32 12 763 13 22 22 33 41 12 42 11 46 66 54 57 26 73 44 12 764 43 22 12 13 61 12 22 11 66 36 45 65 44 16 32 12 875 13 12 22 43 45 11 86 11 66 63 48 11 31 46 33 12 876 13 12 22 43 45 11 86 11 66 63 48 11 31 46 33 12 877 34 22 22 12 43 12 28 13 37 37 55 41 61 67 41 12 878 34 22 22 12 43 12 28 13 37 37 55 41 61 67 41 12 879 44 11 22 32 65 22 84 13 26 61 57 57 26 33 44 12 880 34 22 24 36 15 22 22 11 66 61 44 75 66 33 44 12 881 34 21 44 23 75 22 26 13 66 21 84 65 46 33 44 12 882 22 12 22 62 55 21 44 11 66 16 55 56 41 64 24 12 1226 13 21 22 32 47 12 45 11 41 66 55 51 24 74 41 12 1227 13 21 24 33 44 12 24 11 66 63 44 76 62 33 41 12 1228 13 21 22 32 47 12 45 11 41 66 55 51 24 74 41 12 1273 41 12 22 33 64 21 84 11 24 61 55 55 24 36 42 12 1274 41 12 22 26 55 22 44 31 66 11 75 75 64 36 42 12 1275 42 11 22 26 55 22 44 31 66 11 75 75 64 36 42 13 243 43 12 22 31 74 22 25 13 74 16 42 57 13 76 24 13 244 33 11 46 14 47 22 46 13 63 66 85 21 36 37 14 13 245 44 22 22 32 75 22 66 11 66 17 54 26 13 44 32 13 246 33 11 52 23 37 12 82 33 51 62 72 52 11 34 43 13 247 32 12 12 31 45 22 24 13 17 11 45 65 21 53 13 13 248 11 22 22 22 24 12 44 11 75 66 54 77 14 23 14 13 249 43 22 44 32 55 22 64 33 52 16 24 14 14 34 34 13 250 12 11 42 36 25 22 64 31 67 16 74 55 42 33 43 13 251 41 21 22 13 75 21 84 11 56 66 54 55 63 33 14 13 252 21 11 26 23 64 11 21 43 66 16 57 54 43 34 23 13 253 32 11 12 12 53 12 72 21 35 16 44 65 63 16 23 13 254 41 22 26 31 13 22 45 11 66 63 44 15 13 44 11 13 255 23 12 24 23 65 21 44 23 61 36 45 75 61 36 13 13 256 44 21 42 63 47 12 44 33 66 16 57 54 31 65 31 13 257 44 22 42 23 55 22 46 31 66 66 45 51 11 67 34 13 258 43 12 21 12 57 12 62 33 62 31 71 11 63 34 43 13 259 41 21 62 66 67 22 24 13 55 51 27 15 63 66 44 13 260 34 22 11 22 47 22 82 14 72 11 48 71 63 57 43 13 261 24 21 16 36 76 22 25 33 75 37 25 65 36 66 34 13 262 41 11 22 32 45 21 72 33 67 76 74 55 14 43 11 13 263 43 11 64 33 75 12 66 11 56 66 54 55 36 63 42 13 566 31 12 42 12 44 22 44 11 65 66 84 27 31 32 11 13 567 31 12 62 42 72 21 64 31 35 66 54 17 64 73 44 13 568 31 12 62 42 72 21 64 31 37 66 55 17 61 72 41 13 569 31 12 42 12 44 22 44 11 65 66 84 27 34 33 14 13 570 31 12 42 12 42 21 64 11 65 66 84 27 34 33 14 13 571 34 12 52 22 35 12 86 31 56 67 74 56 13 34 42 13 572 34 12 52 22 35 12 86 31 16 27 24 26 13 44 32 13 573 34 12 52 22 35 12 86 31 56 67 74 56 13 34 42 13 574 34 12 52 23 37 12 86 31 56 61 75 52 11 34 43 13 575 42 22 22 11 45 22 54 33 47 61 25 75 31 63 43 13 576 32 22 22 11 45 22 54 13 77 11 45 55 11 73 23 13 765 33 21 44 21 54 22 64 31 56 16 28 12 13 33 31 13 766 41 22 42 32 54 22 64 31 25 66 44 47 41 42 41 13 767 43 21 24 11 74 22 84 11 56 66 58 52 63 33 11 13 768 14 12 65 32 43 11 18 33 61 62 72 42 31 44 33 13 769 24 12 22 32 45 12 16 31 66 67 74 46 33 44 32 13 770 14 12 62 32 45 12 16 31 66 67 72 42 31 44 33 13 771 13 11 65 32 43 11 18 33 61 62 72 46 33 44 32 13 772 43 21 24 31 14 22 46 11 66 66 48 12 13 43 11 13 773 11 22 62 12 32 21 56 11 66 36 48 52 33 43 11 13 774 24 12 22 21 34 22 24 13 57 61 45 55 31 63 33 13 883 13 22 21 22 27 12 42 13 72 61 51 71 13 24 13 13 884 13 22 21 22 27 12 46 13 76 63 57 71 16 23 14 13 885 34 11 42 13 47 22 44 13 66 66 87 24 31 35 11 13 886 32 11 52 26 35 12 84 31 57 66 74 55 12 33 43 13 887 34 12 52 23 35 12 86 31 56 66 75 51 11 37 34 13 888 34 12 54 22 35 12 84 33 56 66 74 55 11 37 44 13 889 33 12 54 23 35 12 84 32 56 63 74 57 16 33 41 13 890 33 12 54 23 35 11 84 33 51 76 45 65 11 36 43 13 891 33 21 26 14 47 22 56 13 73 16 44 57 14 73 24 13 892 21 22 22 12 52 21 44 31 75 16 55 51 16 37 34 13 893 33 21 26 14 47 22 56 13 73 16 45 51 16 37 34 13 1181 12 12 22 61 75 22 24 13 57 51 25 15 61 63 43 13 1182 42 22 22 61 75 22 44 33 57 11 75 55 31 63 43 13 1229 24 11 26 26 56 22 65 13 65 77 45 45 36 46 34 13 1230 44 21 26 26 56 22 65 13 65 73 42 66 33 46 23 13 1231 11 11 62 32 45 11 12 33 67 66 74 45 34 43 31 13 1232 11 11 62 32 45 11 12 33 67 66 74 45 34 43 31 13 1233 13 12 62 31 44 12 85 31 17 21 24 25 11 43 33 13 1234 43 21 56 24 37 12 86 33 13 26 25 21 16 47 34 13 1235 43 22 52 21 34 12 86 33 13 26 25 21 16 47 34 13 1236 34 11 54 33 45 12 16 31 66 66 75 45 33 46 34 13 1237 13 11 64 33 45 12 16 31 66 66 74 45 36 43 32 13 1276 33 22 21 12 44 22 58 11 77 11 44 57 16 75 24 14 264 43 21 12 21 54 12 48 13 67 66 44 75 16 43 42 14 265 33 22 62 63 47 22 25 33 25 66 44 26 41 46 33 14 266 34 12 62 32 17 22 62 13 75 67 44 16 24 46 14 14 267 23 22 32 42 55 22 84 11 56 61 47 11 63 43 31 14 268 13 21 42 33 17 22 44 11 25 16 67 52 63 74 12 14 269 24 11 22 22 75 22 76 11 57 16 65 75 63 66 11 14 270 34 21 21 31 58 21 26 11 53 66 52 45 63 33 43 14 271 34 11 22 24 55 21 66 11 46 76 54 15 23 37 14 14 272 33 22 41 31 71 21 62 33 54 61 54 65 14 33 11 14 273 44 22 43 11 55 12 74 43 56 56 54 57 51 43 43 14 274 12 12 24 23 67 12 28 11 37 66 44 55 44 43 33 14 275 14 21 34 36 45 22 42 11 66 66 44 16 14 36 21 14 276 34 11 22 21 47 12 64 31 66 63 56 11 63 56 34 14 277 14 22 42 32 55 22 42 13 61 16 44 17 12 46 12 14 278 33 12 16 22 57 22 56 33 66 63 25 51 41 64 11 14 279 43 22 65 13 44 22 67 33 25 63 28 17 32 24 41 14 280 33 21 25 23 55 11 74 11 55 11 15 51 32 51 13 14 281 34 11 22 12 45 22 22 13 26 61 43 66 43 33 14 14 282 13 12 21 14 57 11 64 32 25 33 56 15 23 74 44 14 283 14 11 62 21 35 12 23 31 61 33 74 57 13 35 42 14 284 44 21 66 34 24 11 24 31 56 61 24 57 21 33 23 14 577 33 22 22 32 75 22 54 31 56 61 47 61 13 63 31 14 578 32 22 23 34 75 22 58 31 55 66 44 61 16 64 33 14 579 44 22 12 22 57 12 42 13 65 67 44 76 14 36 24 14 580 34 12 22 12 47 22 82 33 75 67 44 56 64 36 24 14 581 44 22 12 22 57 12 42 13 65 67 44 76 14 46 44 14 582 34 21 22 32 55 22 26 11 54 67 55 41 62 33 31 14 583 33 21 22 32 55 22 26 11 54 67 55 41 62 33 41 14 584 44 11 12 14 85 11 66 11 36 66 24 55 33 37 34 14 585 43 11 12 12 85 12 66 11 54 67 55 41 62 33 41 14 586 12 21 42 32 17 22 46 11 27 16 65 55 63 76 11 14 587 12 11 22 32 75 22 46 11 57 66 75 25 33 46 21 14 588 14 21 42 32 15 22 46 11 27 16 65 55 33 46 21 14 775 24 21 41 31 78 21 86 11 73 66 42 55 43 43 33 14 776 24 21 41 31 78 21 86 11 33 66 42 55 43 47 34 14 777 34 11 22 22 45 12 66 31 67 66 55 15 63 56 31 14 778 34 11 22 22 45 12 66 31 67 66 55 15 63 56 31 14 779 43 22 22 33 55 22 42 11 65 16 45 14 16 43 14 14 780 43 21 22 22 55 22 26 31 15 66 45 74 26 63 24 14 894 24 22 32 42 57 22 82 13 55 67 44 16 64 46 34 14 895 34 22 22 32 77 22 82 13 55 67 44 16 64 46 34 14 896 34 22 32 42 57 22 82 13 55 67 44 16 64 46 34 14 897 34 22 21 32 75 21 54 31 56 66 44 67 11 64 34 14 898 24 22 32 42 57 22 82 13 55 67 44 16 64 46 34 14 899 34 22 24 21 55 21 47 14 65 16 74 17 31 33 13 14 900 34 22 23 21 55 22 44 13 66 16 74 17 31 33 13 14 901 43 21 21 22 75 22 25 33 56 76 42 65 44 66 41 14 902 41 22 13 23 54 12 44 11 66 76 44 61 41 63 42 14 903 41 22 13 23 54 12 44 11 66 66 44 71 11 33 22 14 904 44 21 14 26 55 12 42 11 66 66 44 71 11 33 22 14 1047 14 12 26 31 74 22 66 13 72 66 52 51 33 62 14 14 1048 14 11 22 32 75 22 46 11 54 67 75 21 32 43 23 14 1049 23 12 22 23 55 22 62 11 55 66 75 24 36 43 23 14 1050 14 11 22 32 75 22 46 11 54 67 75 21 32 63 11 14 1051 23 12 22 23 55 22 62 11 75 66 55 54 36 63 13 14 1052 13 22 44 33 17 21 62 13 74 61 54 55 34 63 11 14 1053 13 22 44 33 17 22 46 13 25 66 55 56 31 63 11 14 1183 32 21 12 42 75 12 46 21 57 36 65 54 33 46 41 14 1184 33 22 12 43 75 12 62 31 25 36 55 54 36 43 43 14 1185 33 22 12 43 75 12 42 21 55 36 65 54 36 43 43 14 1186 31 11 52 33 57 12 44 11 55 16 57 12 23 14 32 14 1277 43 21 22 21 74 22 22 31 52 76 44 16 64 43 31 14 1278 31 21 36 21 75 22 23 31 51 73 44 67 43 65 42 14 1279 44 21 26 24 74 21 84 11 56 61 44 17 61 43 33 14 1280 44 22 26 23 72 21 22 13 55 66 42 65 42 43 32 14 1281 42 21 22 22 75 22 26 31 55 76 47 62 43 64 42 14 1282 43 22 22 22 75 22 26 31 55 76 47 62 43 64 42 14 1283 43 22 32 43 55 22 82 11 55 66 45 14 66 43 32 14 1284 43 22 22 23 75 22 22 31 55 76 45 64 46 43 33 15 285 41 12 42 23 16 22 26 13 62 36 56 11 22 33 24 15 286 14 22 22 26 43 22 64 13 61 21 52 15 31 55 43 15 287 43 11 24 41 57 11 51 13 75 61 44 12 34 66 41 15 288 14 11 32 31 11 22 86 33 52 36 44 71 62 36 11 15 289 14 22 32 23 73 21 42 11 66 66 54 16 13 35 11 15 290 44 12 22 11 65 21 46 12 66 16 45 55 63 76 44 15 291 41 22 11 23 86 22 64 32 76 71 45 77 34 63 41 15 292 31 22 22 33 77 22 26 34 65 65 45 57 43 33 42 15 293 34 11 21 62 56 21 66 13 65 76 75 67 46 33 31 15 294 44 21 22 32 55 21 42 13 56 66 55 55 65 33 42 15 295 24 22 43 23 27 12 14 13 65 65 77 25 21 63 42 15 296 34 11 32 63 65 12 84 11 65 35 22 75 22 64 43 15 297 24 21 24 26 27 22 56 11 62 16 56 15 35 64 24 15 298 43 12 42 11 14 22 44 13 57 12 44 57 36 44 13 15 299 42 21 24 33 75 22 21 44 66 66 44 41 61 63 33 15 300 14 21 24 63 74 22 46 31 55 67 22 52 16 34 44 15 301 32 12 42 16 55 22 28 33 62 66 12 24 21 46 14 15 302 44 22 42 32 46 21 82 41 57 13 55 51 62 76 44 15 303 44 22 12 31 45 11 48 11 56 36 64 16 43 66 12 15 304 43 11 22 33 54 22 67 11 56 66 75 15 11 53 42 15 305 43 22 62 36 54 21 42 13 66 61 25 72 61 33 44 15 589 14 21 12 31 66 22 44 21 66 11 54 75 46 37 14 15 590 14 22 12 31 65 21 46 22 66 11 54 75 43 36 14 15 591 14 22 12 31 65 21 46 22 66 16 55 75 43 36 14 15 592 11 21 23 33 61 22 68 33 25 63 64 17 26 33 41 15 593 11 21 23 33 61 22 68 33 25 63 64 17 26 33 41 15 594 14 21 22 24 45 21 45 31 17 16 24 51 13 56 34 15 595 43 21 24 64 35 21 45 31 17 16 24 11 33 56 44 15 596 14 21 22 24 45 21 65 11 67 26 54 12 34 56 41 15 597 44 21 21 32 56 21 46 13 55 66 55 57 66 33 41 15 598 43 11 22 26 55 12 26 31 66 67 57 56 64 33 43 15 599 44 21 21 32 56 21 46 13 55 66 55 57 66 33 41 15 600 43 11 22 26 55 12 26 31 66 67 57 56 54 33 23 15 601 44 21 21 32 56 21 46 13 55 66 55 57 66 33 41 15 781 44 21 22 32 75 21 22 43 66 66 45 45 65 63 32 15 782 23 11 42 36 55 22 16 41 66 67 47 16 14 33 33 15 783 24 11 42 32 55 21 12 43 66 66 45 15 15 33 32 15 784 44 21 22 32 75 21 22 43 66 66 45 45 65 63 32 15 785 44 12 42 33 45 22 64 11 55 76 25 25 66 43 44 15 786 14 22 22 63 45 22 64 11 55 76 25 25 66 43 44 15 787 44 12 42 33 45 22 64 11 55 76 25 25 66 43 44 15 788 44 11 41 33 45 22 64 11 55 76 25 25 66 43 41 15 789 31 22 21 63 56 22 84 32 26 61 25 47 14 63 41 15 790 31 12 41 13 56 22 24 32 66 61 15 27 24 43 11 15 791 31 12 41 13 56 22 24 32 66 61 15 27 24 43 11 15 792 44 22 22 23 65 12 24 11 75 36 55 15 26 63 44 15 905 14 21 12 32 65 21 42 23 66 16 55 75 46 33 14 15 906 14 21 12 32 65 21 42 23 66 16 55 75 46 33 14 15 907 43 21 22 16 55 12 66 21 66 17 47 56 34 63 43 15 908 43 21 22 16 55 11 62 23 66 16 45 55 36 63 44 15 909 13 21 13 36 66 21 48 21 66 13 52 77 42 36 14 15 910 14 21 12 33 65 22 44 21 65 15 42 55 62 74 43 15 911 14 12 33 33 17 22 84 33 55 35 47 75 61 33 12 15 912 11 22 22 23 47 22 66 14 65 25 45 27 43 63 12 15 913 41 12 23 42 57 12 54 11 76 66 45 11 31 63 41 15 914 31 12 42 43 56 12 56 13 72 66 46 11 32 63 44 15 915 31 12 42 43 56 12 56 13 72 66 46 11 32 63 44 15 916 42 12 12 22 62 12 65 31 56 61 55 71 63 36 12 15 917 42 11 14 26 67 12 66 31 52 66 56 75 65 34 14 15 918 44 21 24 26 67 22 46 11 52 66 56 55 65 34 44 15 919 44 21 24 36 57 22 45 11 56 61 55 55 65 34 44 15 1187 33 21 24 14 45 21 45 31 77 26 44 71 63 46 34 15 1285 44 12 21 23 54 11 24 31 65 13 54 76 43 36 12 15 1286 44 12 21 23 54 11 24 31 65 63 56 51 64 36 41 15 1287 43 22 22 16 54 11 62 23 66 11 45 52 31 63 44 15 1288 33 12 22 66 54 11 22 33 66 61 55 52 61 33 44 15 1289 11 22 21 33 66 22 64 32 26 61 65 17 24 33 41 15 1290 14 21 22 32 65 21 62 33 26 66 65 15 26 33 44 15 1291 31 12 41 43 56 12 54 32 26 61 65 17 26 33 44 15 1292 14 21 22 32 65 21 62 33 26 66 65 15 26 33 44 15 1469 33 11 42 43 54 12 57 11 76 66 45 15 31 63 42 15 1470 33 11 42 43 54 12 57 11 76 66 45 15 31 63 42 15 1471 33 11 42 43 54 12 56 11 75 66 47 11 31 65 44 16 306 41 22 12 22 54 22 62 11 36 11 64 55 32 77 42 16 307 11 12 32 32 77 12 26 11 76 16 44 56 64 33 33 16 308 33 12 43 21 44 12 84 13 65 66 54 51 41 34 43 16 309 14 22 22 22 35 21 21 11 66 67 44 15 22 37 11 16 310 32 21 23 32 21 21 66 21 45 73 54 21 36 65 14 16 311 43 12 42 21 41 22 66 11 66 16 25 65 65 36 13 16 312 13 21 22 33 56 22 52 34 55 16 52 55 32 33 23 16 313 34 22 24 12 26 21 52 11 65 66 45 65 16 44 14 16 314 43 11 12 33 57 11 26 33 65 56 24 65 34 46 11 16 315 34 21 22 23 45 22 24 31 31 36 66 72 31 47 42 16 316 14 11 21 31 55 22 44 33 66 56 52 71 33 36 23 16 317 31 12 21 21 45 11 52 31 63 17 44 51 61 67 23 16 602 34 12 42 22 45 11 81 11 66 67 54 55 12 47 41 16 603 34 22 32 12 45 21 41 31 56 67 44 15 12 47 31 16 604 41 21 13 23 57 21 62 11 37 11 64 55 36 73 43 16 605 11 22 23 23 47 21 22 11 67 11 44 55 26 73 23 16 920 41 22 22 23 55 12 15 13 65 71 45 55 23 73 12 16 921 33 11 42 23 46 12 82 14 65 66 52 55 12 43 42 16 922 43 21 22 23 56 12 12 14 65 76 45 55 23 73 12 16 923 43 22 22 21 51 12 16 11 66 76 45 55 25 76 13 16 924 34 21 34 12 44 22 46 31 56 61 42 16 15 46 33 16 925 13 12 32 33 72 22 66 12 34 17 65 52 33 76 41 16 926 43 22 12 23 52 22 66 12 34 17 65 52 33 76 41 16 927 14 22 34 32 76 11 22 11 75 16 45 55 66 74 24 16 928 14 22 24 21 42 22 25 11 66 16 44 56 21 34 31 16 929 13 22 32 21 42 22 25 11 66 16 44 56 21 74 21 16 930 13 22 22 21 42 22 25 11 66 16 44 56 21 74 21 16 1188 31 12 22 22 44 12 52 31 36 71 44 15 12 77 32 16 1293 34 12 24 31 62 22 25 41 56 66 54 56 21 74 11 16 1294 31 12 22 32 64 22 22 41 56 61 54 55 32 33 23 16 1295 31 12 22 32 64 22 22 41 56 61 54 55 32 33 23 16 1296 34 11 22 33 65 22 24 41 51 66 26 52 21 37 22 16 1297 34 11 42 23 45 12 84 11 51 66 26 52 21 37 22 16 1298 13 21 22 33 57 21 56 33 55 16 52 56 33 34 21 16 1299 44 21 21 23 55 11 12 13 66 75 42 56 34 36 21 16 1300 14 21 21 33 55 21 52 33 56 15 52 56 33 34 21 16 1301 14 21 31 21 45 22 24 13 66 16 42 51 23 76 23 17 318 44 11 22 62 78 12 56 31 56 13 24 15 41 64 44 17 319 11 22 32 36 71 11 66 31 67 33 54 31 66 44 24 17 320 33 12 42 12 55 22 46 11 52 61 42 51 41 33 14 17 321 42 12 62 31 44 22 18 11 52 66 25 66 14 46 21 17 322 44 21 11 33 77 21 16 31 55 17 47 65 36 66 44 17 323 31 22 36 36 75 12 54 11 63 16 24 25 66 33 44 17 324 12 21 42 32 63 22 68 34 55 66 42 14 34 53 31 17 325 34 11 14 31 56 21 65 13 66 66 42 15 56 16 14 17 326 33 12 12 36 44 21 46 33 66 23 51 72 41 76 23 17 327 11 22 41 22 55 21 28 33 66 37 45 72 16 63 34 17 328 12 22 52 22 61 11 24 31 66 61 54 56 51 46 34 17 329 44 22 22 24 55 22 33 31 23 12 54 15 11 37 34 17 330 43 22 46 22 84 22 86 33 66 61 44 12 66 73 44 17 331 33 12 12 13 55 22 42 12 66 66 48 14 11 36 31 17 332 31 12 64 33 85 12 44 13 56 16 44 75 16 33 14 17 333 12 12 52 32 55 21 26 11 55 61 45 64 34 16 24 17 334 31 22 43 42 74 21 68 31 65 66 25 51 66 63 44 17 335 32 11 24 13 57 22 24 33 25 66 85 57 33 34 24 17 336 44 12 22 23 74 21 26 13 64 14 14 17 66 66 14 17 337 41 11 25 23 77 12 64 31 66 66 47 55 61 66 41 17 338 44 11 14 22 44 22 84 11 65 66 54 55 21 11 43 17 339 41 12 62 32 64 21 44 21 64 16 24 71 31 63 31 17 340 12 12 26 31 54 22 14 33 66 63 55 15 31 36 13 17 341 41 22 22 12 86 22 42 33 65 61 44 15 66 15 14 17 606 43 11 61 33 44 22 14 13 56 62 25 67 14 47 22 17 607 23 21 21 13 44 22 84 13 26 62 55 67 44 67 22 17 608 34 21 21 23 57 21 66 11 25 17 27 15 16 36 44 17 609 34 12 41 13 57 22 41 13 55 61 44 56 43 36 14 17 610 34 12 41 13 57 22 61 13 25 11 24 16 13 36 44 17 611 24 11 24 21 36 22 86 41 56 66 24 41 45 31 11 17 612 14 21 44 31 66 21 65 33 56 66 44 11 35 51 31 17 613 14 21 44 31 66 21 65 33 56 66 42 15 46 36 14 17 614 14 21 22 32 78 12 66 31 66 33 54 35 61 44 24 17 615 14 21 22 62 18 12 66 11 76 33 44 15 61 44 44 17 616 14 21 32 36 77 11 65 33 65 31 52 31 64 46 24 17 617 14 21 22 66 17 11 65 13 75 31 42 11 64 46 44 17 618 14 21 32 32 77 11 65 33 65 31 52 31 64 46 24 17 619 13 21 61 63 55 22 46 11 36 66 42 55 66 36 44 17 793 11 22 52 26 61 11 26 31 67 63 54 51 56 44 34 17 794 41 22 23 23 57 21 36 33 26 13 55 13 16 34 32 17 795 34 22 61 23 47 22 61 33 65 61 44 15 64 73 41 17 796 32 22 22 31 54 22 28 21 62 66 85 46 14 66 12 17 797 32 12 12 11 54 22 48 11 62 66 45 17 14 37 32 17 798 33 11 64 31 85 12 46 11 52 11 42 71 11 33 14 17 799 14 11 52 32 57 21 25 13 55 61 42 61 34 16 24 17 800 14 11 52 32 57 21 25 13 55 61 42 61 34 16 24 17 931 34 21 24 21 56 22 66 11 26 16 24 11 15 31 41 17 932 32 21 22 22 53 22 68 14 25 16 22 14 14 33 41 17 933 42 11 12 32 76 12 66 11 56 76 74 51 65 61 41 17 934 32 21 22 22 53 22 68 14 25 16 22 14 14 33 41 17 935 32 21 22 22 56 22 68 14 25 16 22 14 14 33 41 17 936 13 22 44 34 67 22 66 33 56 66 42 15 36 56 34 17 937 43 11 42 11 65 12 52 33 62 66 28 55 63 63 42 17 938 43 11 42 11 65 12 52 33 62 66 28 55 63 63 42 17 939 14 21 21 63 14 12 64 13 76 32 45 17 64 47 42 17 940 43 11 21 63 74 12 64 33 56 12 22 16 41 64 42 17 941 13 21 21 63 14 12 61 11 75 36 42 16 61 44 42 17 942 43 11 21 63 74 12 54 33 56 12 25 17 44 67 42 17 943 41 12 24 22 85 22 62 13 66 33 44 57 11 46 43 17 944 11 22 24 32 75 12 62 33 66 33 54 37 61 46 23 17 1189 43 11 61 33 64 22 41 21 65 16 22 76 31 64 32 17 1190 11 22 22 26 41 11 46 11 47 63 44 11 16 34 14 17 1191 13 11 21 33 54 22 14 33 66 62 55 17 34 37 12 17 1192 23 21 61 13 44 22 44 33 66 32 55 57 14 67 32 17 1193 43 21 22 36 47 11 66 33 45 41 42 71 64 66 14 17 1302 31 22 22 26 51 21 66 11 27 13 24 11 16 34 44 17 1303 41 12 42 16 61 21 66 11 27 13 24 11 16 34 44 17 1304 44 11 41 13 64 22 64 13 66 62 45 17 54 17 12 17 1305 24 11 21 22 64 22 68 11 66 66 44 15 51 11 13 17 1306 21 12 22 22 66 22 82 43 55 61 24 45 46 35 14 17 1307 21 11 25 23 37 22 84 41 56 66 27 45 46 36 14 17 1308 34 21 22 22 57 21 66 43 56 66 24 45 46 36 14 18 342 21 12 42 12 64 12 64 33 41 16 65 26 41 73 24 18 343 34 22 14 31 57 21 64 33 66 33 54 66 11 56 34 18 344 41 12 24 34 64 12 54 13 66 66 84 11 14 33 33 18 345 41 12 22 33 82 22 32 31 56 66 45 56 11 36 11 18 346 33 22 22 21 65 21 48 33 26 11 41 55 61 63 21 18 347 31 11 21 33 87 21 21 11 56 31 55 65 41 54 24 18 348 44 12 22 26 75 22 42 33 65 63 55 11 64 43 14 18 349 43 22 42 22 56 12 64 11 66 16 52 15 36 43 11 18 350 14 12 22 22 15 22 85 11 16 16 57 55 16 61 44 18 351 34 22 21 21 71 22 65 21 66 76 52 75 26 33 34 18 352 44 21 14 32 44 22 66 31 52 66 55 12 23 67 41 18 353 44 21 12 21 54 22 56 41 26 13 55 55 32 43 44 18 354 14 22 21 63 77 12 84 11 66 61 45 56 66 43 43 18 620 11 22 42 43 42 22 42 31 66 66 45 16 41 36 31 18 621 14 21 42 43 48 22 43 33 65 66 44 15 41 33 31 18 622 44 11 22 43 48 22 43 33 65 66 44 15 41 33 31 18 623 11 22 42 43 42 22 42 31 66 66 45 16 41 36 31 18 624 23 12 41 13 65 12 66 33 46 13 65 26 41 35 43 18 625 13 22 21 23 45 22 46 33 16 63 55 66 11 35 43 18 801 41 22 42 23 52 12 62 11 66 16 55 16 31 46 11 18 802 31 22 22 23 62 22 42 11 66 66 25 56 61 36 11 18 803 31 22 22 23 62 22 42 31 26 16 45 56 64 63 23 18 804 44 21 22 23 58 22 53 13 65 66 74 55 61 13 41 18 805 44 21 22 24 54 22 54 13 66 66 74 51 64 13 41 18 806 41 22 24 64 54 22 24 33 66 66 54 11 64 43 13 18 807 44 11 22 23 78 22 43 33 65 66 54 15 61 43 11 18 945 21 11 41 13 67 11 61 31 46 11 65 25 41 34 44 18 946 21 11 41 13 67 11 61 31 66 31 55 65 11 54 34 18 947 33 21 12 33 58 22 61 31 66 11 65 25 41 34 44 18 948 34 22 11 31 51 22 65 31 66 37 55 67 12 53 34 18 949 33 22 12 32 57 22 66 32 66 37 55 67 12 53 33 18 950 33 22 12 22 47 22 46 32 16 67 55 67 12 33 43 18 951 13 22 22 22 47 22 46 32 16 67 55 65 16 33 44 18 1194 43 22 12 32 77 22 46 12 66 17 55 65 66 33 34 18 1195 13 22 22 62 77 12 86 12 66 17 55 65 66 33 34 18 1196 41 22 12 32 74 22 44 13 61 16 55 66 61 33 34 18 1309 31 22 12 23 42 22 42 31 16 66 55 66 11 36 41 18 1310 31 22 22 23 72 22 62 21 66 76 52 75 26 33 41 18 1311 33 22 22 22 76 22 64 21 66 76 52 75 26 33 31 18 1312 31 22 22 23 72 22 62 21 66 76 55 76 21 36 31 18 1313 34 21 22 21 74 22 66 31 66 33 55 65 12 53 34 18 1314 34 22 11 32 55 22 65 34 62 31 55 65 13 54 34 18 1315 34 22 11 13 14 22 66 33 62 36 55 62 13 57 31 19 355 43 12 44 12 54 22 66 11 66 27 48 55 13 63 34 19 356 31 12 24 23 47 11 52 31 66 62 25 25 63 66 43 19 357 43 11 21 52 44 12 44 11 66 66 42 64 32 76 14 19 358 41 22 12 62 57 22 76 13 45 61 45 25 61 33 41 19 359 43 21 24 22 45 22 88 11 52 63 42 61 41 44 44 19 360 32 11 23 31 41 22 21 31 74 26 87 71 61 34 33 19 361 34 21 24 32 55 21 44 33 56 66 84 65 52 53 34 19 362 23 11 24 31 84 12 26 13 26 76 74 57 63 34 44 19 363 31 11 22 33 57 22 45 13 67 61 45 67 62 35 22 19 364 33 21 22 21 55 22 26 32 76 76 45 74 11 56 24 19 365 14 22 12 23 42 22 22 13 65 11 54 15 11 66 23 19 366 44 12 42 13 77 22 66 13 67 66 55 57 44 36 32 19 367 31 21 22 13 76 12 86 31 77 66 42 71 44 64 32 19 368 43 21 22 63 17 22 48 13 66 36 42 57 13 35 13 19 626 41 12 44 13 57 21 62 11 66 22 45 55 13 66 33 19 627 31 22 44 23 47 21 62 11 66 72 85 55 33 36 43 19 628 41 12 44 13 57 21 62 11 66 22 45 55 13 66 33 19 629 43 11 42 12 54 21 65 13 66 26 42 52 16 66 34 19 630 41 12 22 52 47 12 46 13 65 61 25 45 21 63 41 19 631 34 12 11 26 45 12 47 11 64 66 44 62 36 73 11 19 632 34 12 11 26 45 22 47 11 64 66 24 42 26 63 44 19 633 44 12 21 56 45 12 47 11 64 66 44 62 36 73 14 19 808 34 11 24 31 75 22 56 31 76 12 54 75 21 56 23 19 809 31 12 24 33 57 21 42 11 66 62 45 65 63 36 23 19 810 31 12 24 31 55 22 46 11 66 62 44 65 61 36 23 19 811 11 12 24 33 57 21 42 11 66 62 45 65 63 36 23 19 812 34 11 22 35 14 21 14 11 46 66 72 14 12 46 34 19 813 31 12 22 32 47 22 26 33 75 21 85 75 61 33 31 19 814 21 11 32 15 14 21 14 11 46 66 72 14 12 46 34 19 815 34 11 22 35 44 21 24 31 76 26 82 74 62 33 31 19 816 43 12 44 22 54 12 46 31 66 67 48 55 23 33 44 19 817 34 12 21 16 55 22 67 21 64 66 54 42 16 53 24 19 818 34 11 22 15 54 21 64 21 66 66 54 46 13 67 41 19 819 34 22 21 26 55 22 27 31 74 76 44 72 16 53 24 19 952 13 21 44 32 75 12 28 11 62 23 52 51 31 64 34 19 953 44 12 42 12 54 22 68 11 62 23 42 51 11 64 34 19 1054 32 11 12 23 48 11 42 11 62 67 47 65 36 73 14 19 1055 33 11 14 21 44 12 46 13 66 66 44 67 33 74 14 19 1056 42 21 12 63 58 21 72 13 46 66 44 27 33 74 14 19 1057 33 11 12 22 45 22 46 11 66 62 24 45 21 66 43 19 1058 43 21 12 62 54 21 45 13 46 66 42 22 66 36 44 19 1059 33 11 12 22 44 21 45 13 66 66 22 42 26 66 44 19 1197 33 11 22 33 64 22 82 33 77 62 48 77 46 63 33 19 1238 34 12 22 33 12 22 12 13 65 61 24 45 21 66 43 19 1239 34 12 22 33 12 22 12 13 65 61 24 45 21 66 43 19 1240 14 12 32 13 17 22 16 13 47 66 75 17 14 46 32 19 1316 34 12 12 26 41 12 44 11 66 63 44 65 61 33 41 20 369 12 21 52 23 56 12 44 13 76 61 44 17 16 33 42 20 370 14 11 22 12 47 21 62 34 66 66 24 65 51 64 24 20 371 42 12 42 63 55 22 24 13 65 61 24 12 63 65 43 20 372 21 12 22 46 75 21 48 11 26 66 54 15 44 73 13 20 373 12 21 22 51 67 21 46 31 25 63 42 51 66 44 21 20 374 44 12 62 23 77 11 46 31 13 11 44 34 66 66 44 20 375 34 11 24 42 41 21 42 11 66 23 45 71 23 33 42 20 376 13 12 44 32 55 22 76 33 72 21 55 62 35 46 42 20 377 43 21 11 23 57 11 66 13 56 16 24 65 16 63 14 20 378 41 21 62 32 75 21 27 33 56 16 55 77 33 35 44 20 379 34 11 22 14 55 22 24 11 77 16 54 65 33 36 43 20 380 14 12 22 41 58 22 62 21 72 61 46 57 46 56 44 20 381 34 22 62 33 85 11 44 31 65 16 52 11 23 37 24 20 382 11 12 42 23 37 21 62 21 66 66 54 57 36 43 14 20 383 31 11 22 11 54 12 44 33 56 11 55 64 14 34 13 20 384 12 21 52 26 47 21 24 33 52 66 54 21 42 34 43 20 385 11 21 41 12 58 21 61 31 55 36 52 15 13 45 23 20 386 14 22 22 31 64 22 45 11 54 43 55 54 65 36 34 20 387 31 21 26 66 54 21 64 13 56 36 26 25 61 13 12 20 388 44 11 22 23 44 12 41 11 55 16 42 46 11 46 43 20 389 43 21 42 12 54 12 14 11 66 31 75 15 43 34 33 20 390 21 11 31 22 67 12 86 31 67 32 44 65 44 47 44 20 634 21 22 22 34 57 22 44 31 52 16 44 25 34 53 33 20 635 42 11 42 64 57 22 24 11 62 66 25 11 64 67 41 20 636 24 11 26 12 77 11 64 13 51 31 24 13 66 46 24 20 637 24 11 24 12 71 11 62 11 56 33 25 11 63 43 12 20 638 12 11 22 13 46 22 64 33 66 61 24 67 56 63 24 20 639 42 11 22 23 76 12 24 43 66 61 44 57 16 43 42 20 640 42 11 22 23 76 12 24 43 66 61 24 67 56 63 22 20 641 33 21 41 23 57 21 66 33 26 16 54 25 56 63 24 20 642 33 21 41 23 57 21 66 33 76 26 54 65 36 43 44 20 954 24 11 22 44 75 22 44 11 27 66 54 15 43 76 13 20 955 43 11 42 61 55 22 22 11 67 61 25 16 63 63 44 20 956 44 11 42 62 57 21 22 14 66 66 22 16 65 66 42 20 957 44 11 42 62 57 21 22 14 66 66 52 16 45 76 12 20 958 22 11 22 43 76 22 24 13 66 61 24 17 66 63 42 20 959 22 11 22 43 76 22 44 13 26 61 54 17 46 73 12 20 960 42 11 42 63 56 22 24 13 66 61 24 17 66 63 42 20 961 42 11 42 63 56 22 24 13 66 61 24 17 66 63 42 20 962 11 21 22 44 75 22 46 12 27 66 44 55 44 35 34 20 963 11 21 22 44 75 22 46 12 27 66 44 25 36 56 34 20 964 11 21 22 44 75 22 46 12 27 66 46 57 46 36 34 20 965 21 12 22 33 67 21 42 31 66 16 44 77 66 33 24 20 966 21 11 22 32 65 21 47 33 66 16 45 77 63 35 44 20 967 24 12 26 33 67 22 42 33 66 16 45 77 63 35 44 20 968 14 12 26 13 47 22 62 33 65 11 45 77 63 63 24 20 1060 34 12 12 33 75 11 64 31 65 66 42 51 63 37 44 20 1061 34 11 16 32 77 11 64 33 61 61 44 53 66 36 44 20 1062 32 11 12 31 77 11 66 31 65 63 42 51 66 34 42 20 1063 32 21 42 21 57 21 66 31 75 23 52 61 36 44 42 20 1198 14 11 22 14 45 22 44 31 67 16 54 45 43 46 33 20 1199 34 11 22 14 45 22 44 31 67 16 54 45 43 46 33 20 1200 33 11 21 23 47 21 46 13 66 16 54 55 36 43 34 20 1201 13 12 64 62 55 22 66 13 55 33 22 21 66 14 12 20 1202 12 11 12 23 86 12 14 13 56 61 24 57 36 53 32 20 1203 44 21 22 12 47 21 52 14 46 36 52 46 55 66 42 20 1317 42 11 42 66 57 21 24 13 62 66 24 11 62 64 43 20 1318 21 11 21 32 67 22 46 31 67 12 44 75 64 37 24 20 1319 22 11 23 42 76 21 28 13 66 63 24 16 64 64 44 20 1320 44 11 22 23 74 12 21 41 65 66 52 16 41 76 13 20 1321 32 11 12 33 76 12 44 33 16 11 44 37 66 63 44 20 1322 44 11 64 26 75 12 42 31 16 16 42 31 66 66 44 20 1323 42 11 62 23 76 12 44 33 16 61 44 57 66 33 42 20 1324 34 11 14 36 75 12 62 31 66 66 42 51 66 36 44 21 391 33 22 14 32 64 22 62 11 77 61 45 55 13 64 23 21 392 32 11 42 36 77 21 62 31 66 11 45 12 63 34 42 21 393 43 22 24 22 55 22 45 11 72 26 24 56 13 76 43 21 394 21 11 41 22 56 21 42 31 56 66 44 54 15 63 14 21 395 31 12 21 31 67 22 26 31 11 61 54 47 26 43 42 21 396 41 12 22 36 77 22 61 11 15 66 74 25 13 64 44 21 397 44 12 21 23 48 22 62 14 66 11 25 61 43 46 33 21 398 11 12 43 13 57 22 82 33 21 61 55 75 23 63 42 21 399 34 21 22 21 77 22 74 11 52 13 54 17 64 34 24 21 400 41 11 14 13 44 21 44 13 66 76 47 25 43 63 42 21 401 34 21 43 61 44 22 86 31 56 63 45 52 41 33 13 21 402 14 12 44 33 55 22 26 13 16 76 74 11 13 76 23 21 403 34 21 42 32 53 12 12 31 65 66 52 62 43 33 44 21 404 44 12 21 33 55 22 35 13 15 66 44 76 46 66 22 21 405 11 22 42 22 45 22 42 11 66 11 42 55 66 33 44 21 406 33 22 22 26 54 21 62 31 27 24 44 65 63 37 41 21 407 11 21 22 36 54 21 24 14 65 36 45 55 61 43 22 21 408 41 11 22 36 44 22 68 13 56 16 42 51 64 33 23 21 409 34 21 22 63 57 12 44 11 62 66 52 75 36 33 22 21 410 41 22 23 42 37 22 22 31 61 16 45 16 46 43 34 21 411 33 22 24 23 45 22 48 11 65 66 45 65 66 34 13 21 412 33 12 21 23 46 22 22 31 76 16 65 64 53 43 34 21 413 24 22 61 23 16 22 58 33 57 62 42 52 33 33 41 21 414 13 11 42 21 85 21 82 33 65 16 25 12 16 63 41 21 415 13 12 22 36 75 22 48 31 76 61 14 71 63 63 44 21 416 23 21 24 32 54 22 62 13 62 66 45 11 12 46 32 21 417 44 22 23 23 74 11 46 31 65 16 54 76 43 45 24 21 418 41 11 22 36 55 21 25 33 66 66 55 66 62 36 24 21 419 43 22 32 21 45 12 46 13 65 66 84 55 36 33 43 21 420 44 22 62 22 57 21 24 11 22 62 75 61 36 37 42 21 421 44 12 44 32 45 22 46 21 57 31 55 65 36 43 42 21 422 34 21 22 33 45 22 24 11 76 31 77 57 24 76 23 21 423 13 12 11 32 58 21 42 11 66 16 74 56 13 34 41 21 424 42 21 22 42 48 21 48 13 15 16 44 21 24 33 44 21 425 13 12 34 22 74 22 64 11 52 36 45 72 16 63 44 21 426 31 22 21 23 51 21 57 14 77 37 44 27 33 47 43 21 427 41 21 61 32 47 22 46 33 22 66 44 56 23 23 33 21 643 14 21 32 31 77 22 24 31 12 13 54 57 34 34 24 21 644 13 22 32 32 77 22 27 31 15 11 55 51 36 33 22 21 645 14 11 42 12 57 22 87 31 25 61 55 71 26 63 42 21 646 13 12 42 12 57 22 87 31 25 61 55 71 26 63 42 21 647 14 11 42 11 57 22 84 31 22 63 54 77 34 34 24 21 648 42 21 24 22 55 22 44 11 76 26 24 55 11 76 41 21 649 42 21 24 22 55 22 44 13 75 26 24 55 11 76 41 21 650 34 12 21 33 68 22 22 34 16 61 55 41 23 46 43 21 651 14 22 11 13 78 22 62 14 16 11 45 71 63 36 23 21 652 34 12 21 32 64 22 26 31 16 61 52 46 64 34 23 21 653 34 11 22 32 64 22 26 31 16 61 52 46 24 44 43 21 654 34 12 21 33 68 22 22 34 16 61 55 41 23 46 43 21 655 33 21 44 23 47 22 26 13 76 11 54 51 36 43 34 21 656 33 21 14 23 47 22 26 13 76 11 54 51 36 43 34 21 820 34 22 42 62 45 22 84 31 57 62 42 55 41 37 14 21 821 42 11 34 12 45 22 64 13 65 36 54 25 11 36 31 21 822 34 22 42 62 45 22 84 31 57 62 42 55 41 37 14 21 823 34 21 42 31 57 12 14 31 62 63 54 67 44 34 44 21 824 34 21 42 31 57 12 14 31 61 61 55 65 43 33 42 21 825 13 22 22 32 57 22 27 11 65 31 45 51 66 33 24 21 826 11 11 24 61 45 12 48 43 52 66 55 57 12 36 24 21 827 13 21 42 23 46 22 42 13 61 16 45 54 62 34 44 21 828 14 21 22 22 54 22 26 11 66 11 22 56 64 34 43 21 829 44 21 22 42 37 22 27 31 65 11 45 11 46 43 32 21 830 14 21 32 22 77 22 27 11 15 61 55 61 66 33 42 21 969 13 22 31 33 76 22 22 31 16 16 55 54 33 33 24 21 970 13 21 32 33 76 22 22 33 11 16 55 54 32 34 24 21 971 14 22 31 33 78 22 22 34 16 11 55 51 33 36 23 21 972 14 22 31 33 78 22 22 34 16 11 55 51 33 36 23 21 973 34 22 21 23 78 22 72 14 56 11 55 51 33 36 23 21 974 42 12 22 13 75 22 46 13 22 36 45 71 42 46 42 21 1064 23 11 44 23 57 22 46 13 66 61 44 51 16 63 14 21 1065 43 21 24 23 57 22 46 13 76 21 24 51 16 73 44 21 1066 43 22 21 22 54 22 42 11 77 21 25 55 13 64 14 21 1067 23 12 41 22 54 22 42 13 76 61 45 55 13 64 13 21 1068 43 22 21 22 54 22 42 11 67 61 45 55 13 64 13 21 1069 43 22 21 22 54 22 42 11 67 61 44 51 16 63 14 21 1070 23 11 44 23 57 22 46 13 66 61 44 51 16 63 14 21 1071 23 12 41 22 54 22 42 11 67 61 45 55 13 74 43 21 1072 44 21 12 23 47 22 64 11 62 16 22 65 46 43 32 21 1073 34 12 22 36 65 21 24 31 16 66 55 47 63 33 22 21 1074 33 12 22 36 65 21 24 31 16 66 55 47 63 33 22 21 1075 33 22 12 26 45 21 64 11 66 16 25 67 43 43 32 21 1076 43 22 12 26 45 21 64 11 66 16 25 67 43 43 32 21 1077 14 21 12 13 75 22 65 13 15 16 44 76 66 36 22 21 1078 14 22 11 13 75 22 65 13 15 16 44 76 66 36 22 21 1079 41 21 14 33 84 21 24 43 66 16 57 15 33 63 32 21 1080 31 12 42 36 77 22 66 31 61 16 47 12 61 36 44 21 1204 33 21 24 23 57 22 66 33 26 21 44 61 66 37 44 21 1205 34 22 22 63 57 22 66 33 26 21 44 61 66 33 44 21 1206 13 12 42 32 55 22 24 11 17 72 72 15 11 76 21 21 1207 44 22 42 32 55 22 64 31 67 62 42 15 31 66 31 21 1208 43 22 42 32 55 22 64 31 67 62 42 15 31 66 31 21 1209 43 22 22 22 77 12 47 11 25 21 55 15 63 73 22 21 1210 33 21 22 13 56 22 42 13 61 66 85 54 32 34 44 21 1211 41 22 33 23 47 12 42 13 61 61 85 55 33 33 42 21 1212 13 12 21 32 74 22 42 31 77 61 15 15 33 34 43 21 1213 33 22 21 62 54 22 82 11 67 11 45 15 33 34 43 21 1214 42 21 34 33 47 12 66 13 56 66 44 65 31 56 41 21 1215 43 21 24 23 77 12 46 33 66 11 54 71 46 43 24 21 1216 42 21 34 32 45 12 64 11 56 61 44 61 31 56 41 21 1325 14 21 34 33 74 22 24 32 15 13 55 56 33 34 24 21 1326 44 21 14 33 84 22 24 42 65 13 55 56 33 34 24 21 1327 24 12 41 23 58 22 42 14 66 61 45 51 33 46 33 21 1328 31 22 13 23 48 22 22 14 76 11 55 51 33 46 33 21 1329 34 22 11 23 48 22 22 14 76 11 55 51 33 46 33 21 1330 31 22 13 23 47 22 22 13 71 11 55 55 33 43 32 21 1331 33 22 12 22 44 22 24 31 66 16 54 56 36 43 31 21 1332 33 22 14 23 45 22 28 31 65 16 55 55 36 44 33 21 1333 33 22 12 22 44 22 24 11 76 66 44 56 16 63 11 21 1334 34 22 11 23 46 22 28 13 77 12 42 12 63 33 41 21 1335 42 22 26 22 51 22 45 13 65 66 44 55 13 63 14 21 1336 32 22 16 22 41 22 25 13 75 16 44 15 63 33 44 21 1337 24 11 42 23 54 22 46 11 66 66 44 55 16 63 12 21 1338 31 11 44 32 78 22 68 33 66 11 42 11 61 36 41 21 1339 31 11 44 32 78 22 68 33 66 11 42 51 11 66 14 21 1340 21 11 44 32 78 22 68 33 66 11 42 11 61 36 44 21 1341 21 11 44 22 58 22 48 13 66 11 42 11 61 36 44 21 1444 43 22 22 46 45 22 46 13 16 11 44 21 26 33 44 21 1445 44 22 22 43 47 22 46 13 16 11 44 21 26 33 44 21 1446 13 12 32 22 74 22 64 11 56 36 44 76 16 63 41 21 1447 33 22 41 22 44 22 44 11 26 66 54 26 66 33 41 21 1448 33 22 22 32 55 22 44 11 67 12 72 75 41 66 31 21 1449 31 21 24 33 45 22 22 11 71 37 77 51 21 77 22 21 1460 33 12 41 32 78 21 64 31 26 26 44 66 63 33 44 21 1461 31 21 21 23 55 22 64 31 26 21 47 65 61 33 44 21 1462 33 22 21 22 58 21 62 31 26 26 44 66 61 33 44 21 1472 41 21 41 32 57 22 66 33 62 66 44 16 33 63 33 21 1473 41 21 41 32 57 22 66 33 62 66 44 16 33 63 13 21 1474 33 22 12 22 45 22 25 11 77 13 44 12 63 34 44 21 1475 24 11 42 23 55 22 42 13 66 66 45 56 66 33 22 22 428 31 12 22 13 15 22 64 31 67 11 47 75 23 65 42 22 429 34 21 15 21 54 22 65 13 62 26 84 55 36 47 14 22 430 13 21 32 26 45 22 12 11 66 66 45 55 46 35 44 22 431 34 21 22 33 25 12 28 13 65 67 44 61 32 43 21 22 432 33 22 12 33 56 11 44 11 56 66 24 16 64 34 23 22 433 22 11 21 62 81 22 54 14 77 66 44 55 36 65 13 22 434 41 12 46 33 11 12 26 13 66 16 74 55 24 33 33 22 435 43 22 44 24 44 12 56 12 66 66 45 25 31 33 41 22 436 34 11 16 23 44 22 62 11 65 66 44 25 42 66 41 22 437 43 21 22 63 55 22 41 11 56 11 24 77 61 36 22 22 438 44 12 24 21 45 22 56 13 55 61 65 15 11 31 12 22 439 44 11 62 16 55 22 62 34 66 36 72 55 24 64 31 22 440 43 11 62 21 74 22 24 11 56 66 58 15 63 36 31 22 441 41 22 22 31 11 22 64 11 27 66 77 55 61 43 42 22 442 31 12 41 61 44 22 21 41 26 76 52 11 34 63 42 22 657 31 22 16 33 51 12 46 13 56 66 24 15 64 33 23 22 658 31 22 26 33 61 11 42 11 66 61 47 65 42 43 33 22 659 33 12 22 63 52 21 22 11 66 66 54 56 63 54 41 22 660 14 21 32 23 45 22 18 13 65 67 44 51 42 33 41 22 661 34 11 22 63 55 22 28 13 65 67 54 51 62 53 41 22 662 13 22 21 32 55 22 46 11 76 12 78 55 33 54 21 22 663 33 12 21 12 15 22 66 31 66 12 48 75 23 54 21 22 664 24 12 14 22 14 21 45 41 76 66 44 52 33 63 14 22 665 24 12 14 22 14 21 45 41 76 66 44 52 33 63 14 22 666 24 12 14 22 14 21 46 42 76 66 45 55 61 53 31 22 831 43 12 61 32 45 22 26 11 56 62 48 55 23 64 11 22 832 43 11 22 66 55 22 22 41 66 66 25 55 46 45 14 22 833 43 11 62 16 55 22 62 31 66 36 75 55 26 65 34 22 834 44 11 22 63 55 22 28 43 65 67 24 51 42 43 14 22 835 41 12 23 22 44 22 51 11 56 66 64 15 14 33 14 22 836 41 22 23 22 44 22 51 11 56 66 64 15 14 33 11 22 837 41 12 66 23 41 21 42 11 66 61 87 55 32 63 13 22 838 41 12 66 23 71 21 22 11 56 61 57 15 62 33 33 22 839 44 22 24 62 54 21 45 11 56 16 24 72 63 33 24 22 975 33 21 12 36 55 12 42 11 56 66 25 15 66 35 24 22 976 13 22 62 33 12 21 62 31 66 66 44 56 43 34 31 22 977 13 22 62 33 12 21 62 31 66 66 44 56 43 34 31 22 978 13 21 62 36 15 22 62 31 66 66 45 55 46 35 34 22 1217 13 21 22 16 15 22 42 11 76 66 75 55 16 35 24 22 1218 44 21 46 23 44 12 52 11 65 66 44 25 32 36 41 22 1219 24 11 16 23 14 22 42 41 75 66 44 55 32 66 11 22 1220 44 21 46 23 44 12 52 11 65 66 44 25 32 36 41 22 1221 44 21 46 23 44 12 52 11 65 66 44 25 32 36 41 22 1342 11 22 61 31 14 22 62 34 62 67 45 51 43 36 34 22 1454 32 21 61 32 11 22 64 34 67 66 44 55 43 36 31 22 1455 12 21 61 32 11 22 64 34 67 66 44 65 33 46 11 22 1456 32 21 21 32 21 12 24 14 67 66 44 65 33 46 11 23 443 42 11 22 25 75 11 66 31 26 63 55 51 62 33 34 23 444 34 21 22 33 65 22 24 11 66 66 74 51 63 67 11 23 445 44 11 61 14 75 22 44 33 66 66 42 55 31 33 24 23 446 33 22 32 23 57 22 72 11 55 26 21 75 11 63 34 23 447 11 11 22 32 74 22 86 41 65 61 55 51 36 66 44 23 448 43 11 32 33 55 22 62 33 66 66 54 12 51 66 33 23 449 13 12 42 42 71 21 86 11 26 66 45 72 31 37 24 23 450 13 12 41 15 64 12 42 31 55 16 84 55 61 66 44 23 451 34 22 26 16 75 21 28 33 55 16 81 55 66 36 33 23 452 13 21 22 23 56 21 54 12 56 33 82 47 21 36 41 23 453 33 12 12 12 65 21 46 11 65 61 44 45 41 36 43 23 454 34 22 22 26 11 22 62 31 52 76 25 61 13 33 34 23 455 33 21 42 33 56 22 48 11 51 61 84 77 36 73 11 23 456 34 12 21 43 85 22 21 31 16 11 87 55 32 76 14 23 457 43 22 26 33 65 21 42 31 67 16 45 11 55 33 24 23 458 21 21 22 21 45 22 68 31 55 66 55 15 12 33 31 23 459 13 21 21 31 54 12 22 31 56 66 55 55 16 64 13 23 667 43 12 13 42 55 22 47 31 65 62 22 57 11 36 43 23 668 43 12 13 42 55 22 47 31 65 62 22 57 11 36 43 23 669 43 12 22 23 76 12 62 31 26 66 57 51 63 37 31 23 670 23 12 22 53 56 12 62 11 66 36 57 15 26 36 41 23 671 14 12 46 16 45 22 22 13 55 61 48 55 16 63 43 23 672 34 22 16 56 45 21 28 13 55 66 41 55 16 66 43 23 673 33 22 12 51 47 22 22 33 55 11 81 55 66 66 43 23 674 14 12 46 16 65 21 28 13 55 16 81 55 66 66 43 23 675 13 12 42 11 67 12 42 33 55 11 88 55 66 63 43 23 676 13 11 22 23 45 22 62 13 56 16 54 12 61 66 43 23 677 13 11 23 23 45 22 66 13 56 16 55 11 65 66 43 23 840 13 21 22 23 55 22 52 13 56 36 84 42 21 36 44 23 841 11 21 22 22 54 22 56 11 55 31 85 41 26 36 44 23 842 31 21 24 21 15 22 62 33 55 76 24 65 11 36 34 23 843 34 22 26 26 15 22 62 33 55 71 28 65 16 33 33 23 979 33 22 32 22 55 21 76 11 55 21 24 75 11 66 33 23 980 43 12 12 42 55 21 46 31 65 61 24 55 11 36 43 23 981 43 11 11 41 56 22 44 31 66 66 24 54 14 33 44 23 982 33 21 31 21 56 22 74 11 56 26 24 74 14 63 34 23 983 43 12 22 22 71 11 66 31 26 66 55 52 61 33 32 23 984 23 12 23 52 55 12 67 11 65 32 52 15 21 33 44 23 985 13 12 44 13 65 22 24 11 55 16 88 57 63 67 41 23 986 43 21 62 63 56 12 88 31 51 61 14 57 66 67 31 23 1343 14 22 26 26 55 21 28 33 65 66 41 25 16 66 43 23 1344 34 12 26 36 55 21 28 13 55 36 81 45 16 66 43 23 1345 34 12 26 36 55 21 22 31 65 66 44 25 11 66 44 23 1346 33 12 21 35 54 22 22 31 65 66 44 25 11 66 44 23 1347 14 22 26 26 55 21 58 13 55 36 81 45 26 36 43 23 1348 13 22 21 25 54 22 52 11 55 36 84 45 21 36 44 23 1349 14 22 21 23 55 22 51 11 56 31 87 45 22 36 44 23 1450 11 12 22 12 55 22 85 11 55 63 58 54 22 33 14 23 1451 44 22 26 36 65 21 42 31 65 16 44 12 51 36 24 23 1452 44 22 66 36 55 11 22 11 75 66 54 15 51 36 44 23 1453 13 22 21 35 54 12 22 31 55 66 54 55 11 66 14 23 1457 34 22 36 26 55 21 78 13 55 26 21 55 16 36 43 23 1458 24 12 26 56 55 11 68 13 65 36 51 14 21 36 44 23 1459 23 11 22 53 55 12 62 13 65 36 51 15 26 36 43 loki/data/gaw9_phenotyp0100644000076500007650000035454107445627300014447 0ustar heathheath 1 1 0 0 460 0 0 1 80 D 0 1 2 0 0 460 0 0 2 77 D 0 1 3 0 0 463 0 0 1 64 D 0 1 4 0 0 463 0 0 2 63 D 0 1 5 0 0 992 0 0 2 61 D 0 1 6 0 0 679 0 0 1 67 D 0 1 7 0 0 987 0 0 2 59 D 0 1 8 0 0 678 0 0 1 56 D 0 1 9 0 0 988 0 0 2 80 D 0 1 10 0 0 1125 0 0 1 67 0 20.87 77.14 130.20 40.14 260.80 1 11 0 0 1244 0 0 2 66 0 A 31.14 94.90 142.00 46.37 167.74 1 12 0 0 1122 0 0 1 65 0 24.52 85.45 142.55 44.73 217.49 1 13 0 0 1120 0 0 1 64 0 25.68 85.05 130.25 41.37 292.74 1 14 0 0 1118 0 0 1 49 0 33.28 75.97 166.23 32.27 313.75 1 15 0 0 1418 0 0 1 40 0 30.44 70.08 134.41 47.89 193.82 1 16 0 0 1419 0 0 1 40 0 33.63 78.64 124.67 44.05 282.37 1 17 0 0 1476 0 0 2 37 0 28.60 56.85 142.01 36.89 313.60 1 460 1 2 987 461 461 1 80 D 0 1 461 1 2 988 462 462 1 80 D 0 1 462 1 2 678 0 0 2 80 D 0 1 463 3 4 992 464 464 1 72 D 0 1 464 3 4 679 0 0 2 63 D 0 1 678 8 462 0 0 0 2 64 0 26.23 75.79 143.66 42.77 267.60 1 679 6 464 1244 680 680 1 53 D 0 1 680 6 464 1120 681 681 2 64 0 A 40.67 97.68 157.29 45.94 304.39 1 681 6 464 1241 0 0 1 58 0 31.98 77.29 115.52 42.60 197.15 1 987 460 7 0 0 0 1 65 0 38.33 86.83 161.52 51.08 279.67 1 988 461 9 1125 989 989 2 67 0 A 35.65 105.85 172.74 42.45 214.18 1 989 461 9 1122 990 990 2 61 0 24.89 84.20 131.24 39.43 185.26 1 990 461 9 1241 991 991 2 60 1 A 33.27 90.52 167.71 48.36 204.04 1 991 461 9 1118 0 0 2 49 0 A 35.88 103.28 174.32 44.65 206.67 1 992 463 5 0 0 0 2 75 0 35.97 78.88 148.74 39.68 253.70 1 1118 14 991 0 1119 1119 1 17 0 40.06 48.40 149.72 36.55 382.21 1 1119 14 991 0 0 0 2 16 0 A 31.86 90.04 186.15 39.47 656.53 1 1120 13 680 0 1121 1121 2 31 0 31.96 50.55 134.71 41.03 522.13 1 1121 13 680 0 0 0 1 26 0 37.29 81.45 158.42 44.73 497.90 1 1122 12 989 0 1123 1123 2 36 0 33.38 58.30 130.71 41.77 254.42 1 1123 12 989 0 1124 1124 2 29 0 34.81 64.74 140.91 45.57 278.70 1 1124 12 989 0 0 0 1 25 0 31.20 68.15 126.72 38.76 393.20 1 1125 10 988 0 1126 1126 2 29 0 40.06 65.92 135.98 41.74 297.46 1 1126 10 988 0 0 0 2 19 0 34.31 60.25 137.42 36.23 335.26 1 1241 681 990 0 1242 1242 1 36 0 A 36.04 94.55 147.61 45.88 325.40 1 1242 681 990 0 1243 1243 1 34 0 A 35.82 105.35 134.97 48.80 279.83 1 1243 681 990 0 0 0 1 27 0 25.87 70.15 137.95 42.56 212.28 1 1244 679 11 1476 1245 1245 1 41 0 33.43 71.35 122.55 45.10 193.57 1 1245 679 11 1418 1246 1246 2 38 0 35.55 68.29 101.51 43.22 235.93 1 1246 679 11 1419 1247 1247 2 37 0 38.30 47.53 124.14 41.70 238.48 1 1247 679 11 0 0 0 1 29 0 32.52 68.72 123.04 42.33 319.87 1 1418 15 1245 0 0 0 1 17 0 32.31 66.18 129.14 44.00 189.30 1 1419 16 1246 0 0 0 2 18 0 25.85 67.93 117.60 42.42 438.34 1 1476 1244 17 0 1477 1477 2 17 0 26.22 66.20 127.90 43.67 321.63 1 1477 1244 17 0 0 0 1 16 0 22.94 49.55 108.71 43.33 425.62 2 18 0 0 465 0 0 1 63 D 0 2 19 0 0 465 0 0 2 77 D 0 2 20 0 0 469 0 0 1 55 D 0 2 21 0 0 469 0 0 2 79 D 0 2 22 0 0 682 0 0 1 46 D 0 2 23 0 0 684 0 0 1 75 D 0 2 24 0 0 993 0 0 2 73 D 0 2 25 0 0 996 0 0 2 80 D 0 2 26 0 0 1081 0 0 2 60 D 0 2 27 0 0 1127 0 0 1 79 D 0 2 28 0 0 690 0 0 1 34 D 0 2 29 0 0 1130 0 0 1 75 0 25.83 67.17 139.89 31.67 277.40 2 30 0 0 1253 0 0 2 71 0 32.90 69.22 119.68 39.45 234.18 2 31 0 0 1251 0 0 2 66 0 26.51 67.36 137.81 37.27 350.27 2 32 0 0 1134 0 0 1 60 0 23.22 68.19 117.34 38.88 330.63 2 33 0 0 1467 0 0 2 55 0 29.02 63.30 148.26 41.30 261.05 2 34 0 0 1350 0 0 2 54 0 34.40 87.12 173.28 44.64 174.95 2 35 0 0 1463 0 0 2 53 0 34.94 73.90 121.42 40.57 276.31 2 36 0 0 1425 0 0 1 49 0 33.60 70.81 146.72 37.97 166.56 2 37 0 0 1421 0 0 1 47 0 31.29 69.45 134.32 40.12 203.33 2 38 0 0 1479 0 0 2 40 0 35.40 69.98 152.52 36.09 328.87 2 39 0 0 1420 0 0 1 40 0 30.36 65.83 155.76 37.39 314.13 2 40 0 0 1478 0 0 2 38 0 33.57 68.90 157.73 42.85 315.06 2 41 0 0 1424 0 0 1 38 0 28.20 69.21 141.52 43.71 295.42 2 465 18 19 993 466 466 1 68 D 0 2 466 18 19 684 467 467 2 80 D 0 2 467 18 19 682 468 468 2 61 D 0 2 468 18 19 996 0 0 1 65 D 0 2 469 20 21 1081 470 470 1 71 D 0 2 470 20 21 690 0 0 2 78 0 A 29.22 90.41 132.37 41.48 238.89 2 682 22 467 0 683 683 1 73 0 31.18 77.43 130.26 42.50 185.73 2 683 22 467 0 0 0 2 62 0 A 28.87 89.31 149.33 48.63 209.45 2 684 23 466 1127 685 685 2 77 0 A 30.70 89.26 145.51 46.48 291.61 2 685 23 466 1253 686 686 1 74 D 0 2 686 23 466 1130 687 687 2 72 0 31.84 83.46 117.76 48.03 211.35 2 687 23 466 1251 688 688 1 69 0 A 33.33 99.67 139.51 50.61 248.45 2 688 23 466 1134 689 689 2 60 0 33.63 82.53 122.53 46.77 255.88 2 689 23 466 1248 0 0 1 59 1 28.36 86.37 144.08 48.19 252.71 2 690 28 470 1248 691 691 2 55 0 30.00 75.26 141.90 43.66 264.66 2 691 28 470 1350 0 0 1 54 0 18.52 61.80 107.31 31.26 260.23 2 993 465 24 0 994 994 2 71 0 32.01 83.26 151.95 44.11 284.10 2 994 465 24 0 995 995 1 67 0 37.57 83.05 137.44 41.29 193.96 2 995 465 24 0 0 0 1 64 0 35.69 64.56 131.86 41.28 265.21 2 996 468 25 0 0 0 2 61 0 38.13 73.51 142.28 46.97 124.65 2 1081 469 26 0 1082 1082 1 60 0 38.57 65.59 147.69 40.95 283.70 2 1082 469 26 0 1083 1083 1 57 0 38.73 85.62 142.91 43.14 267.70 2 1083 469 26 0 1084 1084 2 51 0 34.99 65.63 117.91 33.33 271.48 2 1084 469 26 0 0 0 1 48 0 27.15 61.28 114.91 35.81 300.52 2 1127 27 684 1463 1128 1128 1 56 0 31.35 80.49 142.91 45.69 283.40 2 1128 27 684 1421 1129 1129 2 46 0 29.16 72.54 147.65 40.76 302.49 2 1129 27 684 0 0 0 1 28 0 30.12 55.97 131.27 44.75 210.42 2 1130 29 686 1467 1131 1131 1 52 0 38.40 85.66 134.89 48.94 205.96 2 1131 29 686 1425 1132 1132 2 49 0 26.37 73.13 119.43 40.76 185.98 2 1132 29 686 0 1133 1133 1 38 0 29.04 60.34 148.19 43.15 395.05 2 1133 29 686 0 0 0 2 36 0 30.55 68.81 155.26 42.07 430.72 2 1134 32 688 1424 1135 1135 2 40 0 35.36 61.68 146.49 45.49 251.73 2 1135 32 688 0 1136 1136 2 33 0 29.65 85.07 152.08 46.58 264.34 2 1136 32 688 0 1137 1137 2 30 0 37.71 63.44 134.73 44.91 252.99 2 1137 32 688 0 1138 1138 1 27 0 28.44 66.06 127.46 46.16 288.96 2 1138 32 688 0 0 0 2 17 0 26.31 55.34 121.43 43.93 187.07 2 1248 689 690 0 1249 1249 2 33 0 30.95 59.80 129.65 42.72 277.75 2 1249 689 690 0 1250 1250 2 25 0 28.92 69.06 118.39 40.89 323.70 2 1250 689 690 0 0 0 1 22 0 33.16 55.41 144.68 45.27 401.63 2 1251 687 31 1478 1252 1252 1 37 0 34.29 43.42 131.31 41.18 443.51 2 1252 687 31 0 0 0 1 33 0 21.30 46.36 136.91 36.18 337.63 2 1253 685 30 1479 1254 1254 1 47 0 33.04 74.14 141.88 44.43 266.54 2 1254 685 30 0 1255 1255 2 46 0 33.53 79.28 140.18 46.67 214.17 2 1255 685 30 1420 0 0 2 43 0 34.13 50.85 116.58 38.25 220.96 2 1350 691 34 0 1351 1351 1 30 0 31.48 69.97 153.91 44.72 483.61 2 1351 691 34 0 1352 1352 1 29 0 32.29 63.84 129.09 41.71 281.46 2 1352 691 34 0 1353 1353 1 25 0 36.11 61.56 149.89 39.83 296.45 2 1353 691 34 0 0 0 1 19 0 28.32 58.80 154.40 37.19 315.08 2 1420 39 1255 0 0 0 1 17 0 38.41 57.44 154.78 39.03 304.98 2 1421 37 1128 0 1422 1422 2 25 0 29.05 68.13 120.74 41.99 590.06 2 1422 37 1128 0 1423 1423 1 23 0 29.42 69.69 138.25 41.96 637.35 2 1423 37 1128 0 0 0 2 18 0 32.57 49.35 122.68 34.21 383.22 2 1424 41 1134 0 0 0 2 19 0 38.45 70.45 152.79 49.75 295.06 2 1425 36 1131 0 0 0 2 24 0 43.57 79.29 176.62 45.70 245.50 2 1463 1127 35 0 1464 1464 2 32 0 24.06 57.19 112.06 39.08 359.47 2 1464 1127 35 0 1465 1465 2 31 0 31.30 52.90 120.65 38.87 280.83 2 1465 1127 35 0 1466 1466 2 30 0 44.63 75.71 149.68 49.12 335.03 2 1466 1127 35 0 0 0 2 29 0 27.51 61.09 99.74 39.06 315.93 2 1467 1130 33 0 1468 1468 1 34 0 28.51 64.95 137.99 43.05 226.75 2 1468 1130 33 0 0 0 1 27 0 23.02 40.48 126.82 35.79 376.54 2 1478 1251 40 0 0 0 1 16 0 33.69 73.33 163.45 46.61 452.41 2 1479 1253 38 0 0 0 1 16 0 19.62 59.94 139.11 33.43 384.63 3 42 0 0 473 0 0 1 80 D 0 3 43 0 0 473 0 0 2 78 D 0 3 44 0 0 476 0 0 1 74 D 0 3 45 0 0 476 0 0 2 46 D 0 3 46 0 0 479 0 0 1 80 D 0 3 47 0 0 471 0 0 1 73 D 0 3 48 0 0 471 0 0 2 71 D 0 3 49 0 0 479 0 0 2 80 D 0 3 50 0 0 695 0 0 1 65 D 0 3 51 0 0 692 0 0 1 52 D 0 3 52 0 0 694 0 0 1 77 D 0 3 53 0 0 1085 0 0 2 80 D 0 3 54 0 0 696 0 0 1 80 D 0 3 55 0 0 705 0 0 1 80 D 0 3 56 0 0 702 0 0 1 54 D 0 3 57 0 0 1145 0 0 1 74 0 26.21 65.34 145.69 36.11 323.80 3 58 0 0 1357 0 0 2 66 D 0 3 59 0 0 1139 0 0 1 62 D 0 3 60 0 0 1142 0 0 1 71 0 38.22 77.91 127.73 40.74 289.78 3 61 0 0 1362 0 0 2 71 0 17.28 78.91 144.98 32.33 198.46 3 62 0 0 1143 0 0 1 69 D 0 3 63 0 0 1148 0 0 1 67 0 31.46 85.11 145.16 36.20 222.48 3 64 0 0 1359 0 0 2 55 0 26.91 54.39 123.67 38.10 281.79 3 65 0 0 1428 0 0 1 40 D 0 3 66 0 0 1426 0 0 1 45 0 30.75 66.49 129.19 40.98 267.43 3 67 0 0 1482 0 0 2 43 0 18.89 73.22 132.89 41.01 188.42 3 68 0 0 1480 0 0 2 43 0 31.82 56.07 134.97 41.06 197.84 3 69 0 0 1429 0 0 1 41 0 30.52 81.47 134.67 41.33 292.17 3 70 0 0 1484 0 0 2 40 0 31.84 64.93 162.03 46.91 317.47 3 71 0 0 1483 0 0 2 24 D 0 3 471 47 48 997 472 472 1 80 D 0 3 472 47 48 702 0 0 2 72 D 0 3 473 42 43 695 474 474 2 53 D 0 3 474 42 43 694 475 475 2 80 D 0 3 475 42 43 1087 0 0 2 79 D 0 3 476 44 45 692 477 477 2 58 D 0 3 477 44 45 997 478 478 2 76 D 0 3 478 44 45 705 0 0 2 80 D 0 3 479 46 49 1087 480 480 1 40 D 0 3 480 46 49 1085 481 481 1 79 D 0 3 481 46 49 696 0 0 2 80 D 0 3 692 51 476 0 693 693 1 67 0 A 31.29 93.45 126.66 43.71 284.56 3 693 51 476 0 0 0 2 66 0 A 38.05 94.35 137.20 45.85 323.39 3 694 52 474 0 0 0 2 69 0 28.53 82.19 150.30 43.20 282.00 3 695 50 473 0 0 0 1 59 0 31.73 77.26 161.73 39.97 277.60 3 696 54 481 0 697 697 2 68 0 19.10 52.25 129.54 35.88 162.19 3 697 54 481 0 698 698 2 66 0 36.97 68.60 162.76 39.50 204.96 3 698 54 481 0 699 699 2 64 0 32.01 55.46 124.83 33.49 282.96 3 699 54 481 0 700 700 1 63 0 31.00 71.43 125.07 43.01 315.59 3 700 54 481 0 701 701 2 58 0 30.36 62.58 139.85 38.95 230.04 3 701 54 481 0 0 0 2 53 0 29.17 50.98 143.91 34.45 256.68 3 702 56 472 0 703 703 2 53 0 31.05 84.88 135.68 41.71 395.85 3 703 56 472 0 704 704 1 50 0 16.71 57.07 136.90 27.03 203.10 3 704 56 472 0 0 0 1 39 0 25.06 73.71 153.98 45.02 289.80 3 705 55 478 0 706 706 1 57 0 38.84 62.55 131.51 42.46 265.35 3 706 55 478 0 0 0 1 53 0 27.70 66.68 136.87 43.06 179.79 3 997 471 477 1357 998 998 1 70 0 21.74 57.21 131.65 36.40 217.87 3 998 471 477 1354 0 0 1 62 0 28.93 66.75 150.17 38.00 135.04 3 1085 480 53 0 1086 1086 1 74 0 26.34 81.33 137.21 43.99 257.47 3 1086 480 53 0 0 0 1 73 0 23.72 85.35 132.48 46.37 235.16 3 1087 479 475 1145 1088 1088 2 73 D 0 3 1088 479 475 1362 1089 1089 1 51 D 0 3 1089 479 475 1139 1090 1090 2 60 D 0 3 1090 479 475 0 1091 1091 2 70 0 19.46 55.99 126.49 35.20 325.02 3 1091 479 475 1142 1092 1092 2 69 0 36.54 71.79 123.68 38.44 326.32 3 1092 479 475 1143 1093 1093 2 65 0 27.05 71.94 113.38 42.51 232.96 3 1093 479 475 1148 1094 1094 2 61 0 30.99 60.74 108.11 36.50 279.59 3 1094 479 475 1354 1095 1095 2 59 1 24.50 65.05 131.44 41.51 293.75 3 1095 479 475 1359 0 0 1 58 0 36.61 85.35 115.07 38.97 218.37 3 1139 59 1089 1426 1140 1140 2 47 0 33.68 80.85 147.53 42.75 223.72 3 1140 59 1089 1429 1141 1141 2 41 0 30.04 61.15 147.78 38.68 303.57 3 1141 59 1089 0 0 0 2 38 0 28.44 67.34 121.57 40.48 326.36 3 1142 60 1091 0 0 0 1 38 0 28.81 51.03 133.87 38.83 305.74 3 1143 62 1092 0 1144 1144 2 39 0 27.89 64.10 123.76 41.94 188.51 3 1144 62 1092 0 0 0 2 37 0 34.17 70.39 139.12 45.30 270.08 3 1145 57 1087 1428 1146 1146 2 51 0 31.73 60.16 149.99 40.92 260.87 3 1146 57 1087 0 1147 1147 1 48 0 28.34 63.91 126.27 36.11 257.00 3 1147 57 1087 1480 0 0 1 45 0 27.39 70.97 129.85 39.31 226.19 3 1148 63 1093 1482 1149 1149 1 40 0 38.23 84.38 170.00 46.28 210.95 3 1149 63 1093 0 1150 1150 1 37 0 30.35 68.21 157.03 38.25 229.27 3 1150 63 1093 0 0 0 2 32 0 35.27 61.57 143.99 35.43 314.61 3 1354 998 1094 0 1355 1355 2 26 0 36.10 63.73 141.04 39.36 237.19 3 1355 998 1094 0 1356 1356 1 25 0 32.82 52.87 136.90 40.89 354.40 3 1356 998 1094 0 0 0 1 20 0 33.77 68.76 143.28 45.63 272.46 3 1357 997 58 0 1358 1358 2 45 0 33.15 49.34 147.65 38.74 304.79 3 1358 997 58 1484 0 0 1 41 0 26.37 64.95 159.63 41.89 140.62 3 1359 1095 64 0 1360 1360 2 27 0 36.98 57.82 133.30 36.92 317.20 3 1360 1095 64 0 1361 1361 2 26 0 28.56 54.29 145.48 35.95 491.33 3 1361 1095 64 0 0 0 2 25 0 A 43.09 94.10 188.04 50.49 440.59 3 1362 1088 61 1483 0 0 1 38 0 A 36.48 89.43 153.61 46.64 251.35 3 1426 66 1139 0 1427 1427 1 23 0 18.82 54.18 121.71 38.13 492.64 3 1427 66 1139 0 0 0 1 21 0 37.80 73.15 144.25 48.69 555.89 3 1428 65 1145 0 0 0 1 22 0 33.80 56.44 148.42 40.75 371.67 3 1429 69 1140 0 1430 1430 1 21 0 25.00 61.78 134.83 40.84 292.56 3 1430 69 1140 0 0 0 1 18 0 28.55 47.82 127.31 34.67 237.98 3 1480 1147 68 0 1481 1481 2 20 0 33.08 70.24 140.17 43.35 339.65 3 1481 1147 68 0 0 0 2 19 0 24.42 31.65 113.62 31.07 337.78 3 1482 1148 67 0 0 0 2 19 0 36.34 74.38 129.70 42.37 349.47 3 1483 1362 71 0 0 0 1 18 0 34.13 59.42 143.79 40.46 387.27 3 1484 1358 70 0 0 0 1 16 0 33.18 66.59 155.68 51.35 362.32 4 72 0 0 488 0 0 1 65 D 0 4 73 0 0 488 0 0 2 78 D 0 4 74 0 0 490 0 0 1 60 D 0 4 75 0 0 484 0 0 1 74 D 0 4 76 0 0 484 0 0 2 27 D 0 4 77 0 0 490 0 0 2 77 D 0 4 78 0 0 482 0 0 2 64 D 0 4 79 0 0 482 0 0 1 67 D 0 4 80 0 0 709 0 0 1 80 D 0 4 81 0 0 707 0 0 1 60 D 0 4 82 0 0 999 0 0 2 80 D 0 4 83 0 0 712 0 0 1 75 D 0 4 84 0 0 711 0 0 1 80 D 0 4 85 0 0 1105 0 0 2 79 0 21.84 81.71 160.92 41.15 205.66 4 86 0 0 1106 0 0 2 63 D 0 4 87 0 0 1375 0 0 2 72 0 A 34.55 88.72 142.48 46.55 219.18 4 88 0 0 1383 0 0 2 67 D 0 4 89 0 0 1363 0 0 2 70 0 29.01 76.63 143.27 37.91 187.55 4 90 0 0 1372 0 0 2 65 0 A 34.25 90.09 135.18 42.62 149.47 4 91 0 0 1377 0 0 2 63 0 32.78 64.26 136.65 41.63 260.15 4 92 0 0 1385 0 0 2 59 0 26.21 56.91 131.93 39.52 223.70 4 93 0 0 1433 0 0 1 53 0 35.31 86.70 133.91 42.33 132.05 4 94 0 0 1486 0 0 2 48 0 22.91 59.39 130.05 33.80 344.60 4 95 0 0 1487 0 0 2 46 0 23.77 61.04 137.81 35.35 200.93 4 96 0 0 1489 0 0 2 41 0 27.37 61.91 120.31 42.75 299.34 4 97 0 0 1485 0 0 2 41 0 34.98 61.43 131.70 38.04 366.03 4 98 0 0 1431 0 0 1 39 0 29.77 63.43 158.06 42.36 318.52 4 482 79 78 999 483 483 1 80 D 0 4 483 79 78 1096 0 0 2 75 D 0 4 484 75 76 707 485 485 2 80 D 0 4 485 75 76 709 486 486 2 66 D 0 4 486 75 76 1100 487 487 2 80 D 0 4 487 75 76 712 0 0 2 80 D 0 4 488 72 73 1096 489 489 1 55 D 0 4 489 72 73 711 0 0 2 78 D 0 4 490 74 77 1100 491 491 1 76 D 0 4 491 74 77 1106 492 492 1 80 D 0 4 492 74 77 1105 493 493 1 70 D 0 4 493 74 77 0 0 0 1 78 0 31.11 70.45 135.34 36.22 246.97 4 707 81 484 0 708 708 1 70 0 34.75 77.09 151.06 44.31 276.79 4 708 81 484 0 0 0 1 65 0 34.04 79.11 115.41 44.48 193.93 4 709 80 485 0 710 710 2 68 0 38.50 80.03 147.91 44.89 296.85 4 710 80 485 0 0 0 2 66 0 A 29.08 107.90 172.97 45.65 275.38 4 711 84 489 0 0 0 1 64 0 25.67 75.37 139.64 39.47 291.03 4 712 83 487 0 0 0 1 64 0 36.27 85.36 145.73 42.09 260.13 4 999 482 82 0 0 0 2 71 0 25.62 72.24 119.36 32.86 188.83 4 1096 488 483 1383 1097 1097 1 68 D 0 4 1097 488 483 1385 1098 1098 1 32 D 0 4 1098 488 483 1377 1099 1099 1 41 D 0 4 1099 488 483 1367 0 0 2 59 1 A 42.90 98.62 144.28 47.80 229.05 4 1100 490 486 1375 1101 1101 1 37 D 0 4 1101 490 486 1363 1102 1102 1 70 0 27.63 65.77 140.67 39.76 379.45 4 1102 490 486 1372 1103 1103 1 41 D 0 4 1103 490 486 1367 1104 1104 1 49 D 0 4 1104 490 486 0 0 0 2 46 0 26.39 79.22 142.82 41.51 247.10 4 1105 492 85 0 0 0 1 41 0 19.11 48.35 138.10 35.39 285.19 4 1106 491 86 0 0 0 2 55 0 29.66 70.53 117.79 36.57 225.56 4 1363 1101 89 1433 1364 1364 2 50 0 23.30 45.39 120.06 32.67 187.04 4 1364 1101 89 0 1365 1365 1 47 0 38.25 77.04 169.55 44.09 304.22 4 1365 1101 89 1485 1366 1366 1 38 0 31.58 68.17 150.35 43.83 317.16 4 1366 1101 89 0 0 0 1 32 0 33.44 72.06 172.27 42.57 434.24 4 1367 1103 1099 0 1368 1368 2 36 0 32.94 74.83 156.03 46.59 271.93 4 1368 1103 1099 0 1369 1369 2 35 0 41.84 57.91 155.28 41.63 191.03 4 1369 1103 1099 0 1370 1370 2 32 0 A 35.92 88.20 140.07 48.12 267.51 4 1370 1103 1099 0 1371 1371 1 20 0 21.18 46.32 110.56 36.01 310.46 4 1371 1103 1099 0 0 0 1 16 0 41.48 79.62 155.82 50.31 305.91 4 1372 1102 90 0 1373 1373 1 37 0 29.31 81.47 157.50 45.36 264.40 4 1373 1102 90 0 1374 1374 1 34 0 31.92 80.03 146.64 49.53 385.93 4 1374 1102 90 0 0 0 2 28 0 35.26 65.95 135.75 41.35 440.81 4 1375 1100 87 1486 1376 1376 1 22 D 0 4 1376 1100 87 1431 0 0 2 43 0 43.04 79.81 151.83 46.82 417.86 4 1377 1098 91 0 1378 1378 1 40 0 25.43 68.74 151.33 42.00 346.06 4 1378 1098 91 0 1379 1379 2 39 0 34.64 79.78 140.98 43.49 331.65 4 1379 1098 91 0 1380 1380 1 36 0 29.74 75.00 165.04 43.86 459.36 4 1380 1098 91 0 1381 1381 1 31 0 35.76 57.47 127.82 37.14 453.04 4 1381 1098 91 0 1382 1382 1 29 0 36.50 64.29 144.22 41.72 488.37 4 1382 1098 91 0 0 0 1 24 0 25.73 61.64 138.43 39.07 534.47 4 1383 1096 88 1487 1384 1384 1 47 0 22.57 70.78 139.25 36.34 182.76 4 1384 1096 88 1489 0 0 1 44 0 26.81 56.81 132.36 37.19 291.18 4 1385 1097 92 0 0 0 2 37 0 25.34 50.95 119.76 34.43 274.86 4 1431 98 1376 0 1432 1432 2 20 0 39.19 51.32 131.52 40.17 625.18 4 1432 98 1376 0 0 0 1 17 0 27.67 51.97 135.05 37.44 679.50 4 1433 93 1363 0 1434 1434 1 26 0 34.61 52.05 112.23 36.59 308.43 4 1434 93 1363 0 0 0 2 16 0 34.11 62.69 139.83 41.98 318.07 4 1485 1365 97 0 0 0 2 20 0 31.93 68.92 160.42 48.93 462.13 4 1486 1375 94 0 0 0 1 25 0 28.31 58.02 137.02 33.16 438.88 4 1487 1383 95 0 1488 1488 2 23 0 24.20 57.70 141.45 36.41 269.93 4 1488 1383 95 0 0 0 2 16 0 34.29 66.33 143.65 40.90 273.39 4 1489 1384 96 0 1490 1490 2 19 0 38.99 62.79 128.64 43.31 362.81 4 1490 1384 96 0 0 0 2 18 0 29.20 56.96 121.91 41.04 318.56 5 99 0 0 499 0 0 1 80 D 0 5 100 0 0 499 0 0 2 75 D 0 5 101 0 0 501 0 0 1 80 D 0 5 102 0 0 501 0 0 2 80 D 0 5 103 0 0 494 0 0 2 80 D 0 5 104 0 0 494 0 0 1 70 D 0 5 105 0 0 722 0 0 1 73 D 0 5 106 0 0 716 0 0 1 78 D 0 5 107 0 0 713 0 0 1 60 D 0 5 108 0 0 714 0 0 1 75 D 0 5 109 0 0 717 0 0 1 61 D 0 5 110 0 0 721 0 0 1 68 D 0 5 111 0 0 1007 0 0 2 80 D 0 5 112 0 0 718 0 0 1 80 D 0 5 113 0 0 1003 0 0 2 78 D 0 5 114 0 0 1151 0 0 1 41 D 0 5 115 0 0 1152 0 0 1 70 0 26.44 74.85 132.20 40.65 244.66 5 116 0 0 1386 0 0 2 56 0 28.73 74.20 129.36 35.93 244.64 5 117 0 0 1491 0 0 2 38 0 28.57 44.85 125.65 32.37 266.26 5 118 0 0 1492 0 0 2 36 0 32.70 69.35 149.50 45.98 238.30 5 494 104 103 713 495 495 2 80 D 0 5 495 104 103 717 496 496 2 65 D 0 5 496 104 103 714 497 497 2 58 D 0 5 497 104 103 1000 498 498 1 77 D 0 5 498 104 103 721 0 0 2 48 D 0 5 499 99 100 722 500 500 2 78 D 0 5 500 99 100 1000 0 0 2 75 D 0 5 501 101 102 1007 502 502 1 75 D 0 5 502 101 102 716 503 503 2 80 D 0 5 503 101 102 718 504 504 2 63 D 0 5 504 101 102 1003 0 0 1 60 D 0 5 713 107 494 0 0 0 1 73 0 32.92 85.72 131.09 38.96 110.21 5 714 108 496 0 715 715 1 75 0 28.70 78.87 117.58 38.33 205.39 5 715 108 496 0 0 0 2 62 0 31.17 68.32 148.69 39.73 208.91 5 716 106 502 0 0 0 1 50 0 31.73 64.91 120.55 41.33 276.05 5 717 109 495 0 0 0 2 73 0 24.46 56.17 105.48 33.01 173.78 5 718 112 503 0 719 719 2 68 0 23.29 78.77 134.25 40.54 344.18 5 719 112 503 0 720 720 1 65 0 21.54 67.38 138.85 36.50 244.47 5 720 112 503 0 0 0 2 63 0 27.45 70.97 127.74 42.66 133.45 5 721 110 498 0 0 0 2 69 0 34.73 68.12 133.65 34.93 109.33 5 722 105 499 0 0 0 2 78 0 34.24 74.25 140.40 42.85 304.74 5 1000 497 500 1151 1001 1001 2 73 D 0 5 1001 497 500 1152 1002 1002 2 70 0 36.18 79.25 112.13 42.44 198.59 5 1002 497 500 1390 0 0 1 61 0 34.58 78.77 130.76 45.77 204.95 5 1003 504 113 0 1004 1004 2 62 0 34.74 66.97 118.04 41.50 224.37 5 1004 504 113 1390 1005 1005 2 59 1 27.71 49.91 130.96 31.27 283.34 5 1005 504 113 1386 1006 1006 1 55 0 34.52 55.20 130.34 39.08 265.88 5 1006 504 113 0 0 0 2 53 0 33.42 72.58 123.14 39.08 339.09 5 1007 501 111 0 1008 1008 1 66 0 37.43 70.68 115.04 43.58 190.69 5 1008 501 111 0 0 0 1 63 0 30.74 56.84 111.79 35.24 260.36 5 1151 114 1000 0 0 0 1 36 0 32.49 60.30 134.79 41.91 335.67 5 1152 115 1001 0 0 0 2 34 0 35.23 72.64 120.75 40.20 390.27 5 1386 1005 116 0 1387 1387 2 36 0 30.34 49.82 128.31 40.23 227.81 5 1387 1005 116 0 1388 1388 2 34 0 30.11 47.20 140.25 31.00 292.61 5 1388 1005 116 0 1389 1389 2 33 0 32.25 56.90 126.59 37.93 327.03 5 1389 1005 116 0 0 0 1 24 0 27.03 35.76 132.09 30.36 374.00 5 1390 1002 1004 1491 1391 1391 1 40 0 31.19 64.58 131.05 37.12 278.05 5 1391 1002 1004 1492 1392 1392 1 28 D 0 5 1392 1002 1004 0 1393 1393 1 34 0 17.77 58.20 125.76 36.28 317.74 5 1393 1002 1004 0 0 0 2 33 0 31.25 57.46 106.82 37.60 322.05 5 1491 1390 117 0 0 0 1 16 0 23.15 43.26 111.86 31.90 320.68 5 1492 1391 118 0 1493 1493 2 18 0 33.03 55.54 119.57 40.98 309.92 5 1493 1391 118 0 0 0 1 16 0 26.06 57.06 135.47 39.59 380.85 6 119 0 0 510 0 0 2 80 D 0 6 120 0 0 510 0 0 1 76 D 0 6 121 0 0 724 0 0 1 69 D 0 6 122 0 0 505 0 0 1 46 D 0 6 123 0 0 505 0 0 2 35 D 0 6 124 0 0 507 0 0 1 80 D 0 6 125 0 0 507 0 0 2 44 D 0 6 126 0 0 723 0 0 1 62 D 0 6 127 0 0 1012 0 0 2 66 D 0 6 128 0 0 1010 0 0 2 80 D 0 6 129 0 0 725 0 0 1 73 0 A 34.15 91.19 146.61 47.88 246.40 6 130 0 0 1155 0 0 1 65 0 A 38.36 110.05 153.28 51.06 213.43 6 131 0 0 1398 0 0 2 63 D 0 6 132 0 0 1153 0 0 1 51 0 29.54 74.44 141.32 43.54 307.91 6 133 0 0 1435 0 0 1 45 0 30.16 73.38 115.95 41.44 256.77 6 134 0 0 1154 0 0 1 41 0 27.54 51.12 129.94 33.95 185.53 6 505 122 123 723 506 506 2 80 D 0 6 506 122 123 1009 0 0 2 80 D 0 6 507 124 125 1009 508 508 1 79 D 0 6 508 124 125 1010 509 509 1 73 D 0 6 509 124 125 725 0 0 2 48 D 0 6 510 120 119 724 511 511 2 63 D 0 6 511 120 119 1012 0 0 1 76 D 0 6 723 126 505 0 0 0 2 55 0 37.53 69.61 128.17 43.35 218.01 6 724 121 510 0 0 0 1 70 0 25.57 81.07 150.91 43.16 95.75 6 725 129 509 0 726 726 1 47 0 A 36.04 95.17 151.16 48.37 231.26 6 726 129 509 0 727 727 2 42 0 33.51 70.28 134.43 43.81 318.22 6 727 129 509 0 728 728 1 41 0 24.67 65.89 118.62 36.66 318.89 6 728 129 509 0 729 729 1 39 0 32.84 87.04 154.35 51.98 218.35 6 729 129 509 0 730 730 1 37 0 40.74 82.57 166.15 54.44 229.00 6 730 129 509 0 0 0 2 32 0 22.97 61.65 133.14 42.21 501.17 6 1009 507 506 1394 0 0 2 57 0 A 26.05 100.05 172.63 36.12 203.09 6 1010 508 128 0 1011 1011 1 41 0 30.97 53.54 133.23 39.81 353.80 6 1011 508 128 0 0 0 2 38 0 32.02 79.58 165.73 44.53 274.59 6 1012 511 127 1155 1013 1013 2 64 0 33.41 76.29 139.40 41.59 184.00 6 1013 511 127 1398 1014 1014 1 61 0 31.54 73.10 162.02 38.53 171.22 6 1014 511 127 1394 1015 1015 1 58 1 37.89 73.93 161.58 42.06 271.05 6 1015 511 127 1153 1016 1016 2 48 0 16.39 46.05 128.22 29.28 296.28 6 1016 511 127 1154 0 0 2 43 0 32.58 70.42 147.80 42.04 231.13 6 1153 132 1015 0 0 0 2 25 0 29.74 74.13 141.26 45.04 297.36 6 1154 134 1016 0 0 0 2 16 0 30.56 55.47 117.44 38.59 232.88 6 1155 130 1012 1435 1156 1156 2 43 0 30.61 70.71 134.82 43.83 242.19 6 1156 130 1012 0 1157 1157 2 38 0 23.72 69.14 156.71 37.42 330.68 6 1157 130 1012 0 0 0 2 29 0 38.25 76.17 145.70 44.81 281.99 6 1394 1014 1009 0 1395 1395 1 37 0 28.70 68.21 148.58 40.88 289.19 6 1395 1014 1009 0 1396 1396 1 34 0 29.17 79.92 184.04 35.17 254.48 6 1396 1014 1009 0 1397 1397 2 32 0 34.75 72.67 149.45 46.10 287.12 6 1397 1014 1009 0 0 0 1 31 0 27.96 66.87 136.20 39.02 269.35 6 1398 1013 131 0 1399 1399 1 32 0 23.42 50.64 126.90 35.82 215.20 6 1399 1013 131 0 0 0 1 26 0 31.05 52.70 140.10 40.45 328.15 6 1435 133 1155 0 1436 1436 1 24 0 26.21 42.17 118.03 34.86 360.96 6 1436 133 1155 0 0 0 2 16 0 41.11 75.17 137.02 50.04 449.75 7 135 0 0 520 0 0 1 69 D 0 7 136 0 0 520 0 0 2 61 D 0 7 137 0 0 514 0 0 1 80 D 0 7 138 0 0 518 0 0 1 59 D 0 7 139 0 0 514 0 0 2 80 D 0 7 140 0 0 518 0 0 2 70 D 0 7 141 0 0 512 0 0 1 37 D 0 7 142 0 0 1110 0 0 2 70 D 0 7 143 0 0 512 0 0 2 42 D 0 7 144 0 0 733 0 0 1 77 D 0 7 145 0 0 732 0 0 1 75 D 0 7 146 0 0 731 0 0 1 73 D 0 7 147 0 0 1025 0 0 2 71 D 0 7 148 0 0 1022 0 0 2 72 D 0 7 149 0 0 1158 0 0 1 61 0 27.57 75.51 109.54 40.89 243.31 7 150 0 0 1404 0 0 2 60 0 28.12 59.12 122.47 35.03 204.00 7 151 0 0 1412 0 0 2 57 0 23.53 72.41 131.51 36.25 271.06 7 152 0 0 1407 0 0 2 56 0 29.14 74.15 148.20 40.77 182.61 7 153 0 0 1161 0 0 1 45 D 0 7 154 0 0 1437 0 0 1 43 0 24.74 58.49 121.45 40.54 186.99 7 155 0 0 1439 0 0 1 38 0 34.87 62.37 117.58 40.58 312.08 7 512 141 143 1017 513 513 1 70 D 0 7 513 141 143 1022 0 0 1 80 D 0 7 514 137 139 733 515 515 2 59 D 0 7 515 137 139 1107 516 516 2 80 D 0 7 516 137 139 731 517 517 2 80 D 0 7 517 137 139 1025 0 0 1 77 D 0 7 518 138 140 732 519 519 2 80 D 0 7 519 138 140 1017 0 0 2 80 D 0 7 520 135 136 1110 521 521 1 71 D 0 7 521 135 136 1107 0 0 1 71 D 0 7 731 146 516 0 0 0 2 50 0 32.09 63.12 128.61 41.64 238.88 7 732 145 518 0 0 0 2 56 0 25.40 85.46 192.46 37.02 192.73 7 733 144 514 0 734 734 2 75 0 32.35 70.71 146.45 41.74 100.96 7 734 144 514 0 735 735 2 67 0 28.75 73.91 136.60 39.17 313.32 7 735 144 514 0 736 736 1 55 0 30.95 68.44 136.74 39.61 272.29 7 736 144 514 0 0 0 1 52 0 29.66 65.31 121.36 40.73 203.70 7 1017 512 519 1158 1018 1018 2 65 0 A 30.64 103.67 152.80 36.82 331.41 7 1018 512 519 1404 1019 1019 1 61 0 32.10 70.72 135.48 44.30 241.88 7 1019 512 519 1400 1020 1020 1 58 1 29.51 82.81 179.66 46.17 219.15 7 1020 512 519 1161 1021 1021 2 50 0 31.62 78.98 158.93 44.94 301.70 7 1021 512 519 0 0 0 2 46 0 28.96 72.96 169.07 38.17 243.38 7 1022 513 148 0 1023 1023 1 58 0 26.00 70.09 123.84 39.92 225.01 7 1023 513 148 0 1024 1024 2 57 0 23.46 59.77 121.52 33.63 216.85 7 1024 513 148 0 0 0 1 53 0 A 35.67 89.65 140.58 50.50 254.74 7 1025 517 147 0 1026 1026 1 65 0 31.09 65.00 145.05 44.05 299.36 7 1026 517 147 0 1027 1027 2 61 0 31.87 80.41 119.75 40.21 158.55 7 1027 517 147 0 1028 1028 2 58 0 25.33 54.46 121.57 34.74 209.71 7 1028 517 147 0 0 0 2 47 0 41.65 87.02 130.93 47.14 141.75 7 1107 521 515 1412 1108 1108 1 60 0 30.22 83.48 154.76 38.98 289.48 7 1108 521 515 1400 1109 1109 2 58 D 0 7 1109 521 515 1407 0 0 1 57 0 32.49 55.71 132.57 35.55 243.84 7 1110 520 142 0 0 0 2 75 0 28.08 81.28 153.63 37.75 253.05 7 1158 149 1017 0 1159 1159 1 40 0 28.77 74.69 140.28 44.69 356.85 7 1159 149 1017 0 1160 1160 2 36 0 20.01 61.53 115.06 36.86 282.66 7 1160 149 1017 0 0 0 2 25 0 34.17 74.44 124.54 41.29 501.62 7 1161 153 1020 0 0 0 1 29 0 28.42 63.48 136.80 39.44 323.08 7 1400 1019 1108 0 1401 1401 1 37 0 27.44 50.45 151.45 35.39 272.36 7 1401 1019 1108 0 1402 1402 1 34 0 29.41 63.64 149.74 37.42 331.68 7 1402 1019 1108 0 1403 1403 1 32 0 31.58 65.48 165.14 39.98 412.73 7 1403 1019 1108 0 0 0 1 24 0 34.91 55.05 158.23 41.79 352.54 7 1404 1018 150 1437 1405 1405 2 43 0 30.64 57.37 134.65 41.12 194.59 7 1405 1018 150 0 1406 1406 1 36 0 24.68 50.05 104.79 31.92 374.37 7 1406 1018 150 0 0 0 1 34 0 40.72 52.36 147.76 46.67 260.89 7 1407 1109 152 1439 1408 1408 2 35 0 44.01 61.79 141.46 39.62 328.96 7 1408 1109 152 0 1409 1409 2 33 0 29.91 51.09 136.71 35.03 297.62 7 1409 1109 152 0 1410 1410 2 28 0 26.68 33.68 137.21 32.50 328.98 7 1410 1109 152 0 1411 1411 1 24 0 35.72 52.59 160.20 41.13 279.86 7 1411 1109 152 0 0 0 1 18 0 24.40 38.69 134.24 34.19 386.04 7 1412 1107 151 0 1413 1413 1 34 0 37.29 82.33 180.12 41.11 330.71 7 1413 1107 151 0 0 0 2 26 0 35.32 74.80 151.13 44.86 291.46 7 1437 154 1404 0 1438 1438 2 23 0 25.26 57.02 135.35 35.39 304.78 7 1438 154 1404 0 0 0 1 18 0 38.93 77.68 161.03 50.89 351.08 7 1439 155 1407 0 0 0 2 18 0 36.98 61.69 154.35 43.91 244.90 8 156 0 0 524 0 0 1 54 D 0 8 157 0 0 524 0 0 2 80 D 0 8 158 0 0 522 0 0 1 74 D 0 8 159 0 0 528 0 0 2 80 D 0 8 160 0 0 528 0 0 1 78 D 0 8 161 0 0 522 0 0 2 61 D 0 8 162 0 0 1033 0 0 2 80 D 0 8 163 0 0 1032 0 0 2 56 D 0 8 164 0 0 737 0 0 1 80 D 0 8 165 0 0 1030 0 0 2 74 D 0 8 166 0 0 741 0 0 1 57 D 0 8 167 0 0 1029 0 0 2 76 D 0 8 168 0 0 1164 0 0 1 44 D 0 8 169 0 0 1165 0 0 1 58 D 0 8 170 0 0 1117 0 0 2 59 0 37.23 71.77 134.77 40.01 218.83 8 171 0 0 1414 0 0 2 53 0 34.64 73.18 139.81 37.67 237.97 8 172 0 0 1170 0 0 1 49 0 34.02 74.44 150.63 46.37 277.27 8 173 0 0 1256 0 0 2 47 0 27.98 72.40 132.79 42.06 317.40 8 174 0 0 1162 0 0 1 46 0 26.63 57.03 144.61 35.94 238.55 8 175 0 0 1494 0 0 2 46 0 31.32 53.29 137.45 32.34 290.38 8 176 0 0 1169 0 0 1 45 0 27.28 53.03 134.54 33.07 272.70 8 522 158 161 1029 523 523 1 67 D 0 8 523 158 161 1111 0 0 2 66 D 0 8 524 156 157 1033 525 525 1 75 D 0 8 525 156 157 1032 526 526 1 46 D 0 8 526 156 157 737 527 527 2 74 D 0 8 527 156 157 1030 0 0 1 42 D 0 8 528 160 159 741 529 529 2 27 D 0 8 529 160 159 1111 530 530 1 67 D 0 8 530 160 159 1117 0 0 1 60 D 0 8 737 164 526 1164 738 738 2 55 D 0 8 738 164 526 1165 739 739 2 52 D 0 8 739 164 526 1257 740 740 1 57 1 29.21 64.13 143.65 38.38 208.03 8 740 164 526 1256 0 0 1 49 0 31.28 77.23 131.97 42.23 281.83 8 741 166 528 0 742 742 2 53 0 36.89 85.32 152.27 45.35 339.04 8 742 166 528 0 0 0 2 52 0 36.02 70.76 140.23 40.51 242.75 8 1029 522 167 0 0 0 1 56 0 27.28 57.32 146.56 38.62 175.70 8 1030 527 165 0 1031 1031 1 58 0 32.44 79.02 148.60 38.81 243.65 8 1031 527 165 0 0 0 2 48 0 27.15 66.46 130.62 36.99 182.59 8 1032 525 163 0 0 0 1 55 0 41.97 86.13 152.35 44.67 198.59 8 1033 524 162 0 1034 1034 1 73 0 29.46 73.72 119.99 35.13 131.45 8 1034 524 162 0 1035 1035 2 62 0 30.31 53.28 119.03 31.83 268.04 8 1035 524 162 0 0 0 2 61 0 27.72 55.22 139.27 35.29 179.74 8 1111 529 523 1257 1112 1112 2 54 0 38.54 81.68 145.16 50.03 211.81 8 1112 529 523 1414 1113 1113 1 53 0 37.59 65.89 113.84 43.08 171.56 8 1113 529 523 1170 1114 1114 2 51 0 37.74 71.61 148.53 44.12 167.86 8 1114 529 523 1162 1115 1115 2 50 0 27.30 80.17 152.04 48.52 203.49 8 1115 529 523 1169 1116 1116 2 44 0 23.90 62.02 126.20 38.39 314.01 8 1116 529 523 0 0 0 2 34 0 33.35 71.34 152.81 49.85 279.51 8 1117 530 170 0 0 0 2 23 0 30.07 39.23 141.66 33.84 326.17 8 1162 174 1114 0 1163 1163 1 22 0 24.92 53.99 115.85 37.95 474.32 8 1163 174 1114 0 0 0 2 21 0 29.80 62.53 111.07 40.36 331.60 8 1164 168 737 1494 0 0 1 46 0 A 32.74 87.85 145.76 44.83 277.68 8 1165 169 738 0 1166 1166 1 39 0 43.38 81.59 166.94 54.03 267.31 8 1166 169 738 0 1167 1167 2 35 0 27.11 66.11 161.98 42.01 238.23 8 1167 169 738 0 1168 1168 2 30 0 33.82 64.32 147.40 48.74 220.91 8 1168 169 738 0 0 0 2 28 0 37.61 52.89 135.49 43.76 269.34 8 1169 176 1115 0 0 0 2 19 0 32.83 50.94 166.41 42.18 375.68 8 1170 172 1113 0 0 0 1 25 0 36.20 68.04 148.65 44.12 293.66 8 1256 740 173 0 0 0 1 18 0 36.94 61.93 148.75 48.77 480.75 8 1257 739 1111 0 1258 1258 1 37 0 33.66 60.93 160.45 42.37 227.17 8 1258 739 1111 0 1259 1259 2 22 0 37.44 66.29 131.84 48.31 356.53 8 1259 739 1111 0 0 0 2 18 0 30.87 52.10 128.35 43.12 365.37 8 1414 1112 171 0 1415 1415 1 31 0 36.07 77.27 128.23 45.55 240.53 8 1415 1112 171 0 0 0 1 29 0 35.73 75.32 134.74 42.76 216.27 8 1494 1164 175 0 1495 1495 2 23 0 29.72 45.08 144.58 38.92 329.32 8 1495 1164 175 0 1496 1496 2 17 0 21.76 32.18 139.41 33.76 168.49 8 1496 1164 175 0 0 0 1 16 0 34.25 67.46 149.70 42.88 326.36 9 177 0 0 535 0 0 2 78 D 0 9 178 0 0 535 0 0 1 71 D 0 9 179 0 0 531 0 0 1 49 D 0 9 180 0 0 531 0 0 2 80 D 0 9 181 0 0 1046 0 0 2 80 D 0 9 182 0 0 1036 0 0 2 67 D 0 9 183 0 0 533 0 0 1 78 D 0 9 184 0 0 533 0 0 2 71 D 0 9 185 0 0 1043 0 0 2 65 D 0 9 186 0 0 1171 0 0 1 67 0 30.95 66.73 138.80 39.85 78.66 9 187 0 0 1416 0 0 2 64 0 28.45 70.95 102.02 37.52 242.42 9 188 0 0 1041 0 0 2 62 0 A 37.91 93.40 152.50 47.54 277.80 9 189 0 0 1440 0 0 1 41 0 27.59 49.81 118.53 34.00 262.48 9 190 0 0 1497 0 0 2 37 0 27.53 51.35 123.57 33.04 309.60 9 531 179 180 1036 532 532 1 66 D 0 9 532 179 180 1037 0 0 1 56 D 0 9 533 183 184 1222 534 534 1 60 0 26.47 70.65 136.15 37.51 198.09 9 534 183 184 1041 0 0 1 59 0 37.02 67.10 122.75 43.99 174.39 9 535 178 177 1046 536 536 1 80 D 0 9 536 178 177 1037 537 537 2 68 D 0 9 537 178 177 1043 0 0 1 57 D 0 9 1036 531 182 0 0 0 2 62 0 36.29 72.61 109.63 36.61 221.80 9 1037 532 536 1416 1038 1038 1 66 0 31.61 65.09 113.82 37.84 152.10 9 1038 532 536 1171 1039 1039 2 61 0 33.42 69.68 116.59 41.49 180.65 9 1039 532 536 1222 1040 1040 2 57 1 23.97 50.22 112.23 28.48 270.81 9 1040 532 536 0 0 0 2 50 0 25.83 53.09 127.36 37.32 275.98 9 1041 534 188 0 1042 1042 1 37 0 25.52 67.98 122.11 40.95 265.78 9 1042 534 188 0 0 0 1 29 0 31.38 85.40 161.14 50.38 399.60 9 1043 537 185 0 1044 1044 1 63 0 32.52 56.27 135.32 34.25 214.67 9 1044 537 185 0 1045 1045 2 53 0 34.51 44.21 103.69 32.61 256.81 9 1045 537 185 0 0 0 1 44 0 23.82 66.00 120.88 33.15 265.62 9 1046 535 181 0 0 0 1 59 0 24.59 66.26 131.42 40.75 249.36 9 1171 186 1038 1497 0 0 1 38 0 35.17 56.05 133.81 41.45 236.35 9 1222 533 1039 1440 1223 1223 2 37 0 37.93 63.81 144.85 40.91 268.08 9 1223 533 1039 0 1224 1224 1 34 0 38.54 59.37 125.84 39.04 412.80 9 1224 533 1039 0 1225 1225 1 28 0 29.03 49.71 122.09 33.22 339.43 9 1225 533 1039 0 0 0 2 21 0 29.16 39.55 122.32 31.56 260.06 9 1416 1037 187 0 1417 1417 2 38 0 27.63 48.54 109.19 25.30 257.55 9 1417 1037 187 0 0 0 1 24 0 27.66 56.36 127.48 37.73 288.70 9 1440 189 1222 0 0 0 1 22 0 27.17 39.36 102.38 31.33 380.37 9 1497 1171 190 0 0 0 2 16 0 36.17 32.02 98.72 35.84 468.85 10 191 0 0 541 0 0 1 54 D 0 10 192 0 0 541 0 0 2 68 D 0 10 193 0 0 543 0 0 1 66 D 0 10 194 0 0 543 0 0 2 61 D 0 10 195 0 0 538 0 0 1 76 D 0 10 196 0 0 538 0 0 2 75 D 0 10 197 0 0 743 0 0 1 71 D 0 10 198 0 0 852 0 0 2 76 D 0 10 199 0 0 744 0 0 1 73 D 0 10 200 0 0 846 0 0 2 40 D 0 10 201 0 0 853 0 0 2 69 D 0 10 202 0 0 747 0 0 1 77 0 A 38.96 87.67 143.78 46.79 151.38 10 203 0 0 1172 0 0 1 66 0 36.54 78.81 148.06 44.25 241.40 10 204 0 0 1174 0 0 1 66 0 35.54 76.99 107.13 45.42 255.50 10 205 0 0 844 0 0 2 61 0 23.61 62.12 135.03 32.95 313.17 10 206 0 0 1260 0 0 2 57 0 36.67 83.98 142.86 50.38 137.90 10 207 0 0 1261 0 0 2 46 D 0 10 208 0 0 1175 0 0 1 51 0 A 39.03 88.54 184.30 40.63 303.02 10 209 0 0 1441 0 0 1 40 0 24.53 62.82 122.39 36.77 187.12 10 538 195 196 855 539 539 2 80 D 0 10 539 195 196 747 540 540 2 73 0 34.66 61.43 114.97 37.66 309.56 10 540 195 196 844 0 0 1 36 D 0 10 541 191 192 852 542 542 1 53 D 0 10 542 191 192 846 0 0 1 63 D 0 10 543 193 194 743 544 544 2 31 D 0 10 544 193 194 744 545 545 2 44 D 0 10 545 193 194 855 546 546 1 61 D 0 10 546 193 194 853 0 0 1 61 D 0 10 743 197 543 0 0 0 2 68 0 22.38 86.88 136.21 43.26 250.21 10 744 199 544 0 745 745 2 68 0 28.89 76.69 120.98 40.33 196.11 10 745 199 544 0 746 746 2 67 0 25.48 51.36 138.34 38.29 193.63 10 746 199 544 0 0 0 2 57 0 33.75 83.37 120.88 46.44 212.06 10 747 202 539 0 0 0 1 45 0 24.55 64.42 123.53 36.54 275.79 10 844 540 205 0 845 845 1 36 0 27.61 43.95 104.39 36.79 429.60 10 845 540 205 0 0 0 2 29 0 25.45 39.13 102.86 31.65 332.79 10 846 542 200 1172 847 847 2 60 D 0 10 847 542 200 1174 848 848 2 64 0 26.64 79.36 128.95 39.40 189.61 10 848 542 200 1260 849 849 1 59 0 32.67 73.00 165.43 44.51 320.10 10 849 542 200 1264 850 850 2 57 1 36.50 78.62 172.97 42.64 181.08 10 850 542 200 1261 851 851 1 56 0 30.68 71.21 149.16 41.63 258.74 10 851 542 200 1175 0 0 2 28 D 0 10 852 541 198 0 0 0 2 72 0 A 41.14 98.53 144.85 52.10 56.41 10 853 546 201 0 854 854 2 52 0 33.26 75.47 140.51 43.96 185.58 10 854 546 201 0 0 0 1 48 0 21.60 42.56 120.83 34.61 286.31 10 855 545 538 1264 0 0 1 57 0 22.13 61.81 132.44 38.88 236.42 10 1172 203 846 0 1173 1173 1 26 0 34.02 64.11 131.74 41.07 282.69 10 1173 203 846 0 0 0 1 24 0 26.73 51.61 127.68 35.57 226.94 10 1174 204 847 0 0 0 1 31 0 27.53 44.65 134.09 34.51 317.46 10 1175 208 851 0 1176 1176 2 32 0 35.34 52.66 145.49 43.28 366.34 10 1176 208 851 0 0 0 2 25 0 36.69 67.42 147.22 42.24 394.38 10 1260 848 206 0 0 0 2 24 0 39.74 76.28 125.26 47.78 312.43 10 1261 850 207 0 1262 1262 1 34 0 35.99 79.96 145.54 46.68 354.30 10 1262 850 207 0 1263 1263 1 26 0 30.62 75.48 132.74 45.04 366.64 10 1263 850 207 0 0 0 2 18 0 38.80 62.82 140.41 44.69 347.87 10 1264 855 849 1441 1265 1265 2 28 D 0 10 1265 855 849 0 1266 1266 1 32 0 41.18 87.10 139.99 46.54 158.70 10 1266 855 849 0 1267 1267 1 28 0 29.86 66.90 198.04 36.31 481.68 10 1267 855 849 0 1268 1268 1 27 0 37.19 73.57 157.67 44.47 470.65 10 1268 855 849 0 0 0 1 18 0 20.03 64.99 185.36 28.82 304.36 10 1441 209 1264 0 0 0 2 18 0 26.85 69.99 139.33 41.20 322.71 11 210 0 0 547 0 0 1 75 D 0 11 211 0 0 547 0 0 2 62 D 0 11 212 0 0 556 0 0 2 74 D 0 11 213 0 0 556 0 0 1 73 D 0 11 214 0 0 554 0 0 1 80 D 0 11 215 0 0 554 0 0 2 53 D 0 11 216 0 0 550 0 0 1 75 D 0 11 217 0 0 550 0 0 2 80 D 0 11 218 0 0 859 0 0 2 68 D 0 11 219 0 0 748 0 0 1 51 D 0 11 220 0 0 749 0 0 1 69 D 0 11 221 0 0 756 0 0 1 46 D 0 11 222 0 0 874 0 0 2 72 D 0 11 223 0 0 864 0 0 2 52 D 0 11 224 0 0 754 0 0 1 70 0 A 40.31 99.25 135.57 50.63 168.73 11 225 0 0 861 0 0 2 51 D 0 11 226 0 0 1178 0 0 1 55 0 29.31 57.24 133.94 43.36 274.95 11 227 0 0 1177 0 0 1 49 0 28.22 69.97 133.00 42.24 268.09 11 228 0 0 1272 0 0 2 30 D 0 11 229 0 0 1442 0 0 1 40 0 35.96 75.89 139.78 46.91 171.75 11 230 0 0 1443 0 0 1 37 0 38.26 68.03 152.74 45.63 338.13 11 547 210 211 859 548 548 1 60 D 0 11 548 210 211 856 549 549 1 58 D 0 11 549 210 211 756 0 0 2 76 D 0 11 550 216 217 869 551 551 2 35 D 0 11 551 216 217 864 552 552 1 55 D 0 11 552 216 217 754 553 553 2 66 D 0 11 553 216 217 861 0 0 1 66 0 28.39 81.60 127.32 39.33 259.70 11 554 214 215 869 555 555 1 42 D 0 11 555 214 215 874 0 0 1 70 D 0 11 556 213 212 748 557 557 2 45 D 0 11 557 213 212 856 558 558 2 79 D 0 11 558 213 212 749 0 0 2 80 D 0 11 748 219 556 0 0 0 2 51 0 23.75 77.39 169.73 48.42 270.77 11 749 220 558 0 750 750 2 64 0 28.27 77.02 129.87 46.02 196.61 11 750 220 558 0 751 751 1 62 0 30.36 77.45 128.57 41.74 223.07 11 751 220 558 0 752 752 1 52 0 23.72 69.42 120.15 38.88 235.40 11 752 220 558 0 753 753 2 50 0 20.76 62.04 123.31 38.44 237.70 11 753 220 558 0 0 0 2 49 0 28.88 72.02 146.22 44.63 255.36 11 754 224 552 0 755 755 2 45 0 31.18 69.96 124.75 40.71 222.75 11 755 224 552 0 0 0 1 41 0 23.30 58.49 118.83 39.29 281.48 11 756 221 549 0 757 757 2 58 0 28.43 72.64 138.13 39.38 317.91 11 757 221 549 0 758 758 1 52 0 33.69 61.32 142.52 36.83 227.19 11 758 221 549 0 0 0 1 51 0 30.24 62.58 154.58 39.87 259.34 11 856 548 557 0 857 857 1 63 0 39.76 63.44 141.57 42.18 161.02 11 857 548 557 1269 858 858 1 58 0 22.89 61.70 129.76 40.82 162.22 11 858 548 557 0 0 0 2 54 0 28.89 73.41 145.21 45.90 302.19 11 859 547 218 0 860 860 2 72 0 24.28 51.95 144.39 35.27 217.71 11 860 547 218 0 0 0 2 63 0 31.00 59.10 127.07 30.59 240.50 11 861 553 225 0 862 862 1 41 0 36.13 79.71 160.15 47.30 215.03 11 862 553 225 0 863 863 2 39 0 31.14 69.64 149.50 45.68 249.35 11 863 553 225 0 0 0 1 38 0 25.05 57.95 124.60 37.19 355.93 11 864 551 223 0 865 865 2 55 0 20.67 59.34 131.79 34.71 248.37 11 865 551 223 0 866 866 2 47 0 A 42.36 93.33 144.43 49.41 357.15 11 866 551 223 0 867 867 2 40 0 29.60 69.38 124.76 44.40 358.94 11 867 551 223 0 868 868 1 39 0 29.71 74.18 130.11 43.80 323.48 11 868 551 223 0 0 0 1 37 0 27.28 65.79 129.29 44.80 401.37 11 869 554 550 1269 870 870 2 57 1 24.71 75.84 134.05 43.52 241.70 11 870 554 550 0 871 871 1 56 0 34.64 76.14 147.44 46.50 285.90 11 871 554 550 1178 872 872 2 55 0 29.26 67.78 140.69 44.75 258.36 11 872 554 550 1177 873 873 2 37 D 0 11 873 554 550 1272 0 0 1 33 D 0 11 874 555 222 0 0 0 1 49 0 29.02 67.19 127.92 42.29 246.67 11 1177 227 872 0 0 0 2 16 0 30.96 68.36 142.67 41.96 676.07 11 1178 226 871 1442 1179 1179 2 35 0 26.82 67.34 117.03 40.34 409.81 11 1179 226 871 0 1180 1180 2 33 0 35.26 58.46 147.31 43.87 249.34 11 1180 226 871 0 0 0 2 28 0 31.80 63.58 131.00 44.17 196.70 11 1269 857 869 1443 1270 1270 2 38 0 28.12 57.63 135.86 38.64 322.79 11 1270 857 869 0 1271 1271 2 34 0 40.19 75.25 154.61 49.84 330.30 11 1271 857 869 0 0 0 2 26 0 26.08 71.33 141.90 43.61 433.63 11 1272 873 228 0 0 0 2 22 0 26.02 53.40 119.54 41.42 307.45 11 1442 229 1178 0 0 0 1 18 0 27.76 49.00 119.21 39.05 394.12 11 1443 230 1269 0 0 0 1 16 0 28.61 76.73 147.20 46.19 466.74 12 231 0 0 559 0 0 1 80 D 0 12 232 0 0 559 0 0 2 74 D 0 12 233 0 0 564 0 0 1 78 D 0 12 234 0 0 564 0 0 2 80 D 0 12 235 0 0 561 0 0 1 80 D 0 12 236 0 0 561 0 0 2 65 D 0 12 237 0 0 759 0 0 1 80 D 0 12 238 0 0 875 0 0 2 72 D 0 12 239 0 0 882 0 0 2 76 D 0 12 240 0 0 761 0 0 1 80 D 0 12 241 0 0 880 0 0 2 78 0 30.93 81.06 126.09 43.78 254.94 12 242 0 0 1226 0 0 2 38 D 0 12 559 231 232 875 560 560 1 68 D 0 12 560 231 232 877 0 0 1 66 D 0 12 561 235 236 882 562 562 1 43 D 0 12 562 235 236 761 563 563 2 80 D 0 12 563 235 236 880 0 0 1 74 D 0 12 564 233 234 759 565 565 2 59 D 0 12 565 233 234 877 0 0 2 75 D 0 12 759 237 564 0 760 760 1 70 0 20.21 82.96 120.19 39.87 263.51 12 760 237 564 0 0 0 2 56 0 28.81 74.70 120.52 44.01 272.22 12 761 240 562 1273 762 762 2 56 1 26.30 69.61 139.29 40.38 146.76 12 762 240 562 0 763 763 2 55 0 40.06 75.02 159.64 44.56 285.96 12 763 240 562 1226 764 764 1 52 0 25.48 54.50 114.82 40.64 203.28 12 764 240 562 0 0 0 1 47 0 32.88 80.48 128.42 47.39 269.19 12 875 559 238 0 876 876 2 68 0 30.07 78.90 135.63 41.50 383.18 12 876 559 238 0 0 0 1 66 0 34.73 62.88 143.09 42.40 231.94 12 877 560 565 0 878 878 2 60 0 30.39 68.54 118.67 37.21 211.59 12 878 560 565 0 879 879 2 58 0 27.00 70.54 131.05 39.99 156.62 12 879 560 565 1273 0 0 1 57 0 19.25 70.75 131.73 37.86 320.35 12 880 563 241 0 881 881 2 47 0 26.14 63.24 113.24 36.91 192.52 12 881 563 241 0 0 0 2 34 0 27.59 63.25 132.08 39.43 276.81 12 882 561 239 0 0 0 1 61 0 25.89 60.20 141.26 32.32 232.92 12 1226 763 242 0 1227 1227 2 31 0 27.92 48.81 122.70 35.66 228.62 12 1227 763 242 0 1228 1228 1 26 0 34.73 62.10 150.77 43.76 282.43 12 1228 763 242 0 0 0 1 25 0 29.29 46.95 143.84 36.81 354.48 12 1273 879 761 0 1274 1274 1 30 0 23.20 61.50 118.93 40.36 284.07 12 1274 879 761 0 1275 1275 2 26 0 30.15 58.56 118.46 41.52 250.30 12 1275 879 761 0 0 0 1 17 0 30.48 78.38 151.83 48.01 370.65 13 243 0 0 575 0 0 1 44 D 0 13 244 0 0 566 0 0 1 70 D 0 13 245 0 0 571 0 0 2 71 D 0 13 246 0 0 571 0 0 1 71 D 0 13 247 0 0 575 0 0 2 56 D 0 13 248 0 0 566 0 0 2 75 D 0 13 249 0 0 765 0 0 1 31 D 0 13 250 0 0 886 0 0 2 78 0 A 34.47 101.15 136.40 40.51 290.87 13 251 0 0 767 0 0 1 76 0 A 21.95 87.98 133.70 36.54 219.94 13 252 0 0 768 0 0 1 56 D 0 13 253 0 0 774 0 0 1 76 D 0 13 254 0 0 772 0 0 1 63 D 0 13 255 0 0 889 0 0 2 71 0 33.56 74.49 148.48 42.91 175.54 13 256 0 0 885 0 0 2 70 0 30.80 84.98 155.45 39.75 254.90 13 257 0 0 887 0 0 2 66 D 0 13 258 0 0 883 0 0 2 68 0 A 40.78 88.08 147.37 42.72 244.91 13 259 0 0 1181 0 0 1 60 0 25.66 62.83 148.58 38.72 171.85 13 260 0 0 1276 0 0 2 56 0 29.56 86.84 134.53 42.21 311.01 13 261 0 0 1229 0 0 2 54 0 26.65 67.40 118.82 34.90 208.82 13 262 0 0 1231 0 0 2 45 D 0 13 263 0 0 1236 0 0 2 43 0 29.47 76.22 114.42 42.74 255.33 13 566 244 248 765 567 567 2 76 D 0 13 567 244 248 891 568 568 2 71 D 0 13 568 244 248 883 569 569 1 70 0 A 39.60 98.16 147.05 45.85 247.74 13 569 244 248 885 570 570 1 52 D 0 13 570 244 248 772 0 0 2 66 D 0 13 571 246 245 886 572 572 1 73 D 0 13 572 246 245 768 573 573 2 78 0 33.44 69.81 132.35 40.28 206.94 13 573 246 245 889 574 574 1 71 0 32.97 87.17 146.96 44.92 290.45 13 574 246 245 887 0 0 1 69 0 33.68 75.30 130.36 44.48 361.54 13 575 243 247 774 576 576 2 78 0 24.51 77.06 114.29 42.77 142.87 13 576 243 247 891 0 0 1 75 D 0 13 765 249 566 0 766 766 2 55 0 24.89 74.16 148.13 40.91 211.29 13 766 249 566 0 0 0 1 52 0 31.77 77.01 186.59 41.43 155.76 13 767 251 566 0 0 0 2 46 0 A 33.52 88.72 153.15 47.71 226.27 13 768 252 572 1233 769 769 1 55 1 34.10 57.13 159.44 37.76 264.72 13 769 252 572 1229 770 770 1 54 0 32.90 81.36 171.12 42.94 256.09 13 770 252 572 1231 771 771 1 45 0 21.19 34.57 163.29 35.27 368.38 13 771 252 572 1236 0 0 1 42 0 A 42.54 91.57 153.57 49.36 163.10 13 772 254 570 0 773 773 2 44 0 31.39 65.43 105.25 40.27 219.87 13 773 254 570 0 0 0 2 35 0 32.80 77.34 127.32 38.99 310.45 13 774 253 575 0 0 0 2 54 0 34.22 65.76 141.89 43.81 269.64 13 883 568 258 0 884 884 2 47 0 A 28.11 96.48 189.21 41.02 269.85 13 884 568 258 0 0 0 2 44 0 A 35.89 90.96 181.90 41.33 218.05 13 885 569 256 0 0 0 2 49 0 32.90 51.94 125.66 40.34 273.00 13 886 571 250 0 0 0 1 57 0 31.28 70.10 145.97 41.72 183.47 13 887 574 257 0 888 888 1 44 0 33.52 79.89 149.74 45.67 222.34 13 888 574 257 0 0 0 1 37 0 30.65 69.01 155.78 48.96 287.92 13 889 573 255 0 890 890 2 49 0 33.00 82.18 163.85 50.36 279.05 13 890 573 255 0 0 0 1 32 0 25.37 54.05 135.50 34.93 227.84 13 891 576 567 1276 892 892 1 53 0 34.94 58.15 127.94 42.64 205.22 13 892 576 567 1181 893 893 2 52 0 32.40 78.28 154.81 46.08 260.99 13 893 576 567 1233 0 0 2 41 D 0 13 1181 259 892 0 1182 1182 1 36 0 A 36.55 90.75 138.86 53.74 262.65 13 1182 259 892 0 0 0 1 21 0 36.55 70.69 161.02 47.02 450.66 13 1229 769 261 0 1230 1230 1 28 0 29.09 73.28 197.40 38.57 457.35 13 1230 769 261 0 0 0 2 22 0 34.69 64.34 153.34 45.06 420.59 13 1231 770 262 0 1232 1232 2 22 0 33.13 67.53 138.23 36.71 438.68 13 1232 770 262 0 0 0 1 17 0 28.46 63.11 141.16 41.05 247.69 13 1233 768 893 0 1234 1234 2 30 0 30.18 56.04 137.98 38.09 347.88 13 1234 768 893 0 1235 1235 2 28 0 25.88 38.62 130.14 32.58 473.47 13 1235 768 893 0 0 0 1 27 0 25.87 41.13 130.62 34.61 501.43 13 1236 771 263 0 1237 1237 2 21 0 33.19 45.82 136.34 40.24 325.75 13 1237 771 263 0 0 0 2 18 0 25.15 42.86 129.39 39.86 335.59 13 1276 891 260 0 0 0 1 21 0 24.78 62.85 132.57 42.05 370.66 14 264 0 0 579 0 0 1 80 D 0 14 265 0 0 577 0 0 1 58 D 0 14 266 0 0 579 0 0 2 75 D 0 14 267 0 0 577 0 0 2 38 D 0 14 268 0 0 586 0 0 1 80 D 0 14 269 0 0 586 0 0 2 80 D 0 14 270 0 0 582 0 0 1 62 D 0 14 271 0 0 582 0 0 2 76 D 0 14 272 0 0 1052 0 0 2 78 D 0 14 273 0 0 899 0 0 2 80 D 0 14 274 0 0 775 0 0 1 41 D 0 14 275 0 0 902 0 0 2 49 D 0 14 276 0 0 777 0 0 1 74 D 0 14 277 0 0 779 0 0 1 75 0 A 36.86 92.40 164.57 48.90 188.55 14 278 0 0 901 0 0 2 74 D 0 14 279 0 0 1047 0 0 2 64 0 27.79 79.27 125.79 42.38 212.19 14 280 0 0 1186 0 0 1 59 D 0 14 281 0 0 1277 0 0 2 54 0 26.73 65.52 139.63 37.19 305.10 14 282 0 0 1183 0 0 1 45 0 28.12 81.17 124.56 42.38 224.79 14 283 0 0 1278 0 0 2 45 0 24.88 54.84 138.46 33.34 313.43 14 284 0 0 1279 0 0 2 36 0 33.67 52.48 127.75 41.19 250.61 14 577 265 267 899 578 578 1 49 D 0 14 578 265 267 894 0 0 1 58 D 0 14 579 264 266 902 580 580 1 42 D 0 14 580 264 266 901 581 581 1 76 0 43.37 86.70 135.77 48.76 273.17 14 581 264 266 894 0 0 2 72 D 0 14 582 270 271 1048 583 583 2 34 D 0 14 583 270 271 779 584 584 2 75 0 24.99 80.56 122.17 41.67 141.11 14 584 270 271 775 585 585 2 74 0 31.63 69.96 133.57 37.18 208.62 14 585 270 271 0 0 0 1 61 0 A 38.42 87.60 147.99 46.61 222.43 14 586 268 269 1052 587 587 1 65 D 0 14 587 268 269 1047 588 588 1 72 D 0 14 588 268 269 777 0 0 2 74 D 0 14 775 274 584 0 776 776 1 52 0 34.14 68.35 117.47 42.61 283.17 14 776 274 584 0 0 0 2 51 0 40.21 83.00 143.78 44.00 272.65 14 777 276 588 0 778 778 1 57 0 A 36.28 93.39 121.79 44.65 218.42 14 778 276 588 0 0 0 2 54 0 34.74 86.28 141.78 45.03 343.08 14 779 277 583 0 780 780 2 56 0 33.63 78.89 135.25 42.23 164.32 14 780 277 583 0 0 0 1 38 0 32.66 86.37 146.57 45.33 275.72 14 894 578 581 1281 895 895 1 55 1 A 39.69 112.04 199.83 49.60 264.16 14 895 578 581 1277 896 896 1 51 0 39.31 75.88 162.10 49.82 270.26 14 896 578 581 1278 897 897 1 47 0 33.87 74.09 144.42 43.27 254.21 14 897 578 581 0 898 898 1 46 0 34.02 78.39 154.64 46.12 269.78 14 898 578 581 1279 0 0 1 38 0 29.12 58.17 142.69 38.90 371.18 14 899 577 273 0 900 900 1 50 0 35.11 79.89 156.60 44.77 226.49 14 900 577 273 0 0 0 2 49 0 23.70 57.68 124.54 35.16 286.51 14 901 580 278 0 0 0 2 48 0 39.33 62.94 127.95 40.67 258.68 14 902 579 275 0 903 903 2 54 0 31.07 84.12 147.49 43.15 186.73 14 903 579 275 0 904 904 2 50 0 23.77 62.79 143.75 37.35 199.44 14 904 579 275 0 0 0 2 46 0 34.57 81.75 157.36 45.64 228.52 14 1047 587 279 0 0 0 2 39 0 22.51 58.38 129.75 41.07 350.48 14 1048 587 582 1186 1049 1049 2 55 0 24.84 57.66 135.99 38.54 276.70 14 1049 587 582 1281 1050 1050 2 53 0 41.30 75.72 143.67 46.26 254.67 14 1050 587 582 0 1051 1051 2 50 0 A 38.01 90.16 150.03 52.66 369.22 14 1051 587 582 1183 0 0 2 44 0 27.42 48.88 133.60 35.24 315.07 14 1052 586 272 0 1053 1053 2 66 0 19.55 52.00 130.51 29.52 269.83 14 1053 586 272 0 0 0 1 60 0 27.80 59.46 140.74 35.76 227.85 14 1183 282 1051 0 1184 1184 2 26 0 27.67 55.85 112.65 37.94 373.39 14 1184 282 1051 0 1185 1185 1 24 0 28.50 73.14 134.50 42.51 232.41 14 1185 282 1051 0 0 0 2 17 0 36.91 60.56 140.76 45.63 390.21 14 1186 280 1048 0 0 0 2 31 0 20.11 69.77 124.08 40.14 280.84 14 1277 895 281 0 0 0 2 31 0 35.34 75.42 148.70 44.84 296.81 14 1278 896 283 0 0 0 1 20 0 33.56 39.87 138.70 38.89 307.86 14 1279 898 284 0 1280 1280 1 18 0 31.83 43.45 156.00 38.67 584.23 14 1280 898 284 0 0 0 1 16 0 23.98 39.03 151.97 34.38 594.19 14 1281 894 1049 0 1282 1282 1 27 0 32.42 50.61 131.41 37.98 295.53 14 1282 894 1049 0 1283 1283 2 26 0 30.58 56.87 151.70 40.24 309.97 14 1283 894 1049 0 1284 1284 1 23 0 38.02 67.69 173.59 46.25 298.18 14 1284 894 1049 0 0 0 2 20 0 33.33 71.15 154.32 42.65 324.79 15 285 0 0 592 0 0 1 70 D 0 15 286 0 0 594 0 0 1 42 D 0 15 287 0 0 594 0 0 2 80 D 0 15 288 0 0 592 0 0 2 56 D 0 15 289 0 0 913 0 0 2 47 D 0 15 290 0 0 589 0 0 2 80 D 0 15 291 0 0 589 0 0 1 77 D 0 15 292 0 0 912 0 0 2 75 D 0 15 293 0 0 597 0 0 2 80 D 0 15 294 0 0 597 0 0 1 56 D 0 15 295 0 0 911 0 0 2 66 D 0 15 296 0 0 909 0 0 2 76 D 0 15 297 0 0 916 0 0 2 59 D 0 15 298 0 0 1187 0 0 1 60 D 0 15 299 0 0 781 0 0 1 77 0 29.51 66.33 132.19 35.89 258.17 15 300 0 0 785 0 0 1 77 0 A 34.26 94.25 150.28 46.62 192.26 15 301 0 0 789 0 0 1 68 0 37.82 82.43 140.30 47.64 134.71 15 302 0 0 792 0 0 1 64 0 27.55 68.86 94.20 33.46 428.94 15 303 0 0 1285 0 0 2 59 0 34.27 67.74 164.52 41.72 314.01 15 304 0 0 1469 0 0 2 51 0 38.35 74.39 113.60 41.45 254.35 15 305 0 0 1287 0 0 2 42 0 29.60 62.67 142.17 37.07 187.14 15 589 291 290 909 590 590 1 63 D 0 15 590 291 290 905 591 591 1 65 D 0 15 591 291 290 789 0 0 2 66 0 35.88 77.58 119.19 42.14 205.54 15 592 285 288 911 593 593 1 67 D 0 15 593 285 288 914 0 0 2 77 D 0 15 594 286 287 913 595 595 1 60 D 0 15 595 286 287 914 596 596 1 80 D 0 15 596 286 287 912 0 0 1 80 D 0 15 597 294 293 916 598 598 1 75 D 0 15 598 294 293 905 599 599 2 69 D 0 15 599 294 293 785 600 600 2 77 0 23.29 55.91 127.60 32.48 211.25 15 600 294 293 781 601 601 2 76 0 A 33.79 96.24 153.26 40.31 204.60 15 601 294 293 792 0 0 2 65 0 26.47 60.31 129.87 35.97 250.38 15 781 299 600 0 782 782 2 56 0 27.41 62.70 160.35 35.09 151.98 15 782 299 600 0 783 783 2 54 0 35.21 50.86 126.74 37.84 226.73 15 783 299 600 0 784 784 1 46 0 34.90 71.68 143.67 40.04 298.88 15 784 299 600 0 0 0 1 38 0 29.70 67.53 145.63 43.09 265.66 15 785 300 599 0 786 786 1 54 0 26.97 57.53 108.00 36.20 273.66 15 786 300 599 0 787 787 2 50 0 A 34.10 87.82 130.32 44.38 269.92 15 787 300 599 0 788 788 1 41 0 28.14 77.42 129.83 41.93 304.99 15 788 300 599 0 0 0 2 38 0 29.82 65.49 142.22 44.53 288.13 15 789 301 591 0 790 790 2 41 0 25.57 56.60 122.56 40.50 239.64 15 790 301 591 0 791 791 2 33 0 34.21 71.42 136.43 41.89 280.72 15 791 301 591 0 0 0 1 27 0 32.22 67.69 127.16 40.46 247.61 15 792 302 601 0 0 0 1 34 0 27.16 52.36 120.26 38.78 338.62 15 905 590 598 1285 906 906 1 60 0 22.19 65.19 117.02 36.91 194.44 15 906 590 598 1289 907 907 2 55 1 29.78 70.74 143.14 38.69 243.67 15 907 590 598 0 908 908 1 53 0 33.91 85.69 130.83 47.17 396.68 15 908 590 598 1287 0 0 1 43 0 29.76 69.98 118.16 42.79 241.10 15 909 589 296 0 910 910 1 52 0 22.76 76.37 148.27 38.62 248.97 15 910 589 296 0 0 0 2 49 0 41.15 63.23 141.57 48.61 296.52 15 911 592 295 0 0 0 2 71 0 31.13 63.36 132.69 38.39 269.20 15 912 596 292 0 0 0 2 76 0 A 40.97 88.13 141.61 46.72 288.22 15 913 594 289 0 0 0 2 73 0 29.03 73.13 128.99 42.31 258.12 15 914 595 593 1187 915 915 2 76 D 0 15 915 595 593 1289 0 0 1 54 0 23.06 67.24 119.46 41.28 257.39 15 916 597 297 0 917 917 1 57 0 29.82 72.36 132.19 41.99 281.79 15 917 597 297 0 918 918 2 56 0 38.39 85.17 154.33 47.81 242.87 15 918 597 297 0 919 919 2 49 0 21.37 56.26 108.95 39.53 226.05 15 919 597 297 0 0 0 1 46 0 34.71 73.87 128.75 44.72 269.83 15 1187 298 914 1469 0 0 1 39 D 0 15 1285 905 303 0 1286 1286 2 30 0 A 23.89 92.10 192.61 40.78 359.21 15 1286 905 303 0 0 0 2 22 0 A 31.58 96.46 201.49 46.73 337.04 15 1287 908 305 0 1288 1288 1 22 0 36.31 54.88 141.15 38.64 396.88 15 1288 908 305 0 0 0 2 20 0 35.90 60.18 138.43 36.48 370.42 15 1289 915 906 0 1290 1290 1 35 0 32.64 64.61 110.45 45.53 225.06 15 1290 915 906 0 1291 1291 2 24 0 30.93 86.07 173.07 45.03 274.88 15 1291 915 906 0 1292 1292 1 21 0 29.21 53.01 118.64 40.60 268.52 15 1292 915 906 0 0 0 2 20 0 35.70 86.29 165.80 52.02 342.14 15 1469 1187 304 0 1470 1470 1 29 0 28.71 65.96 124.91 39.87 419.22 15 1470 1187 304 0 1471 1471 2 27 0 19.57 48.05 131.44 31.55 539.55 15 1471 1187 304 0 0 0 2 23 0 33.38 78.16 133.72 46.20 542.43 16 306 0 0 604 0 0 1 62 D 0 16 307 0 0 604 0 0 2 60 D 0 16 308 0 0 602 0 0 1 48 D 0 16 309 0 0 602 0 0 2 70 D 0 16 310 0 0 925 0 0 2 77 D 0 16 311 0 0 923 0 0 2 77 D 0 16 312 0 0 920 0 0 2 80 D 0 16 313 0 0 927 0 0 2 45 D 0 16 314 0 0 1298 0 0 2 66 0 A 32.00 91.65 113.06 46.17 245.89 16 315 0 0 1296 0 0 2 54 0 31.81 65.55 146.37 37.11 323.54 16 316 0 0 1301 0 0 2 43 0 30.08 45.60 114.26 31.46 201.92 16 317 0 0 1188 0 0 1 29 D 0 16 602 308 309 920 603 603 1 80 D 0 16 603 308 309 923 0 0 1 76 D 0 16 604 306 307 925 605 605 1 80 D 0 16 605 306 307 927 0 0 1 53 D 0 16 920 602 312 1298 921 921 1 67 0 A 27.50 105.95 199.70 43.46 134.90 16 921 602 312 1296 922 922 1 57 0 A 32.81 97.35 150.01 39.71 272.87 16 922 602 312 1293 0 0 1 54 D 0 16 923 603 311 0 924 924 1 59 0 A 36.04 92.71 184.81 39.68 210.82 16 924 603 311 0 0 0 2 56 0 27.98 58.61 104.35 32.05 149.33 16 925 604 310 0 926 926 1 75 0 38.05 72.61 154.28 40.89 244.22 16 926 604 310 0 0 0 2 74 0 27.26 74.61 147.26 38.19 187.00 16 927 605 313 0 928 928 1 56 0 38.84 74.88 122.20 41.02 28.13 16 928 605 313 1293 929 929 2 55 1 32.30 53.22 127.17 39.99 217.90 16 929 605 313 1301 930 930 1 46 0 26.90 61.20 133.01 39.64 193.20 16 930 605 313 1188 0 0 2 41 0 35.25 44.39 121.32 39.75 232.27 16 1188 317 930 0 0 0 1 18 0 20.31 45.70 119.12 34.88 497.02 16 1293 922 928 0 1294 1294 2 32 0 31.09 75.78 151.70 48.11 228.37 16 1294 922 928 0 1295 1295 1 31 0 39.79 81.27 149.04 46.20 211.28 16 1295 922 928 0 0 0 2 27 0 31.95 76.10 141.80 45.60 285.16 16 1296 921 315 0 1297 1297 2 34 0 33.88 46.51 112.18 34.98 345.24 16 1297 921 315 0 0 0 2 33 0 39.97 75.26 137.51 48.34 265.21 16 1298 920 314 0 1299 1299 1 45 0 34.29 78.49 94.65 41.02 214.06 16 1299 920 314 0 1300 1300 2 39 0 33.23 72.56 147.01 40.36 270.37 16 1300 920 314 0 0 0 1 27 0 32.10 70.29 150.38 45.56 243.28 16 1301 929 316 0 0 0 1 23 0 39.65 70.95 141.73 46.20 242.18 17 318 0 0 614 0 0 2 51 D 0 17 319 0 0 614 0 0 1 48 D 0 17 320 0 0 608 0 0 1 71 D 0 17 321 0 0 606 0 0 1 80 D 0 17 322 0 0 608 0 0 2 68 D 0 17 323 0 0 619 0 0 1 80 D 0 17 324 0 0 611 0 0 1 36 D 0 17 325 0 0 611 0 0 2 64 D 0 17 326 0 0 606 0 0 2 71 D 0 17 327 0 0 943 0 0 2 65 D 0 17 328 0 0 793 0 0 1 65 D 0 17 329 0 0 794 0 0 1 54 D 0 17 330 0 0 795 0 0 1 52 D 0 17 331 0 0 796 0 0 1 72 0 A 39.83 94.13 162.78 49.89 275.50 17 332 0 0 798 0 0 1 60 D 0 17 333 0 0 799 0 0 1 61 D 0 17 334 0 0 936 0 0 2 66 D 0 17 335 0 0 937 0 0 2 63 0 31.34 85.07 140.06 42.23 92.37 17 336 0 0 1193 0 0 1 60 0 40.07 80.82 152.55 46.54 217.03 17 337 0 0 1307 0 0 2 53 0 21.80 49.99 116.42 28.63 274.64 17 338 0 0 1305 0 0 2 51 0 34.76 71.54 125.29 43.49 243.97 17 339 0 0 1189 0 0 1 49 0 36.42 62.20 121.60 42.38 225.34 17 340 0 0 1191 0 0 1 42 0 26.14 78.17 150.04 43.51 218.54 17 341 0 0 1306 0 0 2 39 0 29.19 49.82 136.74 33.25 256.51 17 606 321 326 939 607 607 2 69 D 0 17 607 321 326 796 0 0 2 69 0 37.63 79.35 132.24 46.15 178.19 17 608 320 322 931 609 609 1 71 D 0 17 609 320 322 795 610 610 2 75 0 29.38 57.41 131.30 30.86 289.53 17 610 320 322 798 0 0 2 74 0 33.66 84.41 168.86 38.39 352.28 17 611 324 325 931 612 612 2 76 0 17.95 72.66 112.67 33.91 214.19 17 612 324 325 936 613 613 1 36 D 0 17 613 324 325 937 0 0 1 65 0 A 30.36 89.99 144.55 44.60 311.61 17 614 319 318 943 615 615 1 78 D 0 17 615 319 318 793 616 616 2 80 D 0 17 616 319 318 794 617 617 2 80 D 0 17 617 319 318 939 618 618 1 77 D 0 17 618 319 318 799 0 0 2 69 0 41.22 82.57 137.05 41.74 199.50 17 619 323 325 0 0 0 2 60 0 A 41.59 97.34 138.98 44.91 168.41 17 793 328 615 0 0 0 2 63 0 A 35.19 90.11 113.72 40.39 208.55 17 794 329 616 0 0 0 2 53 0 34.09 60.13 150.96 38.23 218.36 17 795 330 609 0 0 0 1 46 0 30.67 54.12 161.54 34.43 282.04 17 796 331 607 0 797 797 1 46 0 34.90 59.84 136.91 39.12 167.98 17 797 331 607 0 0 0 2 37 0 24.93 58.62 128.08 37.61 262.78 17 798 332 610 0 0 0 1 53 0 45.62 80.35 136.76 45.27 161.68 17 799 333 618 0 800 800 1 43 0 35.67 60.89 139.14 45.38 245.70 17 800 333 618 0 0 0 2 39 0 25.89 56.90 113.78 40.17 318.03 17 931 608 611 1302 932 932 1 57 0 32.57 75.19 126.48 41.65 257.55 17 932 608 611 1307 933 933 1 36 D 0 17 933 608 611 1305 934 934 1 51 0 A 29.42 96.51 171.10 42.49 187.33 17 934 608 611 0 935 935 1 50 0 19.31 67.89 119.67 32.38 314.12 17 935 608 611 1306 0 0 1 39 0 19.12 57.33 114.05 37.48 297.65 17 936 612 334 0 0 0 1 38 0 32.70 83.38 129.20 47.65 271.98 17 937 613 335 0 938 938 2 43 0 A 35.34 99.03 160.12 51.43 163.96 17 938 613 335 0 0 0 2 35 0 35.39 80.33 162.68 49.99 272.46 17 939 617 606 1302 940 940 2 55 1 25.31 67.72 103.31 33.14 184.08 17 940 617 606 1193 941 941 2 53 0 36.73 63.48 131.82 33.44 314.49 17 941 617 606 1189 942 942 2 47 0 34.40 75.28 136.82 38.29 188.54 17 942 617 606 1191 0 0 2 38 0 44.86 79.14 140.47 49.29 216.11 17 943 614 327 0 944 944 2 69 0 A 29.88 94.19 122.97 46.14 276.39 17 944 614 327 0 0 0 2 68 0 33.11 55.42 144.57 37.38 233.52 17 1189 339 941 0 1190 1190 2 20 0 32.55 48.38 123.15 34.41 342.78 17 1190 339 941 0 0 0 1 18 0 40.86 62.37 149.21 42.03 353.48 17 1191 340 942 0 1192 1192 1 20 0 A 32.18 87.53 164.49 47.62 275.17 17 1192 340 942 0 0 0 2 17 0 37.17 71.21 136.64 43.90 411.58 17 1193 336 940 0 0 0 2 22 0 34.03 76.85 129.96 39.77 516.21 17 1302 931 939 0 1303 1303 1 32 0 25.37 66.72 120.28 35.87 330.65 17 1303 931 939 0 1304 1304 1 31 0 41.60 57.47 115.23 40.85 309.55 17 1304 931 939 0 0 0 1 26 0 32.17 60.99 138.81 40.93 284.21 17 1305 933 338 0 0 0 1 26 0 28.70 58.16 108.82 34.98 331.07 17 1306 935 341 0 0 0 2 18 0 23.73 41.58 154.67 35.21 362.25 17 1307 932 337 0 1308 1308 1 29 0 31.07 85.59 153.28 45.50 333.23 17 1308 932 337 0 0 0 2 22 0 28.62 53.97 144.40 34.75 370.91 18 342 0 0 624 0 0 1 77 D 0 18 343 0 0 624 0 0 2 80 D 0 18 344 0 0 620 0 0 1 68 D 0 18 345 0 0 620 0 0 2 38 D 0 18 346 0 0 803 0 0 1 80 D 0 18 347 0 0 945 0 0 2 80 D 0 18 348 0 0 806 0 0 1 67 D 0 18 349 0 0 801 0 0 1 56 D 0 18 350 0 0 804 0 0 1 62 D 0 18 351 0 0 948 0 0 2 75 D 0 18 352 0 0 1315 0 0 2 40 D 0 18 353 0 0 1313 0 0 2 54 0 35.89 81.73 144.41 45.83 216.19 18 354 0 0 1194 0 0 1 45 0 36.00 79.10 149.73 47.27 244.48 18 620 344 345 803 621 621 2 75 D 0 18 621 344 345 806 622 622 2 75 D 0 18 622 344 345 804 623 623 2 71 D 0 18 623 344 345 801 0 0 2 79 0 A 35.84 92.37 156.91 52.33 223.87 18 624 342 343 945 625 625 1 80 D 0 18 625 342 343 948 0 0 1 72 D 0 18 801 349 623 0 802 802 2 57 0 39.72 72.34 151.92 43.01 206.05 18 802 349 623 1309 0 0 2 53 0 30.70 73.75 124.00 47.14 255.73 18 803 346 620 0 0 0 1 60 0 21.27 67.29 121.80 38.39 271.81 18 804 350 622 0 805 805 1 59 0 27.19 72.69 133.97 40.55 186.94 18 805 350 622 0 0 0 1 58 0 35.98 79.72 160.28 44.08 247.75 18 806 348 621 0 807 807 2 66 0 34.59 66.76 145.98 47.16 239.13 18 807 348 621 0 0 0 1 48 0 A 35.68 100.88 146.24 50.40 204.06 18 945 624 347 0 946 946 1 65 0 24.62 58.98 140.67 32.14 214.70 18 946 624 347 0 947 947 1 57 0 26.08 61.27 135.53 32.74 297.16 18 947 624 347 0 0 0 2 45 0 37.71 60.91 143.39 41.16 202.34 18 948 625 351 1315 949 949 1 57 D 0 18 949 625 351 1313 950 950 1 58 0 31.96 62.28 146.88 41.53 221.14 18 950 625 351 1309 951 951 1 54 1 28.03 66.90 137.93 44.71 293.46 18 951 625 351 1194 0 0 2 44 0 32.41 44.49 129.52 39.26 330.79 18 1194 354 951 0 1195 1195 2 24 0 34.10 64.82 153.96 41.74 296.67 18 1195 354 951 0 1196 1196 2 20 0 20.46 54.77 122.77 34.91 364.47 18 1196 354 951 0 0 0 2 16 0 29.22 67.61 111.51 42.41 337.19 18 1309 950 802 0 1310 1310 2 32 0 39.06 77.12 149.65 48.90 292.67 18 1310 950 802 0 1311 1311 1 30 0 19.63 49.22 111.59 35.61 397.17 18 1311 950 802 0 1312 1312 1 29 0 26.47 70.30 126.91 47.69 346.57 18 1312 950 802 0 0 0 2 20 0 A 40.23 89.32 134.09 49.83 317.94 18 1313 949 353 0 1314 1314 2 32 0 31.93 49.52 173.75 42.80 288.64 18 1314 949 353 0 0 0 1 31 0 33.63 57.57 143.61 43.45 330.41 18 1315 948 352 0 0 0 1 35 0 25.05 46.49 150.67 39.33 398.92 19 355 0 0 626 0 0 1 61 D 0 19 356 0 0 626 0 0 2 80 D 0 19 357 0 0 630 0 0 1 76 D 0 19 358 0 0 630 0 0 2 75 D 0 19 359 0 0 952 0 0 2 66 0 25.73 68.28 135.20 40.79 212.27 19 360 0 0 812 0 0 1 65 0 28.85 86.83 122.03 45.47 352.47 19 361 0 0 816 0 0 1 65 0 34.27 86.01 155.08 39.45 239.35 19 362 0 0 1054 0 0 2 61 0 35.03 69.49 153.26 41.43 241.58 19 363 0 0 808 0 0 1 56 0 34.76 47.94 125.96 36.62 297.06 19 364 0 0 817 0 0 1 43 0 36.11 53.71 131.41 33.96 271.43 19 365 0 0 1238 0 0 2 39 0 22.16 60.68 140.39 44.96 200.02 19 366 0 0 1240 0 0 2 37 0 19.72 65.49 130.47 36.01 238.50 19 367 0 0 1197 0 0 1 36 0 20.80 54.03 104.81 34.54 267.86 19 368 0 0 1316 0 0 2 33 0 36.99 60.37 142.70 44.08 224.39 19 626 355 356 952 627 627 1 64 0 25.74 51.71 132.05 37.89 148.03 19 627 355 356 816 628 628 2 62 D 0 19 628 355 356 808 629 629 2 54 0 29.02 73.86 119.13 43.38 239.12 19 629 355 356 1057 0 0 2 52 1 31.87 72.48 142.29 44.50 207.66 19 630 357 358 812 631 631 2 35 D 0 19 631 357 358 1054 632 632 1 62 0 35.09 83.56 127.90 44.07 222.13 19 632 357 358 1057 633 633 1 49 0 32.57 57.71 138.82 39.56 252.44 19 633 357 358 817 0 0 2 45 0 38.35 82.58 136.38 43.13 304.62 19 808 363 628 0 809 809 2 30 0 34.07 63.08 127.65 38.54 246.11 19 809 363 628 0 810 810 2 27 0 26.70 52.25 114.59 35.81 290.45 19 810 363 628 0 811 811 2 19 0 24.37 52.31 125.78 34.56 355.67 19 811 363 628 0 0 0 1 17 0 35.92 66.32 146.83 42.62 277.56 19 812 360 630 1238 813 813 1 40 0 42.49 70.92 145.37 51.19 291.20 19 813 360 630 1197 814 814 2 39 0 30.09 63.03 152.52 41.24 374.34 19 814 360 630 1240 815 815 1 36 0 28.73 67.68 131.29 45.66 226.03 19 815 360 630 0 0 0 2 34 0 30.37 56.16 134.25 41.71 452.77 19 816 361 627 0 0 0 2 29 0 27.86 53.19 119.29 32.02 252.38 19 817 364 633 0 818 818 2 22 0 28.78 47.47 130.09 35.53 261.36 19 818 364 633 0 819 819 1 21 0 28.41 44.68 112.16 35.31 351.57 19 819 364 633 0 0 0 1 16 0 32.53 42.89 118.41 33.80 251.68 19 952 626 359 0 953 953 2 42 0 29.40 61.96 128.69 40.75 258.95 19 953 626 359 0 0 0 2 40 0 34.46 66.96 149.15 44.44 236.40 19 1054 631 362 1316 1055 1055 1 39 0 24.75 74.67 118.04 38.47 430.05 19 1055 631 362 0 1056 1056 1 38 0 19.45 43.46 107.21 29.41 266.34 19 1056 631 362 0 0 0 1 29 0 29.87 53.31 115.15 38.11 447.61 19 1057 632 629 0 1058 1058 1 26 0 31.87 54.96 144.45 40.30 305.57 19 1058 632 629 0 1059 1059 2 24 0 38.52 71.37 146.01 49.37 285.79 19 1059 632 629 0 0 0 2 21 0 33.03 61.14 138.71 42.70 322.05 19 1197 367 813 0 0 0 2 17 0 35.76 72.22 147.09 47.89 356.31 19 1238 812 365 0 1239 1239 2 18 0 32.38 77.73 140.31 48.79 361.04 19 1239 812 365 0 0 0 2 16 0 29.25 56.29 124.74 45.38 330.09 19 1240 814 366 0 0 0 1 16 0 39.65 74.07 134.66 45.84 589.38 19 1316 1054 368 0 0 0 2 16 0 27.53 83.54 182.56 39.54 561.73 20 369 0 0 638 0 0 2 79 D 0 20 370 0 0 638 0 0 1 72 D 0 20 371 0 0 634 0 0 1 80 D 0 20 372 0 0 634 0 0 2 80 D 0 20 373 0 0 636 0 0 1 80 D 0 20 374 0 0 636 0 0 2 34 D 0 20 375 0 0 637 0 0 2 64 D 0 20 376 0 0 641 0 0 1 77 D 0 20 377 0 0 641 0 0 2 76 D 0 20 378 0 0 966 0 0 2 80 D 0 20 379 0 0 954 0 0 2 27 D 0 20 380 0 0 962 0 0 2 65 D 0 20 381 0 0 1060 0 0 2 80 D 0 20 382 0 0 965 0 0 2 68 D 0 20 383 0 0 1198 0 0 1 62 D 0 20 384 0 0 1317 0 0 2 60 0 A 38.80 92.04 166.05 52.85 116.39 20 385 0 0 1202 0 0 1 56 0 23.95 67.86 136.32 40.68 291.12 20 386 0 0 1203 0 0 1 56 0 A 32.81 96.95 139.57 48.29 305.43 20 387 0 0 1201 0 0 1 55 0 30.67 50.06 125.16 36.66 164.65 20 388 0 0 1320 0 0 2 53 0 A 35.71 89.53 137.70 48.69 184.37 20 389 0 0 1200 0 0 1 50 0 30.74 72.84 132.17 43.57 238.96 20 390 0 0 1318 0 0 2 50 0 A 28.47 97.39 193.30 48.16 186.42 20 634 371 372 962 635 635 1 48 D 0 20 635 371 372 954 0 0 1 80 D 0 20 636 373 374 1061 0 0 2 73 0 35.06 63.43 133.51 38.60 229.24 20 637 373 375 0 0 0 2 60 0 30.70 65.00 150.03 38.60 208.00 20 638 370 369 966 639 639 1 80 D 0 20 639 370 369 965 640 640 1 72 D 0 20 640 370 369 956 0 0 2 70 D 0 20 641 376 377 1060 642 642 1 54 D 0 20 642 376 377 1061 0 0 1 76 0 33.45 81.18 134.38 38.94 240.26 20 954 635 379 1198 955 955 2 64 0 36.87 85.90 140.10 45.24 264.85 20 955 635 379 1317 0 0 1 62 0 26.73 75.46 127.85 37.65 263.19 20 956 635 640 1203 957 957 2 56 0 37.93 63.62 125.69 42.82 359.63 20 957 635 640 1320 958 958 1 48 D 0 20 958 635 640 1318 959 959 1 53 0 32.08 84.96 145.47 46.39 301.77 20 959 635 640 1202 960 960 2 52 0 26.95 73.30 141.04 41.69 310.89 20 960 635 640 1321 961 961 2 49 1 33.02 75.18 143.52 42.04 275.95 20 961 635 640 0 0 0 1 38 0 31.66 66.43 128.69 44.80 331.87 20 962 634 380 0 963 963 2 62 0 A 30.27 89.19 163.14 46.88 380.03 20 963 634 380 0 964 964 1 59 0 32.87 61.57 159.24 43.53 329.43 20 964 634 380 0 0 0 2 49 0 35.24 67.71 125.26 39.37 243.89 20 965 639 382 0 0 0 1 48 0 27.79 81.60 157.79 41.58 386.50 20 966 638 378 0 967 967 1 68 0 27.08 64.80 128.99 38.06 194.34 20 967 638 378 0 968 968 1 65 0 A 41.84 96.24 145.58 49.73 236.29 20 968 638 378 0 0 0 2 64 0 28.55 76.15 140.12 44.50 144.46 20 1060 641 381 0 0 0 2 60 0 21.06 69.98 123.42 36.85 222.07 20 1061 642 636 1321 1062 1062 1 52 0 34.60 63.48 145.95 38.86 276.98 20 1062 642 636 1200 1063 1063 2 51 0 35.71 69.98 167.09 40.92 143.13 20 1063 642 636 1201 0 0 2 50 0 27.09 45.60 132.91 34.79 197.11 20 1198 383 954 0 1199 1199 1 32 0 32.43 72.82 128.99 44.48 377.07 20 1199 383 954 0 0 0 1 29 0 34.05 80.97 149.23 49.41 485.14 20 1200 389 1062 0 0 0 1 26 0 41.24 63.59 151.72 43.06 251.96 20 1201 387 1063 0 0 0 2 27 0 24.14 35.77 113.17 31.12 341.96 20 1202 385 959 0 0 0 1 24 0 30.96 81.55 173.50 43.76 329.34 20 1203 386 956 0 0 0 1 29 0 37.12 70.73 153.44 49.81 280.82 20 1317 955 384 0 0 0 1 36 0 21.77 67.47 102.94 37.51 253.08 20 1318 958 390 0 1319 1319 1 26 0 A 34.10 96.86 179.12 47.16 547.21 20 1319 958 390 0 0 0 2 16 0 30.86 63.94 152.36 45.43 409.92 20 1320 957 388 0 0 0 1 27 0 35.23 79.84 136.89 47.28 331.45 20 1321 1061 960 0 1322 1322 2 34 0 38.70 70.06 135.04 44.52 310.99 20 1322 1061 960 0 1323 1323 2 22 0 35.36 56.09 133.02 37.37 598.22 20 1323 1061 960 0 1324 1324 2 20 0 36.72 63.69 143.54 42.53 405.13 20 1324 1061 960 0 0 0 1 16 0 29.04 44.46 146.68 39.40 380.42 21 391 0 0 655 0 0 1 55 D 0 21 392 0 0 655 0 0 2 75 D 0 21 393 0 0 648 0 0 1 70 D 0 21 394 0 0 648 0 0 2 80 D 0 21 395 0 0 650 0 0 1 75 D 0 21 396 0 0 1080 0 0 2 80 D 0 21 397 0 0 650 0 0 2 69 D 0 21 398 0 0 643 0 0 1 59 D 0 21 399 0 0 643 0 0 2 39 D 0 21 400 0 0 1079 0 0 2 73 D 0 21 401 0 0 820 0 0 1 80 D 0 21 402 0 0 1206 0 0 1 74 0 32.15 77.24 136.38 44.10 302.04 21 403 0 0 823 0 0 1 67 D 0 21 404 0 0 1077 0 0 2 73 0 32.42 75.75 104.17 40.25 212.51 21 405 0 0 827 0 0 1 70 D 0 21 406 0 0 1204 0 0 1 52 D 0 21 407 0 0 825 0 0 1 65 D 0 21 408 0 0 1337 0 0 2 34 D 0 21 409 0 0 1072 0 0 2 70 0 A 27.48 92.14 145.58 48.57 258.92 21 410 0 0 829 0 0 1 68 0 35.67 76.96 154.42 46.23 289.30 21 411 0 0 1331 0 0 2 65 0 31.40 86.91 144.67 41.49 129.37 21 412 0 0 969 0 0 2 64 0 A 38.09 92.84 167.45 51.74 212.26 21 413 0 0 1334 0 0 2 61 0 41.51 80.25 150.94 47.08 313.82 21 414 0 0 1338 0 0 2 60 0 32.50 76.29 124.22 45.82 204.50 21 415 0 0 1212 0 0 1 60 0 40.88 71.13 138.56 45.04 297.21 21 416 0 0 974 0 0 2 59 0 A 35.38 93.00 153.40 52.88 202.12 21 417 0 0 1214 0 0 1 57 0 27.39 63.78 115.70 37.98 227.43 21 418 0 0 1475 0 0 2 52 0 25.60 56.22 133.77 38.63 253.80 21 419 0 0 1210 0 0 1 49 0 25.07 55.29 116.72 33.76 271.24 21 420 0 0 1209 0 0 1 47 0 28.70 58.45 161.75 37.01 138.53 21 421 0 0 1325 0 0 2 45 0 29.76 64.43 143.53 35.98 246.58 21 422 0 0 1448 0 0 1 45 0 32.27 78.40 150.26 46.36 283.68 21 423 0 0 1460 0 0 2 44 0 A 23.98 102.10 149.43 48.00 318.29 21 424 0 0 1444 0 0 1 42 0 26.89 55.34 118.10 38.92 259.28 21 425 0 0 1446 0 0 1 42 0 34.33 65.05 148.02 39.60 259.30 21 426 0 0 1474 0 0 2 42 0 36.93 73.63 142.75 42.26 282.55 21 427 0 0 1472 0 0 2 40 0 36.82 76.29 147.08 43.51 278.93 21 643 398 399 823 644 644 2 64 D 0 21 644 398 399 969 645 645 1 72 0 31.43 56.87 90.23 34.68 238.81 21 645 398 399 829 646 646 2 69 0 A 32.18 87.60 114.73 47.74 194.83 21 646 398 399 825 647 647 2 61 D 0 21 647 398 399 974 0 0 1 56 D 0 21 648 393 394 1064 649 649 1 65 D 0 21 649 393 394 820 0 0 2 63 D 0 21 650 395 397 1079 651 651 1 74 D 0 21 651 395 397 1077 652 652 1 76 0 22.89 56.38 107.04 30.22 325.11 21 652 395 397 1072 653 653 1 42 D 0 21 653 395 397 827 654 654 2 64 D 0 21 654 395 397 970 0 0 2 28 D 0 21 655 391 392 1080 656 656 1 76 D 0 21 656 391 392 1064 0 0 2 55 D 0 21 820 401 649 0 821 821 1 67 0 A 27.37 102.95 148.85 46.55 253.73 21 821 401 649 0 822 822 2 59 0 19.45 87.12 172.00 38.31 228.71 21 822 401 649 0 0 0 2 51 0 22.06 61.39 122.90 34.76 229.82 21 823 403 643 0 824 824 2 50 0 31.36 69.71 147.36 39.51 268.85 21 824 403 643 0 0 0 1 30 0 15.35 53.83 123.04 31.49 279.06 21 825 407 646 0 826 826 2 46 0 28.43 63.01 119.02 41.02 371.47 21 826 407 646 0 0 0 1 37 0 30.87 74.14 126.57 43.18 311.84 21 827 405 653 0 828 828 1 50 0 38.70 82.61 126.55 44.38 286.04 21 828 405 653 0 0 0 2 30 0 38.33 82.01 189.86 44.30 293.29 21 829 410 645 0 830 830 2 45 0 32.51 62.94 131.96 42.18 238.02 21 830 410 645 0 0 0 1 37 0 42.03 78.68 135.56 48.95 268.45 21 969 644 412 0 0 0 1 35 0 34.75 78.08 126.27 48.66 323.78 21 970 644 654 1210 971 971 2 49 0 31.15 78.10 112.84 37.57 234.51 21 971 644 654 1327 972 972 2 48 1 32.50 49.17 128.67 38.05 287.13 21 972 644 654 1325 973 973 1 40 D 0 21 973 644 654 1209 0 0 2 44 0 24.66 52.62 145.88 40.17 257.40 21 974 647 416 0 0 0 2 22 0 34.44 73.05 146.86 44.34 409.91 21 1064 648 656 1337 1065 1065 1 73 0 A 26.67 95.61 169.34 38.47 212.51 21 1065 648 656 1204 1066 1066 2 72 0 A 40.09 89.65 148.29 45.06 296.85 21 1066 648 656 1206 1067 1067 2 46 D 0 21 1067 648 656 1331 1068 1068 1 67 0 A 42.73 98.72 152.53 50.46 385.40 21 1068 648 656 1212 1069 1069 2 64 0 34.22 81.55 126.95 41.86 305.01 21 1069 648 656 1334 1070 1070 1 55 D 0 21 1070 648 656 1214 1071 1071 2 57 0 A 30.50 105.90 164.31 43.55 317.90 21 1071 648 656 1327 0 0 1 53 0 26.12 60.42 105.66 31.48 351.20 21 1072 652 409 0 1073 1073 2 52 0 31.98 68.01 131.11 40.71 220.99 21 1073 652 409 0 1074 1074 1 48 0 25.75 66.23 127.26 43.04 238.48 21 1074 652 409 0 1075 1075 2 45 0 22.58 71.64 128.85 37.41 252.99 21 1075 652 409 0 1076 1076 1 40 0 36.12 69.25 168.15 46.90 233.78 21 1076 652 409 0 0 0 2 37 0 34.91 52.15 125.77 38.51 177.84 21 1077 651 404 0 1078 1078 2 48 0 40.85 79.68 151.25 46.87 288.98 21 1078 651 404 0 0 0 1 45 0 23.48 61.67 100.08 35.89 161.99 21 1079 650 400 0 0 0 2 62 0 30.77 62.81 124.86 37.99 171.64 21 1080 655 396 0 0 0 2 74 0 A 27.24 113.02 165.30 44.54 194.86 21 1204 406 1065 1460 1205 1205 1 46 0 A 28.86 107.57 163.59 48.71 209.41 21 1205 406 1065 1444 0 0 2 39 0 34.07 77.79 138.13 42.08 349.71 21 1206 402 1066 1448 1207 1207 2 46 0 37.55 72.89 150.17 42.20 351.34 21 1207 402 1066 1472 1208 1208 1 41 0 34.68 75.71 146.70 47.71 349.51 21 1208 402 1066 0 0 0 1 36 0 35.25 84.59 129.86 47.98 251.40 21 1209 420 973 0 0 0 1 19 0 32.42 49.14 126.27 33.05 271.09 21 1210 419 970 0 1211 1211 1 26 0 36.30 79.02 148.53 46.93 332.59 21 1211 419 970 0 0 0 1 18 0 32.55 29.16 122.12 30.72 304.00 21 1212 415 1068 0 1213 1213 2 35 0 31.36 72.39 131.42 42.44 333.97 21 1213 415 1068 0 0 0 1 22 0 32.78 59.84 130.88 41.19 322.06 21 1214 417 1070 0 1215 1215 1 36 0 35.73 72.70 137.47 41.14 220.03 21 1215 417 1070 0 1216 1216 1 34 0 38.29 68.68 139.41 40.56 381.59 21 1216 417 1070 0 0 0 1 28 0 31.04 66.14 129.99 41.64 286.91 21 1325 972 421 0 1326 1326 1 23 0 32.67 53.83 149.23 39.49 272.88 21 1326 972 421 0 0 0 2 16 0 33.45 59.44 132.06 42.08 354.73 21 1327 1071 971 0 1328 1328 1 32 0 29.68 53.00 147.24 34.92 449.50 21 1328 1071 971 0 1329 1329 1 22 0 32.13 51.78 134.81 38.71 568.15 21 1329 1071 971 0 1330 1330 1 20 0 24.53 47.18 109.99 36.70 512.68 21 1330 1071 971 0 0 0 1 17 0 31.57 50.01 116.41 34.44 410.61 21 1331 1067 411 1446 1332 1332 2 42 0 37.06 64.08 152.70 45.74 300.35 21 1332 1067 411 0 1333 1333 1 39 0 27.89 71.34 124.81 39.78 224.36 21 1333 1067 411 0 0 0 2 31 0 24.82 57.15 128.57 43.83 244.17 21 1334 1069 413 1474 1335 1335 1 44 0 36.60 73.40 137.81 47.72 245.77 21 1335 1069 413 0 1336 1336 1 37 0 37.34 63.61 131.76 44.65 208.49 21 1336 1069 413 0 0 0 1 30 0 27.25 51.08 139.63 34.96 370.55 21 1337 1064 408 1475 0 0 1 56 0 25.26 81.06 141.65 39.29 258.93 21 1338 1064 414 0 1339 1339 2 37 0 36.44 70.97 125.44 45.19 127.78 21 1339 1064 414 0 1340 1340 2 32 0 A 32.01 88.37 141.97 45.74 233.24 21 1340 1064 414 0 1341 1341 2 29 0 A 40.44 88.25 134.62 48.27 164.86 21 1341 1064 414 0 0 0 1 25 0 30.86 72.11 122.32 45.55 290.46 21 1444 424 1205 0 1445 1445 2 17 0 29.69 67.32 140.49 46.18 372.75 21 1445 424 1205 0 0 0 1 16 0 34.28 71.35 124.85 44.83 522.75 21 1446 425 1331 0 1447 1447 1 21 0 36.76 70.37 154.56 45.60 460.99 21 1447 425 1331 0 0 0 2 20 0 25.05 73.44 141.08 47.01 332.48 21 1448 422 1206 0 1449 1449 2 24 0 31.08 52.62 119.10 38.30 218.72 21 1449 422 1206 0 0 0 1 23 0 28.57 70.07 136.93 42.86 311.33 21 1460 1204 423 0 1461 1461 2 21 0 A 31.32 95.44 186.58 46.16 326.77 21 1461 1204 423 0 1462 1462 2 17 0 33.05 68.45 152.91 47.83 292.14 21 1462 1204 423 0 0 0 1 16 0 31.56 77.25 182.12 44.07 402.87 21 1472 1207 427 0 1473 1473 1 20 0 27.43 67.61 133.66 41.04 282.75 21 1473 1207 427 0 0 0 2 18 0 44.24 86.44 136.97 52.39 329.87 21 1474 1334 426 0 0 0 1 20 0 28.96 61.01 114.61 42.83 586.24 21 1475 1337 418 0 0 0 1 24 0 37.13 69.77 139.56 43.29 335.48 22 428 0 0 662 0 0 1 67 D 0 22 429 0 0 662 0 0 2 72 D 0 22 430 0 0 659 0 0 1 80 D 0 22 431 0 0 659 0 0 2 80 D 0 22 432 0 0 657 0 0 1 67 D 0 22 433 0 0 664 0 0 1 71 D 0 22 434 0 0 657 0 0 2 80 D 0 22 435 0 0 664 0 0 2 78 D 0 22 436 0 0 831 0 0 1 61 D 0 22 437 0 0 839 0 0 1 66 D 0 22 438 0 0 835 0 0 1 64 D 0 22 439 0 0 832 0 0 1 64 D 0 22 440 0 0 837 0 0 1 67 0 33.89 72.51 140.68 43.79 190.79 22 441 0 0 1217 0 0 1 54 0 29.36 45.12 113.97 35.65 231.20 22 442 0 0 1342 0 0 2 42 0 A 38.78 98.03 167.16 49.18 201.72 22 657 432 434 975 658 658 1 63 D 0 22 658 432 434 837 0 0 2 68 0 32.77 82.01 147.75 41.02 192.03 22 659 430 431 975 660 660 2 62 D 0 22 660 430 431 835 661 661 2 67 D 0 22 661 430 431 832 0 0 2 73 0 A 35.36 90.09 138.94 43.77 146.45 22 662 428 429 831 663 663 2 70 D 0 22 663 428 429 0 0 0 1 70 0 A 31.87 90.02 133.74 44.02 209.99 22 664 433 435 839 665 665 2 58 D 0 22 665 433 435 1218 666 666 1 72 0 29.79 84.30 150.41 41.96 207.06 22 666 433 435 0 0 0 2 56 0 24.95 67.02 140.02 41.10 240.56 22 831 436 662 1218 0 0 2 62 D 0 22 832 439 661 0 833 833 1 52 0 33.00 58.91 160.86 35.25 232.26 22 833 439 661 0 834 834 1 50 0 30.43 71.17 120.97 41.58 193.52 22 834 439 661 0 0 0 1 30 0 26.92 56.71 167.81 37.13 478.67 22 835 438 660 0 836 836 1 51 0 30.49 79.17 139.98 45.23 307.71 22 836 438 660 0 0 0 1 43 0 29.70 66.77 164.43 41.76 385.05 22 837 440 658 0 838 838 2 36 0 27.22 48.99 128.90 39.07 249.66 22 838 440 658 0 0 0 2 31 0 25.74 58.71 140.75 42.49 348.39 22 839 437 664 0 0 0 2 59 0 31.44 79.60 154.81 36.95 226.68 22 975 657 659 1217 976 976 2 32 D 0 22 976 657 659 1454 977 977 1 47 1 16.19 63.87 113.92 39.85 264.44 22 977 657 659 1342 978 978 1 42 0 29.89 47.11 113.25 33.78 279.82 22 978 657 659 0 0 0 2 38 0 29.06 49.96 108.00 28.65 152.82 22 1217 441 975 0 0 0 2 27 0 34.61 57.29 133.04 39.70 391.61 22 1218 665 831 0 1219 1219 2 45 0 34.99 64.51 149.14 43.26 220.32 22 1219 665 831 1454 1220 1220 2 43 0 23.79 55.65 124.59 38.58 168.47 22 1220 665 831 0 1221 1221 2 39 0 36.75 57.57 115.45 37.06 232.42 22 1221 665 831 0 0 0 1 27 0 39.04 87.18 131.62 51.41 300.29 22 1342 977 442 0 0 0 2 20 0 30.21 61.33 146.89 43.22 299.58 22 1454 976 1219 0 1455 1455 2 27 0 39.31 61.11 147.74 48.64 227.56 22 1455 976 1219 0 1456 1456 2 19 0 33.95 69.80 122.99 47.06 301.81 22 1456 976 1219 0 0 0 1 17 0 38.36 69.94 142.45 46.01 227.58 23 443 0 0 669 0 0 1 58 D 0 23 444 0 0 669 0 0 2 70 D 0 23 445 0 0 667 0 0 1 63 D 0 23 446 0 0 667 0 0 2 72 D 0 23 447 0 0 676 0 0 1 75 D 0 23 448 0 0 676 0 0 2 80 D 0 23 449 0 0 983 0 0 2 48 D 0 23 450 0 0 671 0 0 1 73 D 0 23 451 0 0 671 0 0 2 54 D 0 23 452 0 0 840 0 0 1 75 D 0 23 453 0 0 979 0 0 2 60 D 0 23 454 0 0 842 0 0 1 76 0 41.19 75.98 147.64 41.53 212.13 23 455 0 0 985 0 0 2 59 0 29.02 52.06 98.26 34.94 253.80 23 456 0 0 1349 0 0 2 58 0 A 39.65 96.70 161.99 48.67 251.10 23 457 0 0 1451 0 0 1 48 0 21.16 49.39 141.00 32.94 275.58 23 458 0 0 1450 0 0 1 43 0 25.54 68.17 121.26 39.17 161.02 23 459 0 0 1453 0 0 1 39 0 23.93 61.17 126.01 37.53 368.25 23 667 445 446 984 668 668 2 70 D 0 23 668 445 446 979 0 0 1 67 D 0 23 669 443 444 983 670 670 1 80 D 0 23 670 443 444 984 0 0 1 68 D 0 23 671 450 451 842 672 672 2 73 0 30.92 70.09 150.53 39.51 261.72 23 672 450 451 1343 673 673 2 69 0 39.03 87.11 164.34 43.96 273.30 23 673 450 451 0 674 674 1 67 0 A 28.47 93.81 179.08 52.02 337.83 23 674 450 451 985 675 675 1 62 0 22.11 51.29 156.01 33.50 220.52 23 675 450 451 0 0 0 1 49 0 36.35 67.85 140.20 44.25 218.20 23 676 447 448 840 677 677 2 77 D 0 23 677 447 448 0 0 0 2 78 0 A 29.10 89.64 153.73 44.32 249.49 23 840 452 676 1343 841 841 1 68 0 A 28.80 95.69 133.14 41.72 267.41 23 841 452 676 1349 0 0 1 21 D 0 23 842 454 671 0 843 843 2 38 0 31.10 64.22 138.44 38.53 376.41 23 843 454 671 0 0 0 1 35 0 33.37 68.20 156.89 41.63 408.88 23 979 668 453 0 980 980 1 62 0 35.77 74.91 134.19 41.32 177.03 23 980 668 453 0 981 981 1 59 0 28.08 79.53 128.92 38.49 163.73 23 981 668 453 0 982 982 2 54 0 27.42 63.36 136.10 37.00 256.91 23 982 668 453 0 0 0 1 53 0 26.72 82.14 161.80 41.38 282.96 23 983 669 449 0 0 0 2 70 0 23.60 52.63 157.19 36.15 298.26 23 984 670 667 1457 0 0 1 49 0 32.99 65.48 160.91 41.50 277.93 23 985 674 455 0 986 986 1 28 0 28.70 49.98 125.18 35.27 319.42 23 986 674 455 0 0 0 2 27 0 29.28 50.36 143.07 41.36 244.13 23 1343 840 672 0 1344 1344 2 47 0 37.05 86.06 152.19 44.01 282.37 23 1344 840 672 1457 1345 1345 2 46 1 21.45 69.51 123.56 34.32 268.76 23 1345 840 672 1451 1346 1346 2 45 0 33.58 54.77 145.37 40.37 256.35 23 1346 840 672 0 1347 1347 1 42 0 30.57 72.78 143.29 41.84 250.86 23 1347 840 672 1450 1348 1348 2 40 0 34.03 81.23 125.47 46.08 265.06 23 1348 840 672 1453 0 0 2 37 0 37.45 77.31 133.00 41.12 331.30 23 1349 841 456 0 0 0 2 34 0 28.03 68.34 151.41 40.60 305.83 23 1450 458 1347 0 0 0 1 19 0 33.35 79.38 130.27 43.40 306.21 23 1451 457 1345 0 1452 1452 2 24 0 A 37.50 88.05 175.30 48.12 381.94 23 1452 457 1345 0 0 0 1 16 0 33.30 60.67 161.72 41.73 343.53 23 1453 459 1348 0 0 0 1 16 0 28.38 70.76 150.47 38.68 466.21 23 1457 984 1344 0 1458 1458 2 26 0 35.36 73.67 134.83 39.68 239.16 23 1458 984 1344 0 1459 1459 2 24 0 27.56 86.78 187.13 36.84 372.86 23 1459 984 1344 0 0 0 1 22 0 19.34 44.36 120.65 35.21 405.81 loki/data/jvped0100644000076500007650000000064407505605537012757 0ustar heathheath 1 * * * * * * * * 2 * * * * * * * * 2 * * * * * * * * 4 1 2 * * * * * * 5 1 2 * * * * * * 6 * * 1.32 * * * * 1 7 1 2 * * * * * * 8 * * 0.65 * * * * 2 9 3 4 0.32 A C * * 1 10 5 6 * * * * * * 11 5 6 1.72 C D 112 116 1 12 7 8 2.01 B C 118 118 2 13 9 10 0.90 * * 118 116 1 14 11 12 0.91 C D 118 112 1 15 13 14 1.01 C C 118 116 2 loki/data/jvped10100644000076500007650000000027307445627300013031 0ustar heathheath4 1 2 5 1 2 6 * * 1.32 7 1 2 8 * * 0.65 9 3 4 0.32 A C 10 5 6 11 5 6 1.72 C D 112 116 12 7 8 2.01 B C 118 118 13 9 10 0.90 * * 118 116 14 11 12 0.91 C D 118 112 15 13 14 1.01 C C 118 116 loki/docs/0040755000076500007650000000000007646772450011747 5ustar heathheathloki/docs/docfig1.eps0100644000076500007650000020345307557300064013765 0ustar heathheath%!PS-Adobe-2.0 EPSF-2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: ibd_coeff.dvi %%BoundingBox: 60 268 549 593 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -E -o docfig1.eps ibd_coeff %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2002.10.28:1313 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr 1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B /chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ /cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 {2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ 1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X 1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) (LaserWriter 16/600)]{A length product length le{A length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end %%EndProcSet %%BeginProcSet: pstricks.pro %! % PostScript prologue for pstricks.tex. % Version 97 patch 3, 98/06/01 % For distribution, see pstricks.tex. % /tx@Dict 200 dict def tx@Dict begin /ADict 25 dict def /CM { matrix currentmatrix } bind def /SLW /setlinewidth load def /CLW /currentlinewidth load def /CP /currentpoint load def /ED { exch def } bind def /L /lineto load def /T /translate load def /TMatrix { } def /RAngle { 0 } def /Atan { /atan load stopped { pop pop 0 } if } def /Div { dup 0 eq { pop } { div } ifelse } def /NET { neg exch neg exch T } def /Pyth { dup mul exch dup mul add sqrt } def /PtoC { 2 copy cos mul 3 1 roll sin mul } def /PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def /PathLength { flattenpath /z 0 def { /y1 ED /x1 ED /y2 y1 def /x2 x1 def } { /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ } /pathforall load stopped { pop pop pop pop } if z } def /STP { .996264 dup scale } def /STV { SDict begin normalscale end STP } def /DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul /y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ] 0 } ifelse setdash stroke } def /DotLine { /b PathLength def /a ED /z ED /y CLW def /z y z add def a 0 gt { /b b a div def } { a 0 eq { /b b y sub def } { a -3 eq { /b b y add def } if } ifelse } ifelse [ 0 b b z Div round Div dup 0 le { pop 1 } if ] a 0 gt { 0 } { y 2 div a -2 gt { neg } if } ifelse setdash 1 setlinecap stroke } def /LineFill { gsave abs CLW add /a ED a 0 dtransform round exch round exch 2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25 % DG/SR modification begin - Dec. 12, 1997 - Patch 2 %itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a % DG/SR modification end Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict /setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1 % DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) % a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore } % def a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore pop pop } def % DG/SR modification end /BeginArrow { ADict begin /@mtrx CM def gsave 2 copy T 2 index sub neg exch 3 index sub exch Atan rotate newpath } def /EndArrow { @mtrx setmatrix CP grestore end } def /Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1 scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto gsave fill grestore } def /Tbar { CLW mul add /z ED z -2 div CLW 2 div moveto z 0 rlineto stroke 0 CLW moveto } def /Bracket { CLW mul add dup CLW sub 2 div /x ED mul CLW add /y ED /z CLW 2 div def x neg y moveto x neg CLW 2 div L x CLW 2 div L x y L stroke 0 CLW moveto } def /RoundBracket { CLW mul add dup 2 div /x ED mul /y ED /mtrx CM def 0 CLW 2 div T x y mul 0 ne { x y scale } if 1 1 moveto .85 .5 .35 0 0 0 curveto -.35 0 -.85 .5 -1 1 curveto mtrx setmatrix stroke 0 CLW moveto } def /SD { 0 360 arc fill } def /EndDot { { /z DS def } { /z 0 def } ifelse /b ED 0 z DS SD b { 0 z DS CLW sub SD } if 0 DS z add CLW 4 div sub moveto } def /Shadow { [ { /moveto load } { /lineto load } { /curveto load } { /closepath load } /pathforall load stopped { pop pop pop pop CP /moveto load } if ] cvx newpath 3 1 roll T exec } def /NArray { aload length 2 div dup dup cvi eq not { exch pop } if /n exch cvi def } def /NArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def /Line { NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def n { Lineto } repeat CP 4 2 roll ArrowB L pop pop } if } def /Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 } ifelse { pop } repeat a } def /CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq and { pop pop /n n 1 sub def } if } def /Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1 ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1 moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto Lineto pop pop closepath } ifelse } def /Diamond { /mtrx CM def T rotate /h ED /w ED dup 0 eq { pop } { CLW mul neg /d ED /a w h Atan def /h d a sin Div h add def /w d a cos Div w add def } ifelse mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 div /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx setmatrix } def % DG modification begin - Jan. 15, 1997 %/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq { %pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 %div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0 %d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx %setmatrix } def /Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 div dup cos exch sin Div mul sub def mark 0 d w neg d 0 h w d 0 d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx % DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) % setmatrix } def setmatrix pop } def % DG/SR modification end /CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth def } def /CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth def } def /CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1 def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def /y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul m mul neg def } def /IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def } def /BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def /NC { CC x1 y1 x2 y2 x y curveto } def /EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def /BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def /NAC { x2 y2 x y curveto CC x1 y1 } def /EAC { x2 y2 x y ArrowB curveto pop pop } def /OpenCurve { NArray n 3 lt { n { pop pop } repeat } { BOC /n n 3 sub def n { NC } repeat EOC } ifelse } def /AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload /Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def /ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt { CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC } repeat closepath pop pop } ifelse } def /SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def /ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def /SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } def /FontDot { DS 2 mul dup matrix scale matrix concatmatrix exch matrix rotate matrix concatmatrix exch findfont exch makefont setfont } def /Rect { x1 y1 y2 add 2 div moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto x1 y1 lineto closepath } def /OvalFrame { x1 x2 eq y1 y2 eq or { pop pop x1 y1 moveto x2 y2 L } { y1 y2 sub abs x1 x2 sub abs 2 copy gt { exch pop } { pop } ifelse 2 div exch { dup 3 1 roll mul exch } if 2 copy lt { pop } { exch pop } ifelse /b ED x1 y1 y2 add 2 div moveto x1 y2 x2 y2 b arcto x2 y2 x2 y1 b arcto x2 y1 x1 y1 b arcto x1 y1 x1 y2 b arcto 16 { pop } repeat closepath } ifelse } def /Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add /y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq { pop pop Rect } { OvalFrame } ifelse } def /BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def /OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto } ifelse } def /ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def /BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1 sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore } def /Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1 sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0 y0 x0 2 mul x1 sub y1 ] def } def /Grid { newpath /a 4 string def /b ED /c ED /n ED cvi dup 1 lt { pop 1 } if /s ED s div dup 0 eq { pop 1 } if /dy ED s div dup 0 eq { pop 1 } if /dx ED dy div round dy mul /y0 ED dx div round dx mul /x0 ED dy div round cvi /y2 ED dx div round cvi /x2 ED dy div round cvi /y1 ED dx div round cvi /x1 ED /h y2 y1 sub 0 gt { 1 } { -1 } ifelse def /w x2 x1 sub 0 gt { 1 } { -1 } ifelse def b 0 gt { /z1 b 4 div CLW 2 div add def /Helvetica findfont b scalefont setfont /b b .95 mul CLW 2 div add def } if systemdict /setstrokeadjust known { true setstrokeadjust /t { } def } { /t { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add exch itransform } bind def } ifelse gsave n 0 gt { 1 setlinecap [ 0 dy n div ] dy n div 2 div setdash } { 2 setlinecap } ifelse /i x1 def /f y1 dy mul n 0 gt { dy n div 2 div h mul sub } if def /g y2 dy mul n 0 gt { dy n div 2 div h mul add } if def x2 x1 sub w mul 1 add dup 1000 gt { pop 1000 } if { i dx mul dup y0 moveto b 0 gt { gsave c i a cvs dup stringwidth pop /z2 ED w 0 gt {z1} {z1 z2 add neg} ifelse h 0 gt {b neg} {z1} ifelse rmoveto show grestore } if dup t f moveto g t L stroke /i i w add def } repeat grestore gsave n 0 gt % DG/SR modification begin - Nov. 7, 1997 - Patch 1 %{ 1 setlinecap [ 0 dx n div ] dy n div 2 div setdash } { 1 setlinecap [ 0 dx n div ] dx n div 2 div setdash } % DG/SR modification end { 2 setlinecap } ifelse /i y1 def /f x1 dx mul n 0 gt { dx n div 2 div w mul sub } if def /g x2 dx mul n 0 gt { dx n div 2 div w mul add } if def y2 y1 sub h mul 1 add dup 1000 gt { pop 1000 } if { newpath i dy mul dup x0 exch moveto b 0 gt { gsave c i a cvs dup stringwidth pop /z2 ED w 0 gt {z1 z2 add neg} {z1} ifelse h 0 gt {z1} {b neg} ifelse rmoveto show grestore } if dup f exch t moveto g exch t L stroke /i i h add def } repeat grestore } def /ArcArrow { /d ED /b ED /a ED gsave newpath 0 -1000 moveto clip newpath 0 1 0 0 b grestore c mul /e ED pop pop pop r a e d PtoC y add exch x add exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c mul neg d } def /Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def /Rot { CP CP translate 3 -1 roll neg rotate NET } def /RotBegin { tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } def } if /TMatrix [ TMatrix CM ] cvx def /a ED a Rot /RAngle [ RAngle dup a add ] cvx def } def /RotEnd { /TMatrix [ TMatrix setmatrix ] cvx def /RAngle [ RAngle pop ] cvx def } def /PutCoor { gsave CP T CM STV exch exec moveto setmatrix CP grestore } def /PutBegin { /TMatrix [ TMatrix CM ] cvx def CP 4 2 roll T moveto } def /PutEnd { CP /TMatrix [ TMatrix setmatrix ] cvx def moveto } def /Uput { /a ED add 2 div /h ED 2 div /w ED /s a sin def /c a cos def /b s abs c abs 2 copy gt dup /q ED { pop } { exch pop } ifelse def /w1 c b div w mul def /h1 s b div h mul def q { w1 abs w sub dup c mul abs } { h1 abs h sub dup s mul abs } ifelse } def /UUput { /z ED abs /y ED /x ED q { x s div c mul abs y gt } { x c div s mul abs y gt } ifelse { x x mul y y mul sub z z mul add sqrt z add } { q { x s div } { x c div } ifelse abs } ifelse a PtoC h1 add exch w1 add exch } def /BeginOL { dup (all) eq exch TheOL eq or { IfVisible not { Visible /IfVisible true def } if } { IfVisible { Invisible /IfVisible false def } if } ifelse } def /InitOL { /OLUnit [ 3000 3000 matrix defaultmatrix dtransform ] cvx def /Visible { CP OLUnit idtransform T moveto } def /Invisible { CP OLUnit neg exch neg exch idtransform T moveto } def /BOL { BeginOL } def /IfVisible true def } def end % END pstricks.pro %%EndProcSet %%BeginProcSet: pst-dots.pro %!PS-Adobe-2.0 %%Title: Dot Font for PSTricks 97 - Version 97, 93/05/07. %%Creator: Timothy Van Zandt %%Creation Date: May 7, 1993 10 dict dup begin /FontType 3 def /FontMatrix [ .001 0 0 .001 0 0 ] def /FontBBox [ 0 0 0 0 ] def /Encoding 256 array def 0 1 255 { Encoding exch /.notdef put } for Encoding dup (b) 0 get /Bullet put dup (c) 0 get /Circle put dup (C) 0 get /BoldCircle put dup (u) 0 get /SolidTriangle put dup (t) 0 get /Triangle put dup (T) 0 get /BoldTriangle put dup (r) 0 get /SolidSquare put dup (s) 0 get /Square put dup (S) 0 get /BoldSquare put dup (q) 0 get /SolidPentagon put dup (p) 0 get /Pentagon put (P) 0 get /BoldPentagon put /Metrics 13 dict def Metrics begin /Bullet 1000 def /Circle 1000 def /BoldCircle 1000 def /SolidTriangle 1344 def /Triangle 1344 def /BoldTriangle 1344 def /SolidSquare 886 def /Square 886 def /BoldSquare 886 def /SolidPentagon 1093.2 def /Pentagon 1093.2 def /BoldPentagon 1093.2 def /.notdef 0 def end /BBoxes 13 dict def BBoxes begin /Circle { -550 -550 550 550 } def /BoldCircle /Circle load def /Bullet /Circle load def /Triangle { -571.5 -330 571.5 660 } def /BoldTriangle /Triangle load def /SolidTriangle /Triangle load def /Square { -450 -450 450 450 } def /BoldSquare /Square load def /SolidSquare /Square load def /Pentagon { -546.6 -465 546.6 574.7 } def /BoldPentagon /Pentagon load def /SolidPentagon /Pentagon load def /.notdef { 0 0 0 0 } def end /CharProcs 20 dict def CharProcs begin /Adjust { 2 copy dtransform floor .5 add exch floor .5 add exch idtransform 3 -1 roll div 3 1 roll exch div exch scale } def /CirclePath { 0 0 500 0 360 arc closepath } def /Bullet { 500 500 Adjust CirclePath fill } def /Circle { 500 500 Adjust CirclePath .9 .9 scale CirclePath eofill } def /BoldCircle { 500 500 Adjust CirclePath .8 .8 scale CirclePath eofill } def /BoldCircle { CirclePath .8 .8 scale CirclePath eofill } def /TrianglePath { 0 660 moveto -571.5 -330 lineto 571.5 -330 lineto closepath } def /SolidTriangle { TrianglePath fill } def /Triangle { TrianglePath .85 .85 scale TrianglePath eofill } def /BoldTriangle { TrianglePath .7 .7 scale TrianglePath eofill } def /SquarePath { -450 450 moveto 450 450 lineto 450 -450 lineto -450 -450 lineto closepath } def /SolidSquare { SquarePath fill } def /Square { SquarePath .89 .89 scale SquarePath eofill } def /BoldSquare { SquarePath .78 .78 scale SquarePath eofill } def /PentagonPath { -337.8 -465 moveto 337.8 -465 lineto 546.6 177.6 lineto 0 574.7 lineto -546.6 177.6 lineto closepath } def /SolidPentagon { PentagonPath fill } def /Pentagon { PentagonPath .89 .89 scale PentagonPath eofill } def /BoldPentagon { PentagonPath .78 .78 scale PentagonPath eofill } def /.notdef { } def end /BuildGlyph { exch begin Metrics 1 index get exec 0 BBoxes 3 index get exec setcachedevice CharProcs begin load exec end end } def /BuildChar { 1 index /Encoding get exch get 1 index /BuildGlyph get exec } bind def end /PSTricksDotFont exch definefont pop % END pst-dots.pro %%EndProcSet %%BeginProcSet: pst-node.pro %! % PostScript prologue for pst-node.tex. % Version 97 patch 1, 97/05/09. % For distribution, see pstricks.tex. % /tx@NodeDict 400 dict def tx@NodeDict begin tx@Dict begin /T /translate load def end /NewNode { gsave /next ED dict dup 3 1 roll def exch { dup 3 1 roll def } if begin tx@Dict begin STV CP T exec end /NodeMtrx CM def next end grestore } def /InitPnode { /Y ED /X ED /NodePos { NodeSep Cos mul NodeSep Sin mul } def } def /InitCnode { /r ED /Y ED /X ED /NodePos { NodeSep r add dup Cos mul exch Sin mul } def } def /GetRnodePos { Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def } ifelse Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def } ifelse dx Sin mul abs dy Cos mul abs gt { dy Cos mul Sin div dy } { dx dup Sin mul Cos Div } ifelse } def /InitRnode { /Y ED /X ED X sub /r ED /l X neg def Y add neg /d ED Y sub /u ED /NodePos { GetRnodePos } def } def /DiaNodePos { w h mul w Sin mul abs h Cos mul abs add Div NodeSep add dup Cos mul exch Sin mul } def /TriNodePos { Sin s lt { d NodeSep sub dup Cos mul Sin Div exch } { w h mul w Sin mul h Cos abs mul add Div NodeSep add dup Cos mul exch Sin mul } ifelse } def /InitTriNode { sub 2 div exch 2 div exch 2 copy T 2 copy 4 index index /d ED pop pop pop pop -90 mul rotate /NodeMtrx CM def /X 0 def /Y 0 def d sub abs neg /d ED d add /h ED 2 div h mul h d sub Div /w ED /s d w Atan sin def /NodePos { TriNodePos } def } def /OvalNodePos { /ww w NodeSep add def /hh h NodeSep add def Sin ww mul Cos hh mul Atan dup cos ww mul exch sin hh mul } def /GetCenter { begin X Y NodeMtrx transform CM itransform end } def /XYPos { dup sin exch cos Do /Cos ED /Sin ED /Dist ED Cos 0 gt { Dist Dist Sin mul Cos div } { Cos 0 lt { Dist neg Dist Sin mul Cos div neg } { 0 Dist Sin mul } ifelse } ifelse Do } def /GetEdge { dup 0 eq { pop begin 1 0 NodeMtrx dtransform CM idtransform exch atan sub dup sin /Sin ED cos /Cos ED /NodeSep ED NodePos NodeMtrx dtransform CM idtransform end } { 1 eq {{exch}} {{}} ifelse /Do ED pop XYPos } ifelse } def /AddOffset { 1 index 0 eq { pop pop } { 2 copy 5 2 roll cos mul add 4 1 roll sin mul sub exch } ifelse } def /GetEdgeA { NodeSepA AngleA NodeA NodeSepTypeA GetEdge OffsetA AngleA AddOffset yA add /yA1 ED xA add /xA1 ED } def /GetEdgeB { NodeSepB AngleB NodeB NodeSepTypeB GetEdge OffsetB AngleB AddOffset yB add /yB1 ED xB add /xB1 ED } def /GetArmA { ArmTypeA 0 eq { /xA2 ArmA AngleA cos mul xA1 add def /yA2 ArmA AngleA sin mul yA1 add def } { ArmTypeA 1 eq {{exch}} {{}} ifelse /Do ED ArmA AngleA XYPos OffsetA AngleA AddOffset yA add /yA2 ED xA add /xA2 ED } ifelse } def /GetArmB { ArmTypeB 0 eq { /xB2 ArmB AngleB cos mul xB1 add def /yB2 ArmB AngleB sin mul yB1 add def } { ArmTypeB 1 eq {{exch}} {{}} ifelse /Do ED ArmB AngleB XYPos OffsetB AngleB AddOffset yB add /yB2 ED xB add /xB2 ED } ifelse } def /InitNC { /b ED /a ED /NodeSepTypeB ED /NodeSepTypeA ED /NodeSepB ED /NodeSepA ED /OffsetB ED /OffsetA ED tx@NodeDict a known tx@NodeDict b known and dup { /NodeA a load def /NodeB b load def NodeA GetCenter /yA ED /xA ED NodeB GetCenter /yB ED /xB ED } if } def /LPutLine { 4 copy 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED 1 t sub mul 3 1 roll 1 t sub mul 4 1 roll t mul add /Y ED t mul add /X ED } def /LPutLines { mark LPutVar counttomark 2 div 1 sub /n ED t floor dup n gt { pop n 1 sub /t 1 def } { dup t sub neg /t ED } ifelse cvi 2 mul { pop } repeat LPutLine cleartomark } def /BezierMidpoint { /y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED /y0 ED /x0 ED /t ED /cx x1 x0 sub 3 mul def /cy y1 y0 sub 3 mul def /bx x2 x1 sub 3 mul cx sub def /by y2 y1 sub 3 mul cy sub def /ax x3 x0 sub cx sub bx sub def /ay y3 y0 sub cy sub by sub def ax t 3 exp mul bx t t mul mul add cx t mul add x0 add ay t 3 exp mul by t t mul mul add cy t mul add y0 add 3 ay t t mul mul mul 2 by t mul mul add cy add 3 ax t t mul mul mul 2 bx t mul mul add cx add atan /NAngle ED /Y ED /X ED } def /HPosBegin { yB yA ge { /t 1 t sub def } if /Y yB yA sub t mul yA add def } def /HPosEnd { /X Y yyA sub yyB yyA sub Div xxB xxA sub mul xxA add def /NAngle yyB yyA sub xxB xxA sub Atan def } def /HPutLine { HPosBegin /yyA ED /xxA ED /yyB ED /xxB ED HPosEnd } def /HPutLines { HPosBegin yB yA ge { /check { le } def } { /check { ge } def } ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { dup Y check { exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark HPosEnd } def /VPosBegin { xB xA lt { /t 1 t sub def } if /X xB xA sub t mul xA add def } def /VPosEnd { /Y X xxA sub xxB xxA sub Div yyB yyA sub mul yyA add def /NAngle yyB yyA sub xxB xxA sub Atan def } def /VPutLine { VPosBegin /yyA ED /xxA ED /yyB ED /xxB ED VPosEnd } def /VPutLines { VPosBegin xB xA ge { /check { le } def } { /check { ge } def } ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { 1 index X check { exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark VPosEnd } def /HPutCurve { gsave newpath /SaveLPutVar /LPutVar load def LPutVar 8 -2 roll moveto curveto flattenpath /LPutVar [ {} {} {} {} pathforall ] cvx def grestore exec /LPutVar /SaveLPutVar load def } def /NCCoor { /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 xA1 yA1 ] cvx def /LPutPos { LPutVar LPutLine } def /HPutPos { LPutVar HPutLine } def /VPutPos { LPutVar VPutLine } def LPutVar } def /NCLine { NCCoor tx@Dict begin ArrowA CP 4 2 roll ArrowB lineto pop pop end } def /NCLines { false NArray n 0 eq { NCLine } { 2 copy yA sub exch xA sub Atan /AngleA ED n 2 mul dup index exch index yB sub exch xB sub Atan /AngleB ED GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 n 2 mul 4 add 4 roll xA1 yA1 ] cvx def mark LPutVar tx@Dict begin false Line end /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } ifelse } def /NCCurve { GetEdgeA GetEdgeB xA1 xB1 sub yA1 yB1 sub Pyth 2 div dup 3 -1 roll mul /ArmA ED mul /ArmB ED /ArmTypeA 0 def /ArmTypeB 0 def GetArmA GetArmB xA2 yA2 xA1 yA1 tx@Dict begin ArrowA end xB2 yB2 xB1 yB1 tx@Dict begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines } HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def /NCAngles { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def xA2 yA2 mtrx transform pop xB2 yB2 mtrx transform exch pop mtrx itransform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCAngle { GetEdgeA GetEdgeB GetArmB /mtrx AngleA matrix rotate def xB2 yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA1 yA1 tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCBar { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def xA2 yA2 mtrx itransform pop xB2 yB2 mtrx itransform pop sub dup 0 mtrx transform 3 -1 roll 0 gt { /yB2 exch yB2 add def /xB2 exch xB2 add def } { /yA2 exch neg yA2 add def /xA2 exch neg xA2 add def } ifelse mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCDiag { GetEdgeA GetEdgeB GetArmA GetArmB mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCDiagg { GetEdgeA GetArmA yB yA2 sub xB xA2 sub Atan 180 add /AngleB ED GetEdgeB mark xB1 yB1 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCLoop { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def xA2 yA2 mtrx transform loopsize add /yA3 ED /xA3 ED /xB3 xB2 yB2 mtrx transform pop def xB3 yA3 mtrx itransform /yB3 ED /xB3 ED xA3 yA3 mtrx itransform /yA3 ED /xA3 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def % DG/SR modification begin - May 9, 1997 - Patch 1 %/NCCircle { 0 0 NodesepA nodeA \tx@GetEdge pop xA sub 2 div dup 2 exp r %r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add %exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 %mul add dup 5 1 roll 90 sub \tx@PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED /NCCircle { NodeSepA 0 NodeA 0 GetEdge pop 2 div dup 2 exp r r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 mul add dup 5 1 roll 90 sub PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED % DG/SR modification end } def /HPutPos { LPutPos } def /VPutPos { LPutPos } def r AngleA 90 sub a add AngleA 270 add a sub tx@Dict begin /angleB ED /angleA ED /r ED /c 57.2957 r Div def /y ED /x ED } def /NCBox { /d ED /h ED /AngleB yB yA sub xB xA sub Atan def /AngleA AngleB 180 add def GetEdgeA GetEdgeB /dx d AngleB sin mul def /dy d AngleB cos mul neg def /hx h AngleB sin mul neg def /hy h AngleB cos mul def /LPutVar [ xA1 hx add yA1 hy add xB1 hx add yB1 hy add xB1 dx add yB1 dy add xA1 dx add yA1 dy add ] cvx def /LPutPos { LPutLines } def /HPutPos { xB yB xA yA LPutLine } def /VPutPos { HPutPos } def mark LPutVar tx@Dict begin false Polygon end } def /NCArcBox { /l ED neg /d ED /h ED /a ED /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def /tA AngleA a sub 90 add def /tB tA a 2 mul add def /r xB xA sub tA cos tB cos sub Div dup 0 eq { pop 1 } if def /x0 xA r tA cos mul add def /y0 yA r tA sin mul add def /c 57.2958 r div def /AngleA AngleA a sub 180 add def /AngleB AngleB a add 180 add def GetEdgeA GetEdgeB /AngleA tA 180 add yA yA1 sub xA xA1 sub Pyth c mul sub def /AngleB tB 180 add yB yB1 sub xB xB1 sub Pyth c mul add def l 0 eq { x0 y0 r h add AngleA AngleB arc x0 y0 r d add AngleB AngleA arcn } { x0 y0 translate /tA AngleA l c mul add def /tB AngleB l c mul sub def 0 0 r h add tA tB arc r h add AngleB PtoC r d add AngleB PtoC 2 copy 6 2 roll l arcto 4 { pop } repeat r d add tB PtoC l arcto 4 { pop } repeat 0 0 r d add tB tA arcn r d add AngleA PtoC r h add AngleA PtoC 2 copy 6 2 roll l arcto 4 { pop } repeat r h add tA PtoC l arcto 4 { pop } repeat } ifelse closepath /LPutVar [ x0 y0 r AngleA AngleB h d ] cvx def /LPutPos { LPutVar /d ED /h ED /AngleB ED /AngleA ED /r ED /y0 ED /x0 ED t 1 le { r h add AngleA 1 t sub mul AngleB t mul add dup 90 add /NAngle ED PtoC } { t 2 lt { /NAngle AngleB 180 add def r 2 t sub h mul t 1 sub d mul add add AngleB PtoC } { t 3 lt { r d add AngleB 3 t sub mul AngleA 2 t sub mul add dup 90 sub /NAngle ED PtoC } { /NAngle AngleA 180 add def r 4 t sub d mul t 3 sub h mul add add AngleA PtoC } ifelse } ifelse } ifelse y0 add /Y ED x0 add /X ED } def /HPutPos { LPutPos } def /VPutPos { LPutPos } def } def /Tfan { /AngleA yB yA sub xB xA sub Atan def GetEdgeA w xA1 xB sub yA1 yB sub Pyth Pyth w Div CLW 2 div mul 2 div dup AngleA sin mul yA1 add /yA1 ED AngleA cos mul xA1 add /xA1 ED /LPutVar [ xA1 yA1 m { xB w add yB xB w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos { LPutLines } def /VPutPos@ { LPutVar flag { 8 4 roll pop pop pop pop } { pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine } def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin /ArrowA { moveto } def /ArrowB { } def false Line closepath end } def /LPutCoor { NAngle tx@Dict begin /NAngle ED end gsave CM STV CP Y sub neg exch X sub neg exch moveto setmatrix CP grestore } def /LPut { tx@NodeDict /LPutPos known { LPutPos } { CP /Y ED /X ED /NAngle 0 def } ifelse LPutCoor } def /HPutAdjust { Sin Cos mul 0 eq { 0 } { d Cos mul Sin div flag not { neg } if h Cos mul Sin div flag { neg } if 2 copy gt { pop } { exch pop } ifelse } ifelse s add flag { r add neg } { l add } ifelse X add /X ED } def /VPutAdjust { Sin Cos mul 0 eq { 0 } { l Sin mul Cos div flag { neg } if r Sin mul Cos div flag not { neg } if 2 copy gt { pop } { exch pop } ifelse } ifelse s add flag { d add } { h add neg } ifelse Y add /Y ED } def end % END pst-node.pro %%EndProcSet %%BeginProcSet: special.pro %! TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N /vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N /rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N /@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{ /hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B /@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{ /urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known {userdict/md get type/dicttype eq{userdict begin md length 10 add md maxlength ge{/md md dup length 20 add dict copy def}if end md begin /letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{ itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack} if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{ noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{ Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale }if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState save N userdict maxlength dict begin/magscale true def normalscale currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts /psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR/showpage{}N/erasepage{}N/copypage{}N/p 3 def @MacSetUp}N/doclip{ psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath moveto}N/endTexFig{end psf$SavedState restore}N/@beginspecial{SDict begin/SpecialSave save N gsave normalscale currentpoint TR @SpecialDefaults count/ocount X/dcount countdictstack N}N/@setspecial{ CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR }{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto closepath clip}if/showpage{}N/erasepage{}N/copypage{}N newpath}N /@endspecial{count ocount sub{pop}repeat countdictstack dcount sub{end} repeat grestore SpecialSave restore end}N/@defspecial{SDict begin}N /@fedspecial{end}B/li{lineto}B/rl{rlineto}B/rc{rcurveto}B/np{/SaveX currentpoint/SaveY X N 1 setlinecap newpath}N/st{stroke SaveX SaveY moveto}N/fil{fill SaveX SaveY moveto}N/ellipse{/endangle X/startangle X /yrad X/xrad X/savematrix matrix currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix}N end %%EndProcSet TeXDict begin 40258437 52099154 1000 600 600 (ibd_coeff.dvi) @start %DVIPSBitmapFont: Fa lcmss8 12 9 /Fa 9 58 df<140F4A7E143F14FF1303131F0007B5FC127FB6FCA25BEA7FF0EA3C00C7FC B3B3AD003FB612FE4815FFA46C15FE284475C33E>49 DIII<48B712F848825AA45F01F8CAFCB0EC07FF027F13F001F9B5 12FC90B7FC8383DAFC037F9139C0007FF091C7EA1FF8496E7E01F86E7EA26C486E7E6C5A C96C1380A37013C0A95E1880120C001C5D003E1700007F5D486C5D6D140F01F04A5A6C6C EC7FF86CB449485A6CD9E00F5B000790B65A6C5E6C4BC7FC6C6C5C011F14F00103148090 26003FF8C8FC32447BC13E>II<007FB812 C0B912E0A56C1780C9000113004C5A4C5A4C5A4C5A4C5A4C5A4C5A5D94C7FC4B5A4B5A4B 5AA24B5A4B5AA24B5A4B5AA24A90C8FCA24A5AA24A5AA24A5AA34A5AA24A5AA34A5AA314 FF5DA44990C9FCA65B5CAA6D5A33437BC13E>III E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fb cmmi8 16.59 1 /Fb 1 84 df<942603FFC01460053F01FC14F04CB6EA800104079238E003E0041FEDF007 933B7FFE007FF80FDCFFF090380FFC1F4B0180D901FE13C0DB07FEC8EA7F3F4B48ED3FFF DB1FF0814B486F13804B48814B5A4A90C97E4B180014034A48825D020F605D021F1700A2 023F605DA3027F60A36F1601631A006F94C7FCA281816E7E16C016F06E13FF17F06E14FF 18F06E15FF6E16E06E16F86E826F15FF031F82030782030182ED001F040181DC001F8017 01DD001F7F180384726C7E193FA2191F190FA3190713F01201A21203625BA20007180F62 A262000F181FA26D4D5A62001F187F6D4D5A97C8FC6D5E003F4D5A6D4C5A6D4C5A6E4B5A 486DED7FE0D9DFF04B5AD98FFC020390C9FC902607FF80EB0FFED8FE0101FCEBFFFC486C 90B612F048013F15C0020F92CAFC48010114F848D9000F1380546478E059>83 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fc cmmi8 10 4 /Fc 4 117 df<163FED1FFFA3ED007F167EA216FEA216FCA21501A216F8A21503A216F0 A21507A2027E13E0903803FF87010F13CF90381F81EF90397F00FFC001FC137F485A0003 143F484814805B120F485A1600485A5D127F90C7127EA215FE5A485CA21401A248ECF80E A21403161E913807F01CA2007E010F133C021F1338003E013F1378003F01F913703A1F83 F1F8F03A0FFFC0FFE000039038807FC03A00FC001F00283B7CB92D>100 D110 D115 D<14E0497E1303A413075CA3130F5CA3131F5C00 7FB512E0A2B6FCD8003FC7FCA35B137EA313FE5BA312015BA312035BA312079038E001C0 A21403000F1480EBC007EC0F00140E141E5C00075BEBE1F06CB45A6C1380D8007EC7FC1B 357FB320>I E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fd lcmss8 13.82 16 /Fd 16 119 df49 D<913807FFE0027F13FE0103B612C0010F15F04915FC4915FF90B87E488348D9F8018048 9026C0000F7F91C700037FD80FFC02007F4848ED3FFE49151F003F707E498148486F1380 A248488119C06CCAFC7E121E120E1206CBFCA45F1980A25F19005F604D5A171F604D5A4D 5A4D5A4C5B4C90C7FC4C5AEE1FFC4C5A4C5AEEFFC003035B4B90C8FCED0FFCED3FF84B5A EDFFC002035B4A48C9FC4A5A4A5AEC7FE04A5A495B4990CAFCEB07FCEB1FF8495AEB7FC0 495A000390CBFCEA07FC48B912805A007F18C0A46C18807E3A4E7ACD48>I97 D100 D<913803FF80021F13F0027F13FE49B67E010781 4915F049814901007FD97FF8EB1FFED9FFE0130748496D7E48490100138091C8127F4848 16C04848153F49ED1FE0485AA24848ED0FF0A34848150718F8A25B12FF1703A390B8FCA3 18F0A20180CAFCA4127F7FA36C7EA27F121F7F6C6C1630000717F06D15016C6C15036C6D 140F02E0141F6C6D147FD97FFCEB03FF90273FFF803F13C06D90B61280010716006D15FC 010015F0023F14C0020791C7FC020013F0353F7ABD40>I<92381FFFC04AB512FC140714 1F5C5C91B6FC49EBF00349903880003C4948C8FC14F8130FAA003FB612F05AB77EA36C5D A226000FF8C8FCB3B3AF6D5A13032E517DD02C>I<913A01FF8003F8021F13F0027F9038 F807FC49B512FE4914FF010F15874915C7499038E03FE749EB0007D9FFF8EB03F74849EB 00FF4801C0147F5C4890C8123F485A49151F121F49150F485A17075B127FA25BA212FF5B A96D150FA2127FA26D151FA26C7E173F6C7E6D157F6C7E6D15F76C6D13016C6DEB03E76C 01F013076C01FCEB1FC7903A7FFF807F876D90B512076D14FE6D14FC010314F8010014F0 023F13C0913807FE0091C8FCA318F8A2170F18F0171FA20006EE3FE0D80FC0EDFFC001F8 4A138001FF140702F8013F130091B65A5F6C16F06C5ED8003F158001034AC7FCD9000F13 E036507ABC48>I105 D<123F5AEAFF80B3B3B3B3A4EA7F007E095075CF20> 108 DIII114 DI<003F167F5A486CEDFF80B3B3A45EA35EA2 5E6D5C5E007F153E6D14FE01F8EB03FC6CB4EB1FF891B55A6C15C06C5D6C5D000102FCEB 7F006C14E0010F90C9FC313D75BB48>117 D<007E173FB4EF7F806D16FF6D5D007F1800 7F003F4C5AA26D1507001F5F7F000F4C5AA26D151F00075F7F00034C5AA26D157F6C5F80 6C4C5AA26E5B017F93C7FC80013F4A5AA26E1307011F5D80010F4A5AA26E131F01075D80 01034A5AA26E137F6D5D15806D4A5AA281DA7FC190C8FCA291383FE3FEA215F391381FF7 FCA26EB45AA36E5BA26E5BA26E5B6E6CC9FC393C7DBB40>I E %EndDVIPSBitmapFont end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%EndSetup 0 0 bop -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 347.12273 330.05112 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {347.12273 330.05112 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 381.26595 330.05112 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {381.26595 330.05112 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 347.12273 295.9079 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {347.12273 295.9079 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 381.26595 295.9079 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {381.26595 295.9079 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -233 3946 a 937 1243 a Fd(genes)47 b(from)g(1)1706 1203 y Fc(st)1830 1243 y Fd(individual)924 1530 y(genes)g(from)g(2)1693 1490 y Fc(nd)1843 1530 y Fd(individual)-185 3946 y @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 443.86185 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {443.86185 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 478.00507 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {478.00507 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 443.86185 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {443.86185 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 478.00507 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {478.00507 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a 162 2614 a Fb(S)251 2632 y Fa(1)1013 2614 y Fb(S)1102 2632 y Fa(2)1863 2614 y Fb(S)1952 2632 y Fa(3)2713 2614 y Fb(S)2802 2632 y Fa(4)3564 2614 y Fb(S)3653 2632 y Fa(5)162 3653 y Fb(S)251 3671 y Fa(6)1013 3653 y Fb(S)1102 3671 y Fa(7)1863 3653 y Fb(S)1952 3671 y Fa(8)2713 3653 y Fb(S)2802 3671 y Fa(9)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF loki/docs/loki_doc.ps0100644000076500007650000155234107652170175014077 0ustar heathheath%!PS-Adobe-2.0 %%Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software %%Title: loki_doc.dvi %%Pages: 38 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentFonts: CMBX12 CMR12 CMR10 CMTT10 CMTI10 CMTT12 CMR7 CMMI7 %%+ CMBX10 CMSY10 CMMI10 CMEX10 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips loki_doc.dvi -o loki_doc.ps %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2003.04.25:1015 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr 1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B /chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ /cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 {2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ 1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X 1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) (LaserWriter 16/600)]{A length product length le{A length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end %%EndProcSet %%BeginProcSet: f7b6d320.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmb10 cmbx10 cmbx12 cmbx5 cmbx6 cmbx7 cmbx8 cmbx9 cmbxsl10 % cmdunh10 cmr10 cmr12 cmr17cmr6 cmr7 cmr8 cmr9 cmsl10 cmsl12 cmsl8 % cmsl9 cmss10cmss12 cmss17 cmss8 cmss9 cmssbx10 cmssdc10 cmssi10 % cmssi12 cmssi17 cmssi8cmssi9 cmssq8 cmssqi8 cmvtt10 % /TeXf7b6d320Encoding [ /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega /ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash /suppress /exclam /quotedblright /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /exclamdown /equal /questiondown /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /quotedblleft /bracketright /circumflex /dotaccent /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /endash /emdash /hungarumlaut /tilde /dieresis /suppress /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /.notdef /.notdef /Omega /ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash /suppress /dieresis /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: 09fbbfac.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmsltt10 cmtt10 cmtt12 cmtt8 cmtt9 /TeX09fbbfacEncoding [ /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega /arrowup /arrowdown /quotesingle /exclamdown /questiondown /dotlessi /dotlessj /grave /acute /caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash /visiblespace /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /dieresis /visiblespace /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /.notdef /.notdef /Omega /arrowup /arrowdown /quotesingle /exclamdown /questiondown /dotlessi /dotlessj /grave /acute /caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash /visiblespace /dieresis /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: 74afc74c.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmbxti10 cmff10 cmfi10 cmfib8 cmti10 cmti12 cmti7 cmti8cmti9 cmu10 % /TeX74afc74cEncoding [ /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega /ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash /suppress /exclam /quotedblright /numbersign /sterling /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /exclamdown /equal /questiondown /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /quotedblleft /bracketright /circumflex /dotaccent /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /endash /emdash /hungarumlaut /tilde /dieresis /suppress /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /.notdef /.notdef /Omega /ff /fi /fl /ffi /ffl /dotlessi /dotlessj /grave /acute /caron /breve /macron /ring /cedilla /germandbls /ae /oe /oslash /AE /OE /Oslash /suppress /dieresis /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: aae443f0.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmmi10 cmmi12 cmmi5 cmmi6 cmmi7 cmmi8 cmmi9 cmmib10 % /TeXaae443f0Encoding [ /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega /alpha /beta /gamma /delta /epsilon1 /zeta /eta /theta /iota /kappa /lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon /phi /chi /psi /omega /epsilon /theta1 /pi1 /rho1 /sigma1 /phi1 /arrowlefttophalf /arrowleftbothalf /arrowrighttophalf /arrowrightbothalf /arrowhookleft /arrowhookright /triangleright /triangleleft /zerooldstyle /oneoldstyle /twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle /sixoldstyle /sevenoldstyle /eightoldstyle /nineoldstyle /period /comma /less /slash /greater /star /partialdiff /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /flat /natural /sharp /slurbelow /slurabove /lscript /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /dotlessi /dotlessj /weierstrass /vector /tie /psi /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /.notdef /.notdef /Omega /alpha /beta /gamma /delta /epsilon1 /zeta /eta /theta /iota /kappa /lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon /phi /chi /psi /tie /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: bbad153f.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmsy10 cmsy5 cmsy6 cmsy7 cmsy8 cmsy9 % /TeXbbad153fEncoding [ /minus /periodcentered /multiply /asteriskmath /divide /diamondmath /plusminus /minusplus /circleplus /circleminus /circlemultiply /circledivide /circledot /circlecopyrt /openbullet /bullet /equivasymptotic /equivalence /reflexsubset /reflexsuperset /lessequal /greaterequal /precedesequal /followsequal /similar /approxequal /propersubset /propersuperset /lessmuch /greatermuch /precedes /follows /arrowleft /arrowright /arrowup /arrowdown /arrowboth /arrownortheast /arrowsoutheast /similarequal /arrowdblleft /arrowdblright /arrowdblup /arrowdbldown /arrowdblboth /arrownorthwest /arrowsouthwest /proportional /prime /infinity /element /owner /triangle /triangleinv /negationslash /mapsto /universal /existential /logicalnot /emptyset /Rfractur /Ifractur /latticetop /perpendicular /aleph /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /union /intersection /unionmulti /logicaland /logicalor /turnstileleft /turnstileright /floorleft /floorright /ceilingleft /ceilingright /braceleft /braceright /angbracketleft /angbracketright /bar /bardbl /arrowbothv /arrowdblbothv /backslash /wreathproduct /radical /coproduct /nabla /integral /unionsq /intersectionsq /subsetsqequal /supersetsqequal /section /dagger /daggerdbl /paragraph /club /diamond /heart /spade /arrowleft /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /minus /periodcentered /multiply /asteriskmath /divide /diamondmath /plusminus /minusplus /circleplus /circleminus /.notdef /.notdef /circlemultiply /circledivide /circledot /circlecopyrt /openbullet /bullet /equivasymptotic /equivalence /reflexsubset /reflexsuperset /lessequal /greaterequal /precedesequal /followsequal /similar /approxequal /propersubset /propersuperset /lessmuch /greatermuch /precedes /follows /arrowleft /spade /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: texps.pro %! TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]FontType 0 ne{/Metrics exch def dict begin Encoding{exch dup type/integertype ne{ pop pop 1 sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def}ifelse}forall Metrics/Metrics currentdict end def}{{1 index type /nametype eq{exit}if exch pop}loop}ifelse[2 index currentdict end definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{dup sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 roll mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def dup[ exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if} forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def end %%EndProcSet %%BeginProcSet: special.pro %! TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N /vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N /rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N /@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{ /hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B /@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{ /urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known {userdict/md get type/dicttype eq{userdict begin md length 10 add md maxlength ge{/md md dup length 20 add dict copy def}if end md begin /letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{ itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack} if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{ noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{ Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale }if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState save N userdict maxlength dict begin/magscale true def normalscale currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts /psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR/showpage{}N/erasepage{}N/setpagedevice{pop}N/copypage{}N/p 3 def @MacSetUp}N/doclip{psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath moveto}N/endTexFig{end psf$SavedState restore}N /@beginspecial{SDict begin/SpecialSave save N gsave normalscale currentpoint TR @SpecialDefaults count/ocount X/dcount countdictstack N} N/@setspecial{CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR}{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto closepath clip}if/showpage{}N/erasepage{}N /setpagedevice{pop}N/copypage{}N newpath}N/@endspecial{count ocount sub{ pop}repeat countdictstack dcount sub{end}repeat grestore SpecialSave restore end}N/@defspecial{SDict begin}N/@fedspecial{end}B/li{lineto}B /rl{rlineto}B/rc{rcurveto}B/np{/SaveX currentpoint/SaveY X N 1 setlinecap newpath}N/st{stroke SaveX SaveY moveto}N/fil{fill SaveX SaveY moveto}N/ellipse{/endangle X/startangle X/yrad X/xrad X/savematrix matrix currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix}N end %%EndProcSet %%BeginFont: CMTT12 %!PS-AdobeFont-1.1: CMTT12 1.0 %%CreationDate: 1991 Aug 20 16:45:46 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.0) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMTT12) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch true def end readonly def /FontName /CMTT12 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-1 -234 524 695}readonly def /UniqueID 5000833 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5F0364CD5660FE13FF01BC20148F9C480BCD0E C81D5BFC66F04993DD73F0BE0AB13F53B1BA79FE5F618A4F672B16C06BE3251E 3BCB599BFA0E6041FBD558475370D693A959259A2699BA6E97CF40435B8E8A4B 426343E145DF14E59028D4E0941AB537E34024E6CDE0EA9AF8038A3260A0358D D5B1DB53582F0DAB7ADE29CF8DBA0992D5A94672DFF91573F38D9BFD1A57E161 E52DA1B41433C82261E47F79997DF603935D2A187A95F7A25D148FB3C2B6AA32 6B982C32C6B25867871ED7B38E150031A3DE568C8D3731A779EAAF09AC5CE6C5 A129C4147E56882B8068DF37C97C761694F1316AF93E33FF7E0B2F1F252735CE 0D9F7BCE136B06EE967ABE0C8DF24DCBBF99874702ED252B677F407CB39678CC 85DDFC2F45C552BA967E4158165ED16FECC4E32AC4D3B3EB8046DCDD37C92FDF F1F3710BB8EF5CA358ABACA33C7E5ACAD6BF5DC58BDFC3CF09BA2A38291D45A4 C15FF1916FE2EC47FDC80911EB9C61F5D355BEDFC9DB17588547763AC5F0B1CC 12D2FFB32E0803D37E3281DA9CE36C5433655526ACFB3A301C56FAB09DF07B5D 048B47687348DEB96F3F9C53CE56DDD312B93D3918CD92AF53FB9461864D11B8 0138918D0B1270C54873C4012CDE6F886DB11BCEA04B023EBB43E0D0A06BE725 741D08B9DB688731A6C9886C15A83C28DADCC81385EA239E045E8F3670CE03DB 9EE77ED067036595C9F3B1854343BE3A12E486B6E5A2F8AC44FA5378D28DCCEE 306B0E283AA444423F9A4FF38E2B56DCF67A39CEB2C643DAE86865517D5D0371 CB8797208ADEC637330A3A57902C9A88EDB75A7C16FA9850075D9F19578EC666 1353CC1FC512D59DFF847ACCD0494E6D9F5B03534A392687D6D130BC3DDB0FCC 44C9019DEEE55D51DB8B9B0DF90BF084D52D9E2C33C5DA27071AEA4E2A59C62C 66B75410F0D5D6D8DFE14A63FD5C3456EA8781685CDF057C9572C200F29F90BE 5DA85EEDF89E312514456D1CFA0C6F0F23912FE621048EBBF3BF1AF717316271 9EE0B90D5E3A4B2A9ECEE9C78FBCCA7D0B7C6630A8E5BAEF872F083C55C570B2 B36E78062F45450EDD91B54046F5EBF530AE678A05D6F274FAFB8E73938BD2CE 2CF13CA4C746E1007F78B4ABFBBA7C06191A70A416683A8E71DD668F65797D74 0C335A2FC19AAFEC7ACFE462E0B29D75454478E2FD6CE316F387B5B9D1416488 C02FB576FA5BC82AB93E16F6B06C1B01ED9AA49501A681335D550FA67730E8B7 94E5E26D6C966F9743A45ABCFACBF7FA1CF3D9B0C71F38587B7BEDA897F14469 412E76F060781B4454B962228F19FFA20D25DDA58006DC6359BAC4833DC2D480 D4A65F023A91ABAE99D055C293C650102706E950148E3D412321E1AC3871C33A 2B45ABC890EDF1CE747918D00B19FB4AAEEA9884286F8327AC6E940034F0466F 32CD504030321FB22F6AFB7AC7CD0834BF218DB8472CD8B6D9440F4962217C0A 417CD9F9FD12FF6E04061B7C2B85E3398EACC6A57E5216346E8BBB1ED18D60F8 2FED9F76D2DF654658C44AE560CFB7D6F9B8DF660ECEE0E6E30A2997DD338ECD CF9A9B0AC4D1C72D1039D4E827D97BBEF04DE99503B5592ACE6382B9579FC284 E29A1C13E8B5FB091176BEC1657013AF936A640F93FA7760832F25AF0D8197A5 25D53F45940F82A7EAB4463AB249A618704CC6043E411E9A803128E6D2ADC96F 2DC25FABF204820B9CB3C8DA865330AB46FD63804B1B7183C0DF46E4A91AD722 144EE50AC6C7B8EA32F79A054D24A37BD4766399604677C4FAE0DDAB82C9C30E F1B7526E3C24439DD5C6A52A77086F58094C83EE5CC4222F901251C82BC69ADD C860F33DB7F424E877B28D190EDF03E2F6FA5525C36778BD4F50E58883FB6326 7463D1E9199D8D086DFC78BF77006B317D3111667449F359A224970816BD04DA 83E1F6F88E1209D17B47337F4F4A22D6FEEE0B7A1B2D12D8D7534227A36BE040 76EF2D15C47CB4F7EF99F4886382E3D12C59483C44678F8789D4346BC57F7D44 C7CED9844213819EFC554CFF3CD88E3A99E18355ED6FBD7927795BEE743E2900 C66B42C230F51285D4A16F22ACE159AB96A5184ADFE2220792F3A25A89E3D3DE A0DB806AD80CF6C4CD9EDE0C5B07BF64BE35B8E3AD994D22EDA1C9A8E49AC1D3 1FAAC14A8170CFDCA48FCAC1B75C4880C3FDBDC849D1F95C1DD9A018EBB5D26C 9438DD340E3A8C02DC47668A6C2E336243D7ADE13C1D97733473B914BDB5647B 86EE94C55AF434F6D91942A1FA71DA5FC2126BC1170AF73048CC5DD92D413DFC D207D098F0CD70D2C8686D7DA03B93C4612016577F0F064DA17C419201985471 4F04CE5D1B5E42D2A1D572978437E6A71E46FE1D603AA88EBF023D5585B8715F 3F96E95635851C2561E2274A5D995C14BA1E3C6D1A41F34ED2FBF15777EC5975 E179551D83A6839851A187BA20F446E15A9C801257FEE7FED7A989153CD981E9 A4510F28B4C200014E2E418C05AF3946AB0064C016302CEBAE2CA13EDD61DEE6 E0C57E823942FA58EF1AAEE9C0DC07C98084B0702B8627F42689B8DD03ABAB39 8048F8EA75D270DD88943600556BFC02E2088299974DF994C7E6D7E70EF3C24A 2C7945E94B30EAF72E11B548545F355EA365C762D0E3BA124F7210511C24613D 99ED5557FE619E96973D4401A5E8B1F779652807865B5D53F4881CFC0B895574 B05D25B02B78EA06DBC79CF8761260B2BD88CE9ECB00A644B39033E30433F3EA 2317A16537DB4C812D6CD6DD21802FBCC6284D723DF37294369142D118800271 FBCCBCEE50FCB89CFB70F13A9147C749E1AD8822C2393A6E39950CCDEE9DDEC0 050C52EDED6276822BF7EE430616089DBC9A3B8C1F0D266B63310DCA47834FB8 5F6C28FF0943D8FEBABE62744AEC9A56AE02F26FEDA454776F0C246980D0A6B8 2D6C3C354859FE92B3A6E6B976E8456852FF6A585CAE221623A6F29D59B7F04C 553671E97F23F0508E415B11109AC25E4932BCC2B9B9A8B936CDA7A818F48606 70B12F902B5ACDE08B99655CA12C5B216F2E7CC7B82E2448197A392C15099F94 A70033796F73222C86AB8EAA77A4C21BA6BC9F1B9C676935B247D85A6300F3F2 49D34E930751CB2D5D92A90F67D672ACC37DFDC258104075226DDBDEE9FEBF73 744CFA1B8D299BA393EAB9F400CE72873FCFE9872E3385D7EE60EBFEB5A8E17E CB0061EE4A33B9B19BDE97A8B13E1655BD21F041B44D39AEE20FD10D3FDE96D4 E419BD6A38B3B4CA1BA1AE8F2BFFDE40BAB9AE9D84F5FE605A60FFECA162D481 40DD89AC44E61100A5F090401EE7B92FB59772D6B7509108733DB9088DAB24CE 1F461EF60E41EC891326581E44D8F1F64784432714B211D8317EB239F5674CE5 CC20DF6AAAF7689383E2199D34A29E61312F61CFFA5798165E1D1C6F103C2074 BD7DD7232848F8E5E003C168DA44C9F834DA24FDBC221B26E6A42ACE223D04FC C8F041726CE16F1718F95EF5D77CB5CEAFE1F976A95044A8C617E1AA30C3FC0A 064871896A36DB85C4B6E6C2F65B7E60C6D13946C8F673A71CE9D679494E1613 B1EB777451B8C63D1FA449E23DD744769B77C778F4460A9F9E2A45CB04B84ABF 7707200DCD13D91FEC322EC706A4873C698B88E401B4E861E522FA464FA3FC3A 3528E54F7F5E98A41A6CAC57D3246DC8FA0FB4794EAA30990F3591E98FEC2D13 782C25B3C2C9D334CBD2E237FB59EF83F2283C07CA94540A936828DCE7AE0191 AC9E0E79EB188568CF081BEC2B1AEF1A0242D03954790298ED0C6BE8471BED66 7D8965178DD045FE50033490BA763F620391F53627F9854B509DFD9EF270B8AC 1E81F54148D61345F028CFA5D31F5B7FF04EBAE9484D33179AE4EE700259F183 D845AE6528C5EB293B8D104C38E0F327C8B10EC01FE3ED3B065EA0DF944A687F DC1062E451D4404F7FD7C07D56D77655D6A96DA3F90DB4C7F3C8A6F43D92EDF5 5C616D8D36C1A1BA970D9246EB252035311CF9ADC01E98A5D151A378F431F56F 60090520761EE06EE659A7418076B31C9DBD5A870B8976FA892E572DD672E92D 4F461EA7D0CCCA0454D19D4FCB401218FF9DE4D41C6F5A4D83F4C1D43C8571F2 2D15BD93845DCB3401492D291B9F4967A72DDC34A74632B9EC04369496C25955 5879F41E9E0FB30ABC4F087EE3C7F9128A72BB03FA8EBF0D9B62BC558BA0112D 861C814FDE664544B2A7DA697B0ABFEDE02459B2F3A48C3D29AD9319790B7EC6 31BE3D0545EE9E629399256153440E631ED8143FACDB06B45FCF2CE1AD30BA5B 2AF3C2FFE0283CA55FE1D4E118C123668D63BD113B7E1D29F9534A9F929B7542 17095B256946AFBB2F9C73DAD1BB78B78EC7E7EF75666ED036C3023F9BC52A67 269FD1003CDD9AD9154DEBAE68F24197919947821AF5C20273E94B0D4F383D25 8A79A7AD43CA7C9E8D13D809A7F354AFB3DB243A16D58EEE9E38CE98D3C8A440 DF6FEC77AE29E3A32EFB7A1940B6DCB273F41BD84F297157468547A3D3E68791 B014D97AF6C82D0D1D3D0823307E48421C0A3D1E106CBA2D30917D539C91F3C4 78C49D213693DEB3B6DBD1EF80B6DA12A582A486A71ED40E8E3B15935DB87E23 16E83190F07BC454F61FDA2E464DDC561A26F4F91D9651FAED26D16E94493BCF B25E6C0047E736B8A8449F16BC2C7B539759BF102E49E758EF8CD4BB1EE4F4D2 BDE6694040BFBE709274D04D0DA602CC883158B702D8771F230325D5C70BB34D 34BFBF9FBD7562213922318981850D0ADDDFF2E4EEB0E8E3985DF692C35EA69D 7E10B00507CF59B5387C6C38C7B4C2970BE0FDF45597C91F8FBD193292567D3F 8AFD44E63D8767C2AB704794AC0550DB081FA17DF5DEA55CED5517BC37687CF8 A482EC39111233EA314FF677C6CEF6DB6376AEB2AEAD336BB4DEE9D083F07422 78FB222DF8D80396AA1C926423A7597FEBE7C46C93A7ADF3170A86B5523354EB 942A512395608ECDC2F882896D46439C1B9A781498F003B55472311240EC0FB3 E0D9565A110B418D91ED0DDEF1D245B257BC06E5CF75ABCC3D476F2501CC3C53 9A982928B6B7F6BBD5CF486C221BBAB914CBF0E21BFF645502BC92C166924F47 9E890837EC47C0674E78C6DAD0F87FB45D2707AE4C51BE7D88D0C79B5D3474C2 57D79885CE 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMEX10 %!PS-AdobeFont-1.1: CMEX10 1.00 %%CreationDate: 1992 Jul 23 21:22:48 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.00) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMEX10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch false def end readonly def /FontName /CMEX10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 88 /summationdisplay put dup 115 /radicalBigg put readonly def /FontBBox{-24 -2960 1454 772}readonly def /UniqueID 5000774 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5CF5B8CAC6A7BEB5D02276E511FFAF2AE11910 DE076F24311D94D07CACC323F360887F1EA11BDDA7927FF3325986FDB0ABDFC8 8E4B40E7988921D551EC0867EBCA44C05657F0DC913E7B3004A5F3E1337B6987 FEBC45F989C8DC6DC0AD577E903F05D0D54208A0AE7F28C734F130C133B48422 BED48639A2B74E4C08F2E710E24A99F347E0F4394CE64EACB549576E89044E52 EABE595BC964156D9D8C2BAB0F49664E951D7C1A3D1789C47F03C7051A63D5E8 DF04FAAC47351E82CAE0794AA9692C6452688A74A7A6A7AD09B8A9783C235EC1 EA2156261B8FB331827145DE315B6EC1B3D8B67B3323F761EAF4C223BB214C4C 6B062D1B281F5041D068319F4911058376D8EFBA59884BA3318C5BC95684F281 E0591BC0D1B2A4592A137FF301610019B8AC46AE6E48BC091E888E4487688350 E9AD5074EE4848271CE4ACC38D8CBC8F3DB32813DDD5B341AF9A6601281ABA38 4A978B98483A63FCC458D0E3BCE6FD830E7E09B0DB987A6B63B74638FC9F21A5 8C68479E1A85225670D79CDDE5AC0B77F5A994CA700B5F0FF1F97FC63EFDE023 8135F04A9D20C31998B12AE06676C362141AAAA395CDEF0A49E0141D335965F2 FB4198499799CECCC8AA5D255264784CD30A3E8295888EFBC2060ADDD7BAC45A EEEECDFF7A47A88E69D84C9E572616C1AC69A34B5F0D0DE8EE4EDF9F4ADE0387 680924D8D5B73EF04EAD7F45977CA8AD73D4DD45DE1966A3B8251C0386164C35 5880DD2609C80E96D1AB861C9259748E98F6711D4E241A269ED51FF328344664 3AF9F18DCE671611DB2F5D3EA77EE734D2BED623F973E6840B8DAD1E2C3C2666 DD4DD1C1C9C622FAEAB9D3E54476B49A2A026565F10A95536B67FDFDA5E9E68D 6E200F47365F1145FFBD5A15D3B884FCF74B5ED88FC372E4D7CF817FDF92A1DA 3BAB0D25745E6E74D46CB319D2C6FFDC2BC08D2A2BF063864CE8DE5029F6A492 B0080E8A20DE8816D11CEA21CA7D5314DE694D2D974C6B140F44BCFFCFD8876A 26A0515A0A713CD798E50B3AB313D2E1E62AD28ACF11B016F1BCF7A8F5944978 1F3CAC6F13EA1E0C26032AE06ABE64386B0EDE03F1FBD42770FDE016A52BD6D0 0F2D609D2470E23630DE0586180E45B54BFFE6EC3B8EE2F1E0314582CDD8BE62 3BEDC0CF1861FB6C007051E7AC5AB70CEF0020DFCB4A4E927C595F48B7572991 7BAFA091CF6975A987E726AD0A4BC9989B66BB89A2EA0E3AB14CE40D9D86536A 667F14249C89A2784F2B4C59F951BE32593555CB73090770A89884B7322E87BF 46E815E355B16725726A502DB75B72BE9D700A586BD336BEB2A4CD2E1C3D834E 6F27D01FD6411B6E3075B62874E4E0C125291581B77F558029E08F385E577E0C F590E7D4806F8FE63FE5665DF4AD5D5FCBF33ED9BDA079C7E7CDEF0EDF8A4A94 613CF47E64ED5B77FFF0193B61112A942CF8B0E3832A0452D9877B8235A3710C E883D4F028ED9C839AF816BC 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMMI10 %!PS-AdobeFont-1.1: CMMI10 1.100 %%CreationDate: 1996 Jul 23 07:53:57 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.100) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMMI10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle -14.04 def /isFixedPitch false def end readonly def /FontName /CMMI10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-32 -250 1048 750}readonly def /UniqueID 5087385 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE 3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B 532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470 B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B 986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE D919C2DDD26BDC0D99398B9F4D03D5993DFC0930297866E1CD0A319B6B1FD958 9E394A533A081C36D456A09920001A3D2199583EB9B84B4DEE08E3D12939E321 990CD249827D9648574955F61BAAA11263A91B6C3D47A5190165B0C25ABF6D3E 6EC187E4B05182126BB0D0323D943170B795255260F9FD25F2248D04F45DFBFB DEF7FF8B19BFEF637B210018AE02572B389B3F76282BEB29CC301905D388C721 59616893E774413F48DE0B408BC66DCE3FE17CB9F84D205839D58014D6A88823 D9320AE93AF96D97A02C4D5A2BB2B8C7925C4578003959C46E3CE1A2F0EAC4BF 8B9B325E46435BDE60BC54D72BC8ACB5C0A34413AC87045DC7B84646A324B808 6FD8E34217213E131C3B1510415CE45420688ED9C1D27890EC68BD7C1235FAF9 1DAB3A369DD2FC3BE5CF9655C7B7EDA7361D7E05E5831B6B8E2EEC542A7B38EE 03BE4BAC6079D038ACB3C7C916279764547C2D51976BABA94BA9866D79F13909 95AA39B0F03103A07CBDF441B8C5669F729020AF284B7FF52A29C6255FCAACF1 74109050FBA2602E72593FBCBFC26E726EE4AEF97B7632BC4F5F353B5C67FED2 3EA752A4A57B8F7FEFF1D7341D895F0A3A0BE1D8E3391970457A967EFF84F6D8 47750B1145B8CC5BD96EE7AA99DDC9E06939E383BDA41175233D58AD263EBF19 AFC0E2F840512D321166547B306C592B8A01E1FA2564B9A26DAC14256414E4C8 42616728D918C74D13C349F4186EC7B9708B86467425A6FDB3A396562F7EE4D8 40B43621744CF8A23A6E532649B66C2A0002DD04F8F39618E4F572819DD34837 B5A08E643FDCA1505AF6A1FA3DDFD1FA758013CAED8ACDDBBB334D664DFF5B53 95601766758ABC32753253028944A5354465706B427995C8239075F1E8811A15 06C058BF39957ECF3110B7F097838B9EB735E77A3919CDB8A56D190D10850824 19EE6D50269B8C0F164F44B4B0AF408BF75B1F8ED3E4339D6BE42125A07C613C F8FD83E1CD21762770D528B589B9ACBBB136B54F60532D46D18DFBFCAB8C0EEB 406FBCDFEE2D5C7F40F4E3A16A230D1363648DAEA28726BA255F30EEB339115A 7DC48850DC87B876620BCDCEE477A7D70AE1AD8F6EB96C362B499770789DDAB0 A35F31F21448EFC1928F6F119FF22CE9EE6BEF2DC113D7F4B36415A8DBECDF72 C7A74E883974C7CF1185FD26A0FA0A860DE6CEBC805BC456DFBFCDD7F0C17E9F 297B717C49825D193EE5BED724CE17C46A1791621257FB217F0B1EC3850ADF90 82124A18219CACD87A0B68BCFC5927DE20455240A002AEB5C2417684A15E34A6 F2A135CFA47CA3D6FEF3486E3480DDDD80309BDFE199AAA234C36AAA1BC043CA 66A8671EDF2AF7919A0926FDF17497F869ED9ECD270533C698D9FD84C69AE39A 09E02E877A762EC2FD15DD9CF2DC11B11FA303305348D5E6914EB8AAE6CDDE46 C14F9D573FD9196BCBC0F46F52B4E0FE9DDCDABFC80039D8BB3A8409E6263B06 A4BC08BF15D171C8F8294E8AC75AE91C8038BD36FB64060E2FECBB7D4B60982B 0C1CF14AF6C0EEF77C5F9761C52FACB4DA57F954319930F905037CF4D2AAAFCD 392C776B8632CAE5726E98921F30918D0F3C0B437F09D22E6834775B66FB463E 11CF5D3DA4C79701EBC593B8259197160C83EB1F77AFBD364FD721E32A3A9516 ABFC1D59DF35322551ECD41966C180779F8D32806239C6EE735D00982E81128A CB9A66497A664D3F5BBCB00755453703075B619E93879F65A407ECC37E04AE17 EA9230046E40192B45C062C9D6E913BAEDCA20DC9A69056207648FE5A54134F9 727C8F4BEECE307523E37996DBE42D837E2D1931CC61A052E1F54A1D127B85AA A3E162F03098CB4EF52C9C5C3EE283D1744C4F606D87A612F54810A6C95464A1 8ED4787234EF8C48E2B8C606D6F45DB7C435E9825DCD2348263C58B2A8121D85 ADC2FDAF27A1D768B7020F91044A564F107EA4E32780C7E099726B2E941658A7 0C5F6E10880F9C05B621E6D48F888790C294A0752B84B3B0FC92F569929F7FE3 9AE8511F125700B7E43D551BDE7BA81EF62AA7964C7AD6795844B708497E3149 2996EF1DF360ED8343BFBEFF39DAC377ABBE84B76C0DB49C00FA08C168A1F9B3 3A1A0DCEF6BC87546B3F99B72F408B8890391631477D9C89D9DEF2C27BD92724 073D927DDA4EA203C8A7DD57BE765F62B727FD2DD3AD29988E3F7EA4E52023E1 721033BC1E2AF5456471923927FB620B344EB32FD209F6A701A688465B79AABE 3DA7E48F9A5E577022F6FBFB34C474052129BA7685575B05606FA1CCEF9BE755 C54FAD43D1AF0CC247F82E26DCD6977369393365AB8795F5759C655509F0F077 7EBC9A4C8DFA1A0703197861AFF48191D5F34AD0BECA416DCA4990AD9141CE94 B87E4C5D0C76722310A41BD412F7AFA455E70C01B44A617D8B55C0793E4C692D D714D57B3F238EC3C55B75056AA2B2FE78ED267F878DD80E6CC7210CBA776088 29D398F9C790BF7AF4C52336899A4A2FF1DC556222F731C2255B0072E937426D AD581EF6746C015B7A22A25EC80B0CCC491BC24685168FB0C4AAB8AC9EAB8FC4 A5B3BDB007A419C009845EAB48328D251B60E31590331E434017DF1CFB0C931A 067E65B7EE2717C405DAAF6E487409992D088B5C7A67DC9CF7A8CACF7731A33D 57A483B4B6484D62C989379ED5447EE93BEB6383B17CD71FCFFDEEF35779F956 EFB0EBD1239BB6385D5335744F515061B2CCFC923F8A4F1BE42729B3D4081F90 16A191C32C633687E9CF8D75CA820133E436D2968B83E8306F4BFCB9FD9D96B5 DDD2F77C0EE4B4D7907474BE73484AE199E7344545D080324958F98E9DC68293 3A761EACA871CD572D04B2C3C12D4BEDFCE3B724735C24D33001405C74238CB5 C1B08BBCE34E979895172B7FF35DAFD5363E102D36F9862786E7B54B995B6D54 C13A8F09AC00D38B71DC3651B6407A04AAA671185B53812C0EBD7F40725E8162 CC21D3A7039E4FCBA19F75254A0C34003B9A1A2039B0259B5D55A26A17C25716 23694A02F5C1655380AB86C5B0A2DE23171202A881126D8AB0FE76418528DBC2 C9E8DE4A23D04C59B91C7C0A383F26DAC3F780ED0D21A797F63A67A77AA2C914 4B133E089583DDB0EA420300C4770A95FB1B5000E1C253303EC4700677CDEB1E F93296152209A11F75E6BD0653D339D2904CF254420B5906BD676C9337D5C7F5 DBF0F720C275298EAD8770F36B36FBC4905786B80A8A101BBF74950273683646 4804E16EBC2C47B10573E58C191814CE4AE9A6A9A59F60B24AF160D35F195E20 BC3ABC239E4F4BCD076C86F22D9B897DCAAAA69E571633B69A3629708229D407 408DE6178122CEE095044C5487B77AB912965DB4468B45993B9C17F174C47061 EE4D4E050496BE5E4A94F4930BDDC180ADB87C28742582E9A1D7B9D595964CD6 C4AF5F1F82A88347DD135B629CB6B5D4A2D1786A2396E4606615A7D34D14813E 337955C450F77B117C6E54EBCC95C19E27764B52D7724D15528AC0C14116FFBD FE8209F7B195BDDF943FD2A6EEC9464381C3C2F16EC585D1C2167391874E3E1B 63D1CAF8261D45C4E379759AA1136A6E159ECD8A33D0D65592AD039CA6EF0AED 758BD0613061EE192A41D0C625EA600C270097EBDC16FA6E9DA4487981AFDAF7 16F9D2565F30D4A3EE8E7082CD3B84A18DB51F571AFC6887016CD648A45F1928 981CD5187D23617AB66FBE01DDFCA12A3AE9A6EF29D985CA8A1117103EBADB3F B1D461BAA5FF1506AEB872628E39BDC40E2E1875C14E82BCE9D5FB35B51BEB6E 036B1040033904191339D215335CBD470E0922C16598ED20743208103F3F6865 994A09B511433C9DA7E7C71F553519F7559A44BBB1EEDC2CA71CC809ECB5E9E8 308C5BE9DDBAE1224477839D0398AFC3EFE65843F9A9E72233DE88E499E82772 E5BE130FDB36E56700C5DE15A9FB4617FD9802D3A450744CBF3CF506C4F3ABDA D1D9E49F9F6D58DFD8E795FBE183FC2B5A3B7CFD5454C053F9D09F67B20E1E50 53108F230EDD4AA6C01402DEAFAFC31B3974163A264747152682735888E3D883 99EB7951A8A36708DFB62C51CD83269304C9493A2FCE3F42F05712B528E721EB 12166EE815533A993BB7DEDBB662AFF2C6520E62D172BBD7F489B57FAB61E097 A8CB86B33A27E49B62BC0DF0019079E48FC357C84C1D50078261D70128F6EE88 81F5BF79B3500466566DE830A946FFA7D399086EF6082C17B8B2871B54B3CD51 4C9C0FBC71DB81156F5ABCFBD396428C0B17EDF5AC37862DF660F2873ED1B7EB BBD88882384FB760E79416933CF97FF3E69753E3618163EE55110687CF5E9FCE B8FCF7DF9680E35D410F99ED8E5A4AB7823042290BB89B92176F8A72667E6B53 BD5DCDF28EC889B0EDDAF7565B53C2DEF8E1BF718CFC9B75BE369B1324F5B1BF F81284E7BA6E76A5E094C2762CAFC4CF8401BA940392FAA994B40C5BDCA4D8F3 90813FB06CE0AD3A121A2BD57E985D3C90F74B4A357AE537152CC0D6F0AE71F6 344E76833D661752B3EDE222267FFB38C3303C7C04F8A34BC53E18B30F99B059 C1518BD6F83F812FA29FC8ED728B3B3EAB5E603A0168F605C5FD0D833B67A0AB A2C3C4A05C081B992AC902092B488ACD49D904864BB1181CF90C24BE8B043C9B 8F1B488A32E649E85D36D8B1CE5FAEB53DE788BA91547016C5E8090659690F5D D88634ED1CA4A93AB81B06AA51683BA0A16DD889537FAA1DB696 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMSY10 %!PS-AdobeFont-1.1: CMSY10 1.0 %%CreationDate: 1991 Aug 15 07:20:57 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.0) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMSY10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle -14.035 def /isFixedPitch false def end readonly def /FontName /CMSY10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-29 -960 1116 775}readonly def /UniqueID 5000820 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964 7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4 A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85 E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A 221A37D9A807DD01161779DDE7D31FF2B87F97C73D63EECDDA4C49501773468A 27D1663E0B62F461F6E40A5D6676D1D12B51E641C1D4E8E2771864FC104F8CBF 5B78EC1D88228725F1C453A678F58A7E1B7BD7CA700717D288EB8DA1F57C4F09 0ABF1D42C5DDD0C384C7E22F8F8047BE1D4C1CC8E33368FB1AC82B4E96146730 DE3302B2E6B819CB6AE455B1AF3187FFE8071AA57EF8A6616B9CB7941D44EC7A 71A7BB3DF755178D7D2E4BB69859EFA4BBC30BD6BB1531133FD4D9438FF99F09 4ECC068A324D75B5F696B8688EEB2F17E5ED34CCD6D047A4E3806D000C199D7C 515DB70A8D4F6146FE068DC1E5DE8BC570317AAEA74A842CFD26F9591866F5A0 9B4EAD7395F5196B36997F1D59E88165C94739E74C2B40820F8C972B175ED79D 87C9E323C3CDD5C2BEE6409017767534E19F45AFCE2C6687733451AD2E75D112 42040BADFF90F5FCFCB7A7E0DCBC4AC48AE97EAFE3DFC6407AFAA28697499D20 1FBA5D69582BEF62E4CA0F7DA8051969C45D214A5984D4FAA1FCA0482320DF40 5D3287163FEA3EDD2BCC159534A7BAC3BEAA1802EF3B4583107FA30270EA9B7A 0F416504238477C1CD568414238ECD2AC46AE50B03CDABA0477CA9C0EE660587 390B8EC08B88369CF2290558B8CA90DF8FB5CDD6A6D00C51388B08910D84D832 A4D7C5A3CFC3DA4ADFCCF04C3B4FE3462889ED95BC2558C31CBBB83D5AE2E1FC 0931DD2F7C0DDF00AAEE29588B816D4C23FF958004DC8967F5346E2DE037B43A 710342AAC86F5810E13D1208F1AF1FB642CB853518E1BA2919C67A9E8D3EAFBE EE1B375688DC69BF2E91CE6F06DB89692FCCFE0E2071F1F89F5EF1F7DB8AF5A8 744CA6FCBF0B7CAD23074BE3AB5B488458B29C7C06FA55AE5EC3E9E379C477C9 28E1C4B02E1C57C4DC9A483383B3AAD85F138E834E3FE1632AD478B592A652A6 FDF6411C89C8D1B01A9A 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMBX10 %!PS-AdobeFont-1.1: CMBX10 1.00B %%CreationDate: 1992 Feb 19 19:54:06 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.00B) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMBX10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Bold) readonly def /ItalicAngle 0 def /isFixedPitch false def end readonly def /FontName /CMBX10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-301 -250 1164 946}readonly def /UniqueID 5000768 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5F00F963068B8B731A88D7740B0DDAED1B3F82 7DB9DFB4372D3935C286E39EE7AC9FB6A9B5CE4D2FAE1BC0E55AE02BFC464378 77B9F65C23E3BAB41EFAE344DDC9AB1B3CCBC0618290D83DC756F9D5BEFECB18 2DB0E39997F264D408BD076F65A50E7E94C9C88D849AB2E92005CFA316ACCD91 FF524AAD7262B10351C50EBAD08FB4CD55D2E369F6E836C82C591606E1E5C73F DE3FA3CAD272C67C6CBF43B66FE4B8677DAFEEA19288428D07FEB1F4001BAA68 7AAD6DDBE432714E799CFA49D8A1A128F32E8B280524BC8041F1E64ECE4053C4 9F0AEC699A75B827002E9F95826DB3F643338F858011008E338A899020962176 CF66A62E3AEF046D91C88C87DEB03CE6CCDF4FB651990F0E86D17409F121773D 6877DF0085DFB269A3C07AA6660419BD0F0EF3C53DA2318BA1860AB34E28BAC6 E82DDB1C43E5203AC9DF9277098F2E42C0F7BD03C6D90B629DE97730245B8E8E 8903B9225098079C55A37E4E59AE2A9E36B6349FA2C09BB1F5F4433E4EEFC75E 3F9830EB085E7E6FBE2666AC5A398C2DF228062ACF9FCA5656390A15837C4A99 EC3740D873CFEF2E248B44CA134693A782594DD0692B4DBF1F16C4CDECA692C4 0E44FDBEF704101118BC53575BF22731E7F7717934AD715AC33B5D3679B784C9 4046E6CD3C0AD80ED1F65626B14E33CFDA6EB2825DC444FA6209615BC08173FF 1805BDFCCA4B11F50D6BD483FD8639F9E8D0245B463D65A0F12C26C8A8EE2910 757696C3F13144D8EA5649816AAD61A949C3A723ABB585990593F20A35CD6B7E 0FA0AD8551CEE41F61924DC36A464A10A1B14C33FAFB04862E30C66C1BC55665 6D07D93B8C0D596E109EE2B1AAB479F7FAA35279ADB468A624BE26D527BFF5ED E067598E1B8B78188FA4BCFB0B51692D07B0BEBB930C6F0997B437E2C51B876B 61A563A2673932C2045833FAA35DB22ADE12102335D5DC734AE3AC5EEE6658D7 92EB62131E1DFBA441F53EFF9021D9D4C491F26BE8F54C61165CAD778CE8695C EEAF70E3B20C64D4C2B34A084B5770BAB2A974E898F62BFE90F132A37E2DCA4F 43E13DB13C94DFA8ECE2B7374827AE168634FA007F8981ADA046CED3448BF453 FCD9A4F194FA648F9FC0971734BB69CB73439CB0DD021D44A7C11BF295E81733 4DFBA460FF3D654F9FB337E99E6D66FBA87A817EB9CA1536C84833870E3626DA 55D48DE850D3E6F6B29DA0E7C9D681283586F208DB8D58042E3A7CE55BE84822 C98237911453E479EAB65AFEBA3F61A763B40E74535BE56C9D8D06DDF9441741 5C9D9D917439368736619717FAB4F06E2C329AE0BA411F3FD355B1DE1D32145D 39243D0590A90F1C4EC2C438FD92399C24EE8AC85E4D8C211613CE4DDA344F53 1C85FF55AA49D316627DB7814D804A23F857FB19FDC56931EDECE257A1C0C791 E424EDFA4F8010E3C3805C0E407C3FAE85A7120CE9A34892E2EE665269B1EDC0 3B06AF97CDBE9A47C3047AD5CCBCBED08BC5CBC9F250F58B05BDB2AE2F2774E3 AF8C5A15EE4F4CF26DD7BC4F4D1CB59CBEBD3391734CDCA6773634155264287B 2BE4DD52A321678005597629CE3437AB207BE87E12390738999837C7E30128F1 AE0F2093C772ED95FFC26930FA961EE73F5454EEA76E3C0B41CE0C46C6E5A78D F4356EAD57AB3A889E084F3433AFA6146BED5C7A82F6E918852F463F0D41D9FC D31C6A4D792AFBCDBC80884B339C2E81A1593465708CE9857F1E23337C75E72A 2B3E2D8287DAB64824841D515124FAE185186121650BF918ED5BD1C992DFFE39 1E5914E90651FC5D7A1C19E5749A41955B2CD3571F85F25291C8D2CA33A5A54A EE7A8A2CCC8E4D318ECC90FD08F28E4F0FDB78E375D4F9420507B2814AA44F04 7082A7BF1080D7CCF86F1E69E2F5FDF5D609BB1A6F034B72EE3B707AFF64B674 AA8637C818D4FD7962A1C7375C852F1FA09D99CF1B2CE54F4386529399BD6CAB 1C735AEAE93E456ADFD6A761F6589DA9186FDB0B1F3392F27790ED983822094E 18A3AABE20FFAA9ADA1838B6EA0CC5F4465347272A477FEA807C8DC3C53593AB CE15DF6B3EBF1D5F87434647BE869B7E1739AF3788BABB3139004B7A4389BF54 308B3DC9D10738D919BB73128442C3ADA013088C9AE1095DEFBA7F03AC352037 42923D1B1B8C2D716877B58B735C1F44C5DA713029675EC072681B9CF5A5C418 3631D5A4CD3A236D12927F681C5F06A6E55D163B540DD291372C1B03D4CB2347 B6A83BC4A8D9A80340978C12006C637D4E4B949E23FFD36FA9D61C01B842371D 586AF126762B13AF7C2E476BF86FE73388FEFAB14F50D5CF0B32C1E0733BA5E0 9F881FADB3C8E713340C110B87C85133BEF421A0CB4C728EAA0A2D29675F85AA E534648F16EE6456CF5E16F45F7D18E8F9AA8DE19085CE1FF9BFDD276754E6A0 73732417CA6A5B0DB90D7AE33FB153D4CFEAEEACDD126F221BA9AD08D8A7AE0B 42E87C847FD46D11E831325BCB196342F5317E6FDD1F7DC20E09C54E03BA1492 4CCBA49515050BF7AD2B97A82712BA44C6B19468381C0ACD8E8B1B80E64B5DAD 9DBADC6B7C278FF6CAEA8913C5FA9E35136F9CCED81A25733A6A8CADE6475F4B 90940E1C3BF45D965058D664AA1B7245D599C75BD0908EF13AF09DAC96742A09 3831CEFD7ACD20449535CA9FE6EA6F1AE9180B0A09B0E417FA7D93914FA1AA4A B830B1D9207EC02F9E240FF0E10C2EA3A2CE4C8C3C2BE1A53DF7453EAB2CACA9 4DF3C6C32E6A6DF5D6DDDE52D3CAADC7603178B3F89DBC446660DF36D2C32801 5D21CF197E338A9279A1EDA1436BBDEE12697AEC82C163BBFA5E777A86A10BF9 80437BE622B6BAE54D833EF3718E21E7F11C243238E739EAB11CDFC6FA965360 C8A99D542615E1757C805388D0600935543B7417242C6F51B029C73FEB448859 4C0E4169EDF7B47B57F89352CCAACDEBFE8D3A7427804266B7451EDAFAE447E0 CA097EFA7F2D5894BB01ABB25846ABAD6C90CFEDC1E2A13B44DE591FFD352112 1544C54C7EB6F565690F9F0C8253635504B9B1A8A6D15D9E37439B3B6C459709 AD2AE0EE91BABE0A42BFFF14827782BB13D1228566DEE40D3B1208F1AF1FFE52 D9C5D1438D0FB1C6E8399205AA7DE8D94D19C227583C7211E0C38297E790D3A0 65B5821074643690BEA0968D9B2F287915C3B23A309759D67C7FE5E01E6ADE34 8C647C4F920AC07A58EB5DFB236DDAF20A0BBBAD1C6A1B70986E85778C143FFB 4D49D3FFB44A19F8DB8701B45028467DE3F59EC0327C002AA82B29A4C07DBC1A 791781F033EB45F7EACE07E24D0DE508E0FFA912377E696358164774578EFE7F FCE8CA4AB7AA483C0F4ED9F5799DFE438D466C31F37D065957DBBADE03B7ECC9 BB90488F90E7242569D3E75F964CA32B47EC587A6DEF3234BC5966E8382D2EA0 0C7243B8806892A7308160E8389178326EF4F7237EF9EF63645C37EE422A85B8 02E04D33E28B8A0AF140460BE8FDE1B7820AB6B1B8DEE3818C31633D88FFD69D DC10D98F1329A4E44FF2FD248810EC8018D100C581DA27BAE03FBB31AA92F799 9B1788F7283F59F0FA8F5EABAF3230C69D74B5B6DA3F7E9F8B9C511472BA13E8 CECE19D35ABC6E0E77042927C28DC46DF26D44B4FD002038DCC16ADA0B7B5D28 FD5534698A1A4DBDF79EAC9D45D6E55DAFE62739DE25B4C6E832A33FD194BC62 28DCA5FEE34EE9F9F30B12F850811006CB0F750859A4C8C1ECF944374BED8135 B8155AEAA8A5FCBEA4A9DB593D60266541501999376608889863A16ABB40AA2D B0F3E3602F0E548417E9FD4BD33776A870962E69357682C045A4CE9A00AC2BA0 950B48E7C16F7B72717D8B5A2A996A981683D52A3D51662152BDF84FD779533A 42E69468326582708E1573D5CC11217FE9F9A37896BC360B5BAD5C507C22A67C 239DE5459278621B5051D2E06F3A1FBBBFAEE7B5BBB7403EC9A10F760CFB424F E53F5A73EBFF93E23E03055A0E542DC76DD3C70C0D8FE6A016D7DBE14FE9C8E4 8027F2A7F2C57E5435003EE30491C9B51650E779B0D6C996E62FDF028CB66825 08F9676BA39BC5D779C02214CB1B0695CC91222C2160E51BF4F1DE2131F14FCA 505BEE49C8651C769B62DB4CA5E0DF2A309606E2BEB7960FE9F7D5A94E38E0B2 2C6EC7A2DEF3969AE0BBE7680D1A3E82C394C5FAD5475E8CA249EEFC37B1DFDC E87EBE0CA0ED30DDC5E06635814F6FF80AF039174943F608A0FF5F65E23FB18C FA2547C87E9EC00357E02FD90E0E468D1452480BDC094EA59237CAD68D03409F 38277D062D3A778DC8765D0A2684E85800D0B09ADC3726A49736CF9E8AD9F8F0 5765677E96B06886E98D4EBC6204BF6C7855A1E8BC3E514348080B6039897C54 CA6577A84613E295B81BC7BB01387029687FD09DB1D35C2D9E279C123D877BC4 5C5728AC561757BC2BC6EAAF17556B45793AF941FC01140CCACB735F0D66E898 7DAC73EEE7208161C111EFAB6415E8FA09452CE7B4C6F553AE64DC7342C98BCA C4104646B203756C53DAAB781AF2909B66BF5E80BEFC28CF50213D0F47B8C387 9EB381734FBC6F0FCFC247416ED6AD6349B58269D6D0295796D4DD4E98D9C78C D99BCC5D6A21D55D20A256AEA17F28F989215AE19FFF0A8D8CD8F75C7C3A4B3B 687DAE3722A93BE444A19319923A87A641D9893F5FD63EB64C6F72EC01E99F8F 70F3C04C7A3C4CC07F37AF88477EFA0FA60FC6BE4DB6C6AE087D024CFA4B9B1C 4DCF466A4797D782C9AF3260ECBAE803962EA59C2976615B00D1495BF6561899 904BDD110D7F08CFD6BB474491F539F9D258322F65F3B6FB204DFF2E91E78F7F 1348F345BAE82DF05C5A7A51F70257A1B64D8C18C9AD5FE472612F81AC207AF1 4757F811237D99748B9DE57ADD43B8070B8E68E86CEB905B60FC8315BF229FAB 68F8B39C26F9959068C37313AC958B61798A2446E4AF7604B6F8AF63DCB3110F 0C412DF116823A4DA1EE5AA22D27AAC55604FA2226D9F4B065C5E4CE08A7C2E6 6F3E1ABFD5B75D8F216038BBC24DB061BF85A7FFA36C323D4994DA79CDB06720 3B2C15FA3486892FEFDC2A446A7F3F61D1251F358862B9BE19F68439B79C531F 0085BF56C166A07930F4FC05A6897DD8C7C4B0300317FD6B8D10AEDE9CDB5E1D 65D317678E56452F47F8E360666723B707BFF56B2C70CCC48B652740EE481822 36806E62D54301424763CC1B55384C8D61CCF1871595B5C56669DBD8FAFF70AE 3B40983696CF2F9163E6CC5ED47386CEECA65C93FC925BDF385B831DFA2B5523 49A81D338C92DFC3928260C13C514AEA91D5D451C2417BFB520149C02D49F3A0 26B3D6C409705F1A9BD8899051498F989DC2C52F91D05B4DC35C3A7EE65E4354 E4F3A4B00B9B0D509C5A6BCF148EC9F578CDFA12E78CA60D7FD9400BDC235FFE 982549A083FD65262623D6D462C1285A7F2CA4525BA9790580448CF0677719F6 11040F836C3E1C559186F5126EC1E6233FC959E6B65B4A68123639A4BF43FBA9 20B0FA86421DACD25F7C412CB72EB9290D96E0AA025B5F6548755D71AD1D8F31 A60FA2D02CF99930EF2E995E837C53E2C730EC8523203B30A41C6FC7E1A407D4 9339CE5E777A9150C946E94FF9F049138E0336C8C395A56D48062CF47284BA93 E3730966D04815E434636A2EF92A026823022EAF8918DC37C43D193175B4541C A59E3379BE25339BFBC7536ACA8D42ADA91778695E34BD0E65805469647CDE7B 9FDACC8B5C447A14A80AA264BEEE7BE1A0B55546DE23CCE77A49F53BB9A1263F C71CD024A2B4C85E662E5ED50932FBCFD877B074CEF0CEF9C31EF7CD23372303 EBEF65E4A1CC903431D8E269B657AC8E8993DD3315755930C10D563FDAD2D4BB 599DC212B42157DD304A7A4ADF2F6107EB7B1199A5E0223E5F49F2EF00D1E340 13D0F9DA8C30D3FE72250242789EF969AD532129B13E9FA863A0954FB3409045 611B156B5C30C515CE82A9D3E9AAE86FDC4E98F91DA66CAF17D7DC63192DBE50 6F8B72F68FB0C25E2192C45806B59E95457EB847C15474F27AA4812E7528B616 37D38ED9B3734772774141D5FDE1D8B2EABC8D8E74875F100584D12AC341EBF0 5DA1B479CC90B6136125D46D1D69DCECF66BB044B327A060C145684377CF8C31 8CBEEDDBEFF674AEA7236F16201D999533159C20658E49121EF6CB53BE3BCBAB FDD3FCB55070F3FF9D89E61EB0667343C92E410667FC07D3FAF5AF784D806C55 C9442B7F44C4422CCCB24B1F35DD7B342D2607D6B21B39D6611EAF27D9C06993 90508C4DDCA2D21244AEBA5A2070866CA58290F568BA02C2FC406A6D2C3E0B48 52E128F668FED24030CD1B22F9C92C253899CA25311AA15584D37D35D4CDFE2E 26E7E1D3C24B5DF5C2705C0FDF8A3554F0B23C6CC48A5087CAE9FFB45F141203 A883070A8135A4EAC35AE48B7D5088FD24230A6280417386B5D460765B652337 53D5496911699570ED7CF4A2B28EDFA68F81915ADB8B9B0DE8CD1F082035266D 77F8E61F0D11D87711C266E5F5A7413076299D5C5E7BEDFB612A18D16BBD6AD9 6FE63F09227EFC963B7D83593727C4067F10C3E0553899CA205F3EAB1895EABC 1C858FBA7FD37A68FBF67545D8109626ABC12B34F20C622880ACAF016B1C84BD C74234D6B8EBA241DACB38C30C1EB675A103FC48FC46785DD15E2282708D0565 1820462CE03DC238ACD4D03A6519317D3F1DB961D5961D441B047E76DC8AC258 51D1537371AB2CDDA28DCA0B43A738BC226E20277D08FB9846A905FB8A29B22E D1102DD91477F6867A588B0C892D836159BB42E5DCA10F0D85932D7358F6F136 FC52940B5B6744ED6CDA9F25D08471DC6A7AE0E8462C4AA2247179BFAA109D18 B6E1A4AA6BDD1197523EB0FACA3310EC6BEEEE2FF8939676BA0C9686861B6ACF D4B9045499C81771AEF447DA4FBFD0B007C6F44A342B2700F2977377AE12EECA BD17B7F7B12AF04580AA870CD6D4102083F85B57DF02D79BAAF3DC0EED9684E1 CC563C63BFDD5A1D4E1626B6B4D52D58A30CE4D6CD46F2FA2BC26B0CE9E01CD0 92B4C83972120BFD67752252B88D6F5C357D6327FFB021606D0786AC234810A1 5DE69002A768AC5273EF99B74EC200E178205C857F9318C3B477A2297EC45DAD 48B172E55A79AA5B7CA791D3FA02544F5D1B09D688056924E75371667BCF6C2B A2175A121C3016D89EDA12D16065F299924B4A9ACDAE56F84F20946E9AE17C52 9DAF6B145CCC15D1B1C0AEC11E3D0B399C879BAF0400F270787E7759E657CAAA 2E4769598E28A0FA6FC8CA44DC474E5FBAD807EAE145121E5C1723E4558F0B15 E7F74B263E0E5A52C616127CBA1812307A06192A87BF7AC312BA98825CCAA017 B893DA38FB86F75763E779526C1D57DF080A8988C9DD206B4AF3338DF57BBE9D 0AC6324AE17112FA451FBFA67776E103CE2B06A35F12C31D6FE465858E4CAB3D D63292C96FA3F1A0654CECD3C75B2EA944C963D64AEDE4BCB845B5FA1278C8FA FB506A5404A26460A55F023BB5BDEB072E5A0F158BC03342FC7C90531CFF71B0 A2AC5A0292CAA9C7642EB118FE2B88CFDF8B8D08444DABD179A3B5F5BAC224F0 55D45A50882C4C21B4652DEE6EAA0ED52A23B3D1FF753D0912570AA9C5A5EE49 1B24507BAB792170578E0B700A005C9916D37F24298D6B248F875EC428DAC9A4 5C41FC0C1378AADEA6E109C46770FA980942E9F32E2880E58F7F0B9127FF3A91 9EC5C0C2292B5B56D3DAEA77F824688DDF4F951362E360BC1F38FDE5E65792FE F428CC836590EB423F0EFB47664C6EAC92D91626BF2D796024FE6CF78F1AA7E9 C0A5CDE148514A97466E4F3DA119E005DCDBC4F74A38439FB689576ECEA24A21 AE757D7D97931420D30C90BB1D59646C8112C9F12CA69739A2B6737EF6D171C7 0C6A4CBB78D0EF5D25140746A7499B4EEA89FF913F1BF399D5D14CE12ADB211D 1710DA85D2CB33EBA85D4ECE7B425B99A4C2C513CD0B426FF5156B5EECA5DC3A CB05925F9947A8B5998EC67765E9B91E348ACA70228085E6099445C21722466A 80DD4FE6DA52649D077F5429AFD2FBF7239D0E0ABD593597EAAFFB0C308E6F75 7E3B2BDDEBDA8B45EAC6C4CC8C9AD450B12576B988F3813FBF3EA5B996677FC2 57FCE8D6BFF3D7CD1AFC3911A32CF810B5C868B058FA4C171F455D976A549961 2B3AB311BEA0391A48A7CE822F6A98EFD7B22A4EC593951F9EA5055425796AEF 5C89E25DB27DACB16406DFAD8CA367F0974E055A5C6FA5CBCCB659ED8391C664 69F8FEACA7A3855B4B15E3A60B0CDB08DB784D10E96B195AA612317E5E758BAA 974B7C7A4A40B600810B543F66AA98BA5BB8164C76A434D1AF5C41015BAC12BC 658CBFFC88A04B3110D20784285BB6FE7966A89A14EB421A4E91D6682993B8AC 9A1EF061A1118F2A6AA900BCFA8575DF80F53E281F80AA59F6EED2FAE5F3E99B F961A09185FC062285D8427AD4D342131DBB053948C1D51F409DA3D8F040CD39 E58A541037FEB8EBB3414C530F3E791CB69788F2005FCD1B22F2E7D1F49A062A F5C597627C70DCAE135155BA2770712AF568171202375885D4C779751CBC1BFD 65CC368A75654B40BC16FF479E7DC7C0CB4744175AEE0A2E155868E890DF8031 6ECFFBC34FD4171262444480900A0318766DAA55B0DFD59F5D80AA72018497D8 BB562B6C527D4309E32153892DAF3EA73E14BBBAA4084A705277BA52F5C3F14D A9E19F97BC1CDA57969122076959CFEBDDE572D7E7AF47D15F24DCAF597D8484 975BEFBEB391C81E19BBDDAFB2B62EC028E5BD2B5CAB0B078FD2A5E991F17C31 992BC7E197125C58AE5B8F8B5E38CD341213AE96FA1D05FB18120E5302622079 8E2075F4189F1D0B9B3C8C9E748EA7F4169AFBC49FFFBD4DC4899F7ABE2AB14D AB1FB511498F9C6D94A5C55943DA25D3EBC3F84E4ACAAE59F81F389B00DE0BBF 3A4C0AE537F666AE05E7635FF0B1FD7844822C3E946B0A5229B8B4DA7552C9AF EBE8976C88CD8F607E39ACE539BBBA0F768229D907BD214EFE7660799D8BD79E A311EDFABB2D9297778B53D0EF1689FB6099E9FBEDD9F352A0897DABED94C484 CF7679B954646AFD0CFEA0E558152F61FB0084307FAA943B4DD162D6359BDC7B 1845520D5F8E0139082A5E9DD2AE7B262E257A02810272A1C9F635973250C361 7DA3FFDD10E042B1908BBC47A05D8B48E3C4F8AC9F785CBF1D259FE38BAA9DD9 2DB0DEBE578ED5DD5FA0F6E189874757B0A8AD92E6C79512AC5FF6C65E61B9FC B36CA9D7FDBFD5B731910A1441A4D6128E98809864C7216ECF93F573EAD7B784 35538E16D19B45C4F7C120ABF1059446ACB56947DA9A674CA8FCD408DC3B7696 BDAA203635560B4411A65D97D753C5E83C1F36EA4FFC860E306BAA19DD11F627 627AAA0265DAAFD14A78ED27E550980D3F7EEE84FA25CB01843C2161C65BD322 DF8E3456C506435ABFB3CFDFB2F0C3E71C1A53D077155719B4E08CA1B99F5C8E 05B67EB772EFA6332B7E5E579AC5E39915CBEA70CB19FC8D3E05E61E09962969 29CE6E34878F3B3E260F2D8B8ACB57DEC408F7D278CF1FCBB716BB3C5AA85E1F C73A68FE7DF402A931A78A08BB82E3056E17AAF9C04BA1B0981A902B84153B85 5FED7911417F3F109E7F745022FAE5758448895BE18441F3186612C31E8A070F D1CE5198D5B7EFF4EEC51AC8A03E8DB582A0B9A2CC84F62A054F850BEB3CCFFC FCEF23D0AE516A971D663993BB7C401543B44CD0D0FC0C6D95B49BB7029B19F4 6168B465799FAAA64044452F3C6F85108943A3857C9ACFCBA6E338870A795B22 F1B2DF1BF10AE533A3F4D28BCCE9AB183BF23E70F052025E65C55EEA0C0F19D5 3134C923B21F2AD2774C45602873DE3773FCF9436880AC6389C06EBE41F4CC7E 3EA4FA9D6FCE623777A9C1CBD3B711311A51DE399EC93A657854CF5CFB1F166A 965C7E9355D5FD81A8FD2ABFD21AB410C1EFEFD7BB51FF711C45107009B143EC B575CF5A579B6AC930BBB914A20B2F5B828BABD523EC188B1098FB24048ACA69 8674DF5876477CF746D72163161252D3F8D7DB9E7E4AE7F178C76AFE0C5CDAF6 7121A25003777599D734E15801AA8D256C848B8B9EAEFE434C06EC988A7E5A01 9677A2C40EE0D5E869CA4229345F278256275EDDE65EAE8E51764897061EC0AC 2E80286BBE365CBCACECFCEA29398143897E3DDD87921190FC333B4D25A57A38 F06EAE34A5EBCF07A2C83B490C30B28D935B0F50050391FB1571A6CA3AF091E4 AB9E1AFF7B69FA47EF074C04E6621941A2D0AB724BBCB024449982026D00E7E6 AF96E140BC9501B83CA798C30758CF84C77608FC0BA268D18BB92BCB3CC4EAB7 A137B8555EF2ECAAEBD0D78593AF95BD52B2B5EF0E7F41D2BA32760C57F539B1 4E2CD97094FE164E5E1D89C46E64A44D4C8D40136221447656CBF7874BE1B228 299B4E6F49AB4BAAE110A92BC94406C67C63099F80A1BFBF235EE4A1E449C861 918D39D9E496935D18A774412B5218EC1D0ECAB047CBAEFDFF05960845A9A763 7674B25B5040040AA828D788FE74C8E335CCE5E516BCCBA21E9ACA925954268C FA2A3045741A8175AC21B3BF31A696C71ECFE01E5F255C27E3DD93C27BCC0E96 AEB68B7C18E2D49AFC0AF90940A7E53AA8823488E8A25588BF96F07055141B4D 0C701DE3A35E11D4CA69C833D96D9A77CCF21CD8E9B6A9CA875DA0ADB06DA296 E15334919A39343E26CECC76996D5F26026512DEEF68329D359932B72189CE94 BDE1F1BA2FC2AD40EA7A4F4FC3B2F0FF1CBA4921A021880B2E90E399F6E92B2A BB3B45FF43A2905768620DD90042666379CE2A1E950FE69AB70361B35A208C50 F0EB5B0F7B965529D4BF4C5F7220269B4166C3C50C16B76EB4081ADB0CC81577 C2AC497F1BDC58DAD21B849C5088F1B53ECAF33BE4CA3D0219B936D662B36986 4F9E9657C2804C25840238CA24BF97FBC3057DF22B69B5F339B9DFB52025618B 298D57DFDCFC8D06B1134813E39637F0C04DC21839723F7BCCCCE116617DCBFA 965B2F7A1C24D71509A539109F55925F494BFF758A59DBC22A5D56A7BCD11810 1EBBFDA096F61B9CC1A6EF66F1537E69BBB4C3C116009430D082E20A3995C311 56B059CB28432E8E2EB53422DFB30216196FAE57C1646E51DE093C4A0B610F32 9F297C1638B73CB399F81BA0F80E69B1DF911562F11241E544C4A5D2F3910785 1DB77C61F639430B63B578D2572C858247943312D7C1BEC88A6A30F1514C6E97 0310604DA4E66F1E2B2420916E14212BC9BBA812FC18CFF334B9A2C94F487A6E 5715896CFB359652D18B14337727603407FE9D0B58BB1C9D1AC623F1784AD716 94F676252E2A0D852E7AE8AFC5214AF2C0D8A71346D38E2B382AB7DB9F4B8ACE 7EA1FE15F309611F1D30BBEA9C18826FEB123AB5010FEC69CEBBDF1C3F4382FC E577AD1CDD5D5EF6DACF272326254C70976B6C854976636C1E9943595B64A040 37D2A3CEC268CF7877D836A2F1C7D63EC61CF75AECF5A7932001B14F118177F4 2EE5F02598B5643BB82B943FD17ED05C76ADC9F4FF6694E17B83BC85D6BC1BDD 21DD59EC57735BE29BEF7CF446FC12FE5929F2A79F9AAE4FAA851C52037B26EA 3208969EB19341CFF9EC32F73BB1C4C7A6F77CA3E89224316062CE0ECBB223C8 AF9D4BDC5129819399D32E692EEB23C1C2A569AA431C3F8C367030F77A2E4553 281420E810BBE7082239F924AF335576739D5D27257EA67C636EDA0B0BCDFE64 D06B9393485735CF86458D0E9442358BB5CB6F91D26E9DF402F6F6C0B13C9F63 A5BC51AC67F5CB9A1669F24EC3F0A4683DE9E41C2274364EE30374DA5230181D 0C24D58A3B45510DBA0B636CE9ED7137A4DE32F3EC755738217F4A39D3C0343E 98634B3CB3B67711E96E79DB6A814AA5E326AAA8F07C53E041F3D1E386D81FD5 107F5D1FDBACC2DCF57679552645BEA98EEB1A35894B0C5C216C8870E752BC8C CC3BD3C7CACF76A18616EB1BB418D2DE392EF590A0C188854DD03C86D9E3C620 7478CCB0AF8D84FDD8AF0898CA686B57FCFFDFE08E14D845DC9B6DCBB66A7303 5D7EC2352736AA6D01530D539C7B33DD32C752D25997B971D193D239AE025820 A273384D03C8E19C0D835140F9FA4D43E774B1936453696EB9AED5131A8E01C1 37AB1CFE7E9E1E153888FA4B7E95D850ABF25FA4DA82C37672C0D7CC890DF7FB 3B30F50009781C4DB940B0975ED636674A94E76EA8ECA9DE9C7F90ACD625D762 9A86CF982E957696DBE7C5C31AABCDF569C12E921349072B9996A05D03EF6073 813C1BDE6F068992B9593E51F875A2E54531E7BB25EB1B74D2CAA8B36A51E7FC 42FAF15AEBC4456D56D3ACD4B4E093E60F5A0F4BD60F06946A5B6187A07078B7 8F44A122AF4739B50EA9EEA22654A32546668E36FF450A1DE91D9B84565010F1 C556CEB5DD3AB1FAE39C71E6375127E77282314993832DDF49068E4985AD0998 DA7698352E841BBFFAA2CFE2BB43D1FB8B13421FC9E6B42C0F5C1C3C3CC9831D 0D8BBCB81CD3CD360E6EE541777ED330A06D426AAB21E7B5C39D1A2AA4A44059 BB3359D210C619EE6BE0EA9DB37589334EBBE23665F86DD5373347DC5DFA61C0 3749CD867EE020A3688870DB9E94ECAD365B8CDC4447E269DA84B70EC14BBA34 861491A41B1A6874FEF314851D151CE92F99D991246BDB0E694EB09BBF1F7ECA BF5BC3FDDAD39630C926F0754F5C450429AAD4098B8D2E47471E31657C133774 AE4EC7A778E2834625AB6FDF9FFD63CF570EC141B138E70E9EC7E39A5C67FB30 5D946C92A4EB1D347F6E5C1DDCF4DC7AACD27BA280CB62F233EF017D31FE9687 47B0C9411A4D7A64260B89B0F5A3C53FAF2B95BC28C3BBF08459F0592187A76D CA69563261D0C636E570B1FA95EB42374D60A5DDB08D4ED18F302A1ED6E96B43 B9361A148FB74CF17D05FD668A70D1BA79214107ACBED3361E9B0694FEE7C7E4 76B7A9E808C091EF49A4BB082DE1761053EFB1A243CCF8EFBA03A397A4E4CF07 5C3BB0E53DA2FECB065079AB30F662379E0B038B8C4C2ACB6B5042F28C8701E1 8AC0D0C99317CAB74DFD6FF3CF420081A68D22D267AB86A52E5E8742EA38F7A4 0D0A684B8DAD7395DD421D427E46F4D871B727C80FC2E2660B0C4AB3D95215F6 50800A67B86879AA33654C92BD87AEA06E7D7ADFCB7FB8D5F389158123128460 A83FC686B568604AA4861EB1C2B49C6FB4FFCCC95DABD3A38506FDD2A3A67B43 8D51DB93A253B2FBD4004ADDB61B0B6C62552C7C28DBD622798B271AD8A932A7 8BC215250C055F8938EEFECF6BFB2BE11BA7A5B35F34C45627EC0E0127B2BEF5 AAD8AA27C1A1C61295041391781984EB7576F97B004E59B9A63055E072C02738 504BAE787774480D3BF1EA85F5AA12CDDB75288A64E168F46F5E50696D478DC4 DFD7D4A60E525A10C5EBC6029D35B2FBEA564C07A4FFD430EC973EC06D755E3A 24146EB62B07EAC13EC983B2A6A07705EC0A0EEE77C41DF0F2C133115859B8A6 F4541BFE5C7D6E05A7B3FA2F9B04EDBF7FCE92EB4C24AA1D099B12F611908AFA 6425D86C2217F6852974436075C0DEE3C6FAE89065D549910CB66E2745B5 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMMI7 %!PS-AdobeFont-1.1: CMMI7 1.100 %%CreationDate: 1996 Jul 23 07:53:53 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.100) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMMI7) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle -14.04 def /isFixedPitch false def end readonly def /FontName /CMMI7 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{0 -250 1171 750}readonly def /UniqueID 5087382 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE 3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B 532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470 B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B 986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE D919C2DDD26BDC0D99398B9F4D03D77639DF1232A4D6233A9CAF69B151DFD33F C0962EAC6E3EBFB8AD256A3C654EAAF9A50C51BC6FA90B61B60401C235AFAB7B B078D20B4B8A6D7F0300CF694E6956FF9C29C84FCC5C9E8890AA56B1BC60E868 DA8488AC4435E6B5CE34EA88E904D5C978514D7E476BF8971D419363125D4811 4D886EDDDCDDA8A6B0FDA5CF0603EA9FA5D4393BEBB26E1AB11C2D74FFA6FEE3 FAFBC6F05B801C1C3276B11080F5023902B56593F3F6B1F37997038F36B9E3AB 76C2E97E1F492D27A8E99F3E947A47166D0D0D063E4E6A9B535DC9F1BED129C5 123775D5D68787A58C93009FD5DA55B19511B95168C83429BD2D878207C39770 012318EA7AA39900C97B9D3859E3D0B04750B8390BF1F1BC29DC22BCAD50ECC6 A3C633D0937A59E859E5185AF9F56704708D5F1C50F78F43DFAC43C4E7DC9413 44CEFE43279AFD3C167C942889A352F2FF806C2FF8B3EB4908D50778AA58CFFC 4D1B14597A06A994ED8414BBE8B26E74D49F6CF54176B7297CDA112A69518050 01337CBA5478EB984CDD22020DAED9CA8311C33FBCC84177F5CE870E709FC608 D28B3A7208EFF72988C136142CE79B4E9C7B3FE588E9824ABC6F04D141E589B3 914A73A42801305439862414F893D5B6C327A7EE2730DEDE6A1597B09C258F05 261BC634F64C9F8477CD51634BA648FC70F659C90DC042C0D6B68CD1DF36D615 24F362B85A58D65A8E6DFD583EF9A79A428F2390A0B5398EEB78F4B5A89D9AD2 A517E0361749554ABD6547072398FFDD863E40501C316F28FDDF8B550FF8D663 9843D0BEA42289F85BD844891DB42EC7C51229D33EE7E83B1290404C799B8E8C 889787CDC43FBDFE1B4A245C9AA8693DE3556FCF9B5558458BDDB03416567965 FC0550B129181FEFBB252A98FEB70B4B4C56BDF24B8371CB40F4D605B05CD589 C4DF276271CBEF3E4E85535A5A2186852825EC587F6C4BD6A9A8E65CE4D34D9D C45714B3CC411A513C2F215936DEEB9F8109AD88310DFEFCB0D26F4112E326F0 F4EAC64BEFAB8391400AF8632E73BDBEC6BB65349A4DC922F2893D7BBE241297 7DA42D833015C32E17C04AC66A0FD7D4A290977DFC3B72310C4D36D9F8E68327 B062272CD499264C920411BD9A2D83E5B16F383FE738BE7E07214FC93574CA29 909789B5ADFE4703298A0FBE631ED816542AE4AF136DA60EB371E9ECD4E004FC 34773810DBEBEE8DDA4EE0DC4CC9F9AC21A0464E9C3CA5E6A1EDC93C607431F9 D2A9FB859EE8B754A134C21CF760863CABC28B074176876619CA7D0724F7C2C8 D9F9E817F689BBDD5A7032989CE5F5B63B6B51868C85B9254496A3A5698D6817 62B04A79FD3326B1BDD712D492BB10CDA5420AE4BD7A66C35DBB31C111707DCD D2F424EEDDBCB3BA43FBF0F07A43A2FF668C17143EB1EF5D2C571D97CC2B57A7 F3A6627B748DA3286A09962E987A77BC9DD34D0E8E42102F65D6F0A6FA6D3AF0 7A8918150E5B8E7CBEFACBE2B2AFA895CCA3FDB813AE67668A4A1E1E86B6C00F 35AEC33C1A039D7B661C5630E09523D3EBD2F21B4DB3DF4FACD7B64142FC5A2F F1B7FF144E2CF3E072648AD90759724FA34121572E1FC40C18AEA8DA147BD969 74D6F6CFC3A555E3CB74A901FCD766B995824FFAD71DAAA6F0500A4076AEB6AD BD33E362372E407DD79D6EC1194C03BFCF638C89B05828017D2A68689F059CB2 DD870599DEF7B9FBA2DF3E311B72F457F25D7265385EF9EF3C9FEF433D0EB312 33CF6D54297E546FA6A3A8DF964E0ADE5A49DA01F0B3B958933E04195CA3251F 759F32DBC3DCDD8393F21F55912AEA002029A826E6BD13F0400DE54DD9D6728B 8D4D861BC7530D0D46720EF38229EE77D6775C037FF55741FD15C01483641B31 ECA6F2632BF13289464DD4CCBC308AA336F6EC413B7ADC09EA24FB06E465907F 84974072DC6CB5EF7A3F8D01663995A3B2ABEA4D389221881DA2EABFE45BB194 62F373A41A28993BD82FECEF3C82DB11F99DA6659D62805ECDA8ED5079DC2CCB A8A5FF45B6B6119C700874CDD9A1CB319883CCAC01BD6B8C27696BA8C45E1277 6B4EFD01A4A3518F2E5DED7A3E6CC5A79AF49CB65CF61D9C50511EBC93A006FA 906881024B17D3B6D07C6D18B7DCAD49CF1EE23FBD1124A8E3033239236E4E9D 7E4839C9CDF0C8FA4872CA6060EDCAE31F606ACB73421A7C0DA3C4C352485AE2 3E31E1B1417AEAE71E8323B8197B1BC4D74A22B5528D2268B77946A639735095 CFA26F46851D46D8902B06F5EF6E91D38880759DE781AB443391C643226FAE1B 4D58780F1F34104AD98C2883BE3BCF4248254B041DEB9E70A5604C5DA78CC775 F5D77F699E23097F9D3E788CCCC526DA123F7112C7CBCAE598B7F80782D07123 B947FDE50FCEAB8EF633E5B8563147E4CC5971C97C073339FE87888C8EC28620 F78CA9A6E9630C6982B17B5B9E8C4F923D49EE9F1F9EFDDD0FD9B37086E4BBE4 7A89D8DAF398794935035E383D51A9D8E18D237FB9DA5116558139225377EBCB 83ACBFCA2BABB904AD349A13E86FFC8EFA74E21E77B49C9BBC0B5465644539AF 1DD2F4BAB0407504709BCF4EB2DAA3BA4388FD8B2160274692C8E7DA7F57169E EBC82DA2F768A71B84327D2A9A98E37FA89EB18D4323D10525D6F3E78F793179 5A287404C3CDD197C47E369C2BE4A659AC2BE1A65D1DDA4549A15299E1CE456C BD4426F54CA70BBC4E108CBA80503FBF4396735797887B7DAAF21C1C0E35BEBE A1AA106EFD3E9D4FD48CB3B621EB3960C5296FFBAA7A2AD9C4D36CD6ADDDA602 7381B5594101314D6DBB24B441BC2D02C5D043B596634F95BB0E6FDAD5999FF6 429E3217A3DE91B6580ECECBDEE0EAD3ECED8D0B1322992137BBB03546A763B9 7E42078B52BE1B14538FA77D6B77DF4712350864DFBECB7C7613DE1EEB0F02C9 8D3491FB010A04710686B274B4CE8CD9D567C0F1E9A9DEA0BC22F3ADA207D5F3 CC74D68FDB75A661B058AF9602CB37103F233A00E9F9C56E06896B8050DC536F CCEE6C8B78573195AFE9020B5C 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMR7 %!PS-AdobeFont-1.1: CMR7 1.0 %%CreationDate: 1991 Aug 20 16:39:21 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.0) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMR7) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch false def end readonly def /FontName /CMR7 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-27 -250 1122 750}readonly def /UniqueID 5000790 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5CF5B8CABB9FFC6CC3F1E9AE32F234EB60FE7D E34995B1ACFF52428EA20C8ED4FD73E3935CEBD40E0EAD70C0887A451E1B1AC8 47AEDE4191CCDB8B61345FD070FD30C4F375D8418DDD454729A251B3F61DAE7C 8882384282FDD6102AE8EEFEDE6447576AFA181F27A48216A9CAD730561469E4 78B286F22328F2AE84EF183DE4119C402771A249AAC1FA5435690A28D1B47486 1060C8000D3FE1BF45133CF847A24B4F8464A63CEA01EC84AA22FD005E74847E 01426B6890951A7DD1F50A5F3285E1F958F11FC7F00EE26FEE7C63998EA1328B C9841C57C80946D2C2FC81346249A664ECFB08A2CE075036CEA7359FCA1E90C0 F686C3BB27EEFA45D548F7BD074CE60E626A4F83C69FE93A5324133A78362F30 8E8DCC80DD0C49E137CDC9AC08BAE39282E26A7A4D8C159B95F227BDA2A281AF A9DAEBF31F504380B20812A211CF9FEB112EC29A3FB3BD3E81809FC6293487A7 455EB3B879D2B4BD46942BB1243896264722CB59146C3F65BD59B96A74B12BB2 9A1354AF174932210C6E19FE584B1B14C00E746089CBB17E68845D7B3EA05105 EEE461E3697FCF835CBE6D46C75523478E766832751CF6D96EC338BDAD57D53B 52F5340FAC9FE0456AD13101824234B262AC0CABA43B62EBDA39795BAE6CFE97 563A50AAE1F195888739F2676086A9811E5C9A4A7E0BF34F3E25568930ADF80F 0BDDAC3B634AD4BA6A59720EA4749236CF0F79ABA4716C340F98517F6F06D9AB 7ED8F46FC1868B5F3D3678DF71AA772CF1F7DD222C6BF19D8EF0CFB7A76FC6D1 0AD323C176134907AB375F20CFCD667AB094E2C7CB2179C4283329C9E435E7A4 1E042AD0BAA059B3F862236180B34D3FCED833472577BACD472A463E26637C66 FAD3F83D6DF42D2272506260D43775E8D92B32BE0179BB8E21415FEA219EF686 8EB62AC5BC33B15E0E1249FB27889CD8DD6FF838D9E4CE81A1F89248EE5C6E00 E9351F417C3C55996EAE1CEA76B75319CBF4856855938F50E3845300727DE90B FCFA8A684E95204A1346DC2567F1BE120E7490CA61C54E5BC0BA2B6D9F08112E A954FD0C91DB8584D54D15D194E30583E1B0311ABC67A693AD0472D4A8CE4F4F 9E64FB3AC1410C80DE0B686F8FFFF20F77EB6A6CE26ECAA2204052EF7BE6944D 0EFA461175747A0BE6BFAE7CB2637B564AF2C02987310CB7EB65E929B43F0E00 309C758AE1AFC4B6F2E69CB8DB4621772FADDBE4D5641D7DC8AB5351F4BDA5C6 50B3B4F1EE91155DFC1414EA242BCBC54FC909F9A8B8960F286EF1F49317332A A9903C3295A8539A0E18B0E85F426000F466FFA8FBD0C433123755262DEF1699 D78FE4F657B09D527E994E0A0988D2EBE1648A08FB6F4617A8EBA65A40691149 72F63C7A4124F2097EA2E6E6665F1AB0225CF596990F8EEFE38B4A3898C85D72 15B4F30B261812B73E1896C68ECE0465FEEB6159D4150F3A4DDBE88583835528 941B6042812A00536FAEAEA25F8BFF354AE9143794D42B482C858EA2E0E24667 C317C284D668E45CD9E4EBC91616DB44DB28533B351DBC4DE98C31A36D20BA61 4DA8C5B0677CBA4ADE1B01C6A93E76B0DEA68133F5138936EA2A73311FD823A6 5A0532DE81BE456AD81A1B52395796F492D4A0E9D154297B00C8BD083CDE30DF C8B2984BBD77517EF6DD87ADE3414E80858F6272A91B59A39A43E502D75CDA9A C5E088AE15C67ABBE4486302477D8056B46C72724878F8AF0352A83765F1FB67 09D88A81FE24A4864FB41C7E3023F682A6CAB2BA9AF690A06457749789D23F6E E92594E0720DE2EE2E57B5AD037A89943E460EC7E47F5862829EBE0991C6C543 7020C55CFD61009FA8F15568AD317008AFA51EC8AF9CEADB90DEE2C540B376F2 7C61C35E30390DCE5CB0BEF790846794577D515A37526DAF9D62213C73F2C22E CFBB25F9B2EC7732F3A1A10BEC98014B6B521BDB1B8074319A7EDA164724AD8F 254E5F611973B5F131AE37215387BBE057015D667C8E99258800C6670A815600 6B530F8191DBB50D155A5A0DF269B8179E95BA0E96BCFF5777C5989F7E1D9087 E240F04E89FDDAF556578AA562634332B4A9F1FAA00C57FA11DD62A5EC2C1FF6 F3FF7040F886D0B0D16A766FF777598DC00891302596A4C4CA271055A3445478 4EB67644B2983A9A70BCCF693BFC4237ACDB9AB38489F0C18CA980705D292B67 D417A019FA6719AFAD1B2D570DC644A8D052DAB09E2BA323A9050E9C65FC0F21 CF07A5D6C5B7BE30D428D0CE882F54D500E00C8CC3C2532C0AF905E422AFDD52 B78FBBECD6799E9655CBA7E93FBE8F4BBEDDAED632C44C2AB537A5CE8B04D160 371F75F289812D72DB2AE79ADD55194951723095335DF364B18D7D02127AD5AB 743C2359CC44DA53970E8192402A441990EF2B30DC0FDFBBDE6C437B5AD1C426 F2A7656F93F56DF125AEF944B77C85DAD08D8F35A9D190BEB8C70A010C0EF4DB 0092990008792DB97A23AE3332682AB935BC3D50E03C38F54FDA739B95DFA451 E25B228EDFC960C2A7FEB84857CD52783BA2F61D277AB6B90B69A9C4D24F8991 5E37692EDBB068F0606D2DF59D9A8F7E47C03A3BDA76A19B0AE4A02E4355E48D 63A283A4B836E1F34DA4BE60079242CE55806F71DD50C3EC911A638D30767EED 3EC9BC3AD32F607E4E58A23CCEF23C4E25F89E87E89110F12E28586DCE261234 5DBA861A70FE78EA6D6D3B2AEE3EDF1904C2428D964E9FE1FF96E05DCCB66CF8 1A1554EED0BA53B010C79CFD2A19334F7EB52CE40FF9672F89E3D9740069235A 1D22114AF8CE7D621C5A03C908CB5487B1C3E8B30401EBEAB3236F4FA87B4882 D922BDC974601C05D46019CB72D459EB3BB41B9D72BE072074ABCF15654803F2 030D7D7F0F4C7C20AE6897A5152F896389B74F939A8123A7A2494F301D07706B 01600ACD60D84236E6D2CDB1E5D02AC300216DB172A026C49AD933 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMBX12 %!PS-AdobeFont-1.1: CMBX12 1.0 %%CreationDate: 1991 Aug 20 16:34:54 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.0) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMBX12) readonly def /FamilyName (Computer Modern) readonly def /Weight (Bold) readonly def /ItalicAngle 0 def /isFixedPitch false def end readonly def /FontName /CMBX12 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-53 -251 1139 750}readonly def /UniqueID 5000769 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5F0364CD5660F74BEE96790DE35AFA90CCF712 B1805DA88AE375A04D99598EADFC625BDC1F9C315B6CF28C9BD427F32C745C99 AEBE70DAAED49EA45AF94F081934AA47894A370D698ABABDA4215500B190AF26 7FCFB7DDA2BC68605A4EF61ECCA3D61C684B47FFB5887A3BEDE0B4D30E8EBABF 20980C23312618EB0EAF289B2924FF4A334B85D98FD68545FDADB47F991E7390 B10EE86A46A5AF8866C010225024D5E5862D49DEB5D8ECCB95D94283C50A363D 68A49071445610F03CE3600945118A6BC0B3AA4593104E727261C68C4A47F809 D77E4CF27B3681F6B6F3AC498E45361BF9E01FAF5527F5E3CC790D3084674B3E 26296F3E03321B5C555D2458578A89E72D3166A3C5D740B3ABB127CF420C316D F957873DA04CF0DB25A73574A4DE2E4F2D5D4E8E0B430654CF7F341A1BDB3E26 77C194764EAD58C585F49EF10843FE020F9FDFD9008D660DE50B9BD7A2A87299 BC319E66D781101BB956E30643A19B93C8967E1AE4719F300BFE5866F0D6DA5E C55E171A24D3B707EFA325D47F473764E99BC8B1108D815CF2ACADFA6C4663E8 30855D673CE98AB78F5F829F7FA226AB57F07B3E7D4E7CE30ED3B7EB0D3035C5 148DA8D9FA34483414FDA8E3DC9E6C479E3EEE9A11A0547FC9085FA4631AD19C E936E0598E3197207FA7BB6E55CFD5EF72AEC12D9A9675241C7A71316B2E148D E2A1732B3627109EA446CB320EBBE2E78281CDF0890E2E72B6711335857F1E23 337C75E729701E93D5BEC0630CDC7F4E957233EC09F917E5CA703C7E93841598 0E73843FC6619DE017C8473A6D1B2BE5142DEBA285B98FA1CC5E64D2ADB981E6 472971848451A245DDF6AA3B8225E9AC8E4630B0FF32D679EC27ACAD85C6394E A6F71023B660EE883D8B676837E9EBA4E42BA8F365433A900F1DC3A9F0E88A26 30F5D8CADBB3C1E3238EB07CFA0721C8370278CF3A76B741E00E5CE0FB24FB6A CB19AE8B78076E79F34B90E2710710766D7E7C90FD0F5F8EB484408C176D1DD9 A6583C0D547E269B85AFA545C912057064D963A98C21A4B31061450DD09E1FAA 303AFACA176EF65939CF1F21E9774EBE43C434ED02DC2D4267BEFEB6101563D0 3F0BFD390A6CE04A4D7BFDC8F7FCBB0F350B636B4F6203D9972005456C97E4B3 B898EDCD7A5D7964DC1F3D8752513F328A7BF73AC1B6E171662E7922D8D849C3 7FF8AC6E4500F1B5595EC87B319AC7CE3929EFD75A547C76145F2C7A1589A90A 0E0C2A8F5ADF56B03DC9AF40AEA131B348A225356157EA953BFB4E5C26D34C38 E51B775DBF7E28FDBCC781B33C9257E9175C93943F62162AAEB15CB0FBE75D21 A6B8187254E09711D2FB4E6D2232ED083FDC57A02853A025F0BC654C1B59229D EEA840086C34B28B82AE7A77C660C1D2937A8756540216E48193BC0A7DFF947F 85F2F1C359D68E79F0D96CA5EA2244B5D8D04BBCE3B6DABAAECDEE6FBCB68406 1374E5949FC944EE20AE973E55ABFC4E93D7635321AC74D21C076DD13F2FB3C2 71078BF3097F5DD9162842315193805891FE38C08051C721B944A94254795366 95D800EA733BE9E8A507F1764A1F86EE5380C692D9DA0083C934488A6AB015E9 0421995285CB83B9A187E780874FAAA4F69808B455FBF6870B5ED4261D67F3C4 0EC4D494245EAB1E8EA8093D3E413EAF5AE84096E3A7874DE43AD2F0E3B4CB92 0D8B1EFA70E2A0B208F34E2BD7698FB79115991A6C369B93D13B43399AFAF493 B0B07F1064C2B2DD64B7315289AA8C691E31F25802D337861626A1A1EA617E62 97BCA441B0D2F15131A528DDBC036D1473CD66A9B773DD800F11E8A9C2003150 841823E3016625F1C2AF47C16C6A9CD754D51222711482BC13E30CE20DEF1B45 A03180C5137C6F4D181B980E73847ADF4D36F2B6E09EBD56A2F50DC6BC6C235F B97B1B56B9759DA8D0E25F712B48B758D7D661204333CB85D561F4F914E4075C DD4943411ED3D28DCAA204FDC184A21F1025B3B168BEBBB5A17F1100D8F2D4CD D67D3EB80E6F0B79872A50CFD58A17013F1D026CC63B116FCC6D0FBDDD429FA4 79E5BEC79088028F32F889DDCF269DC3C9B1CBC945B4A8CAA33D7E903148AC52 BBE580F7CDB7173EAEBF376FD6F38BE1AF9C6B5401720B95E62C1A2479DDFF08 217789D6CCD0D27A82514797F58A16755EEC971F2A29E746B4FB7F970C670DC9 C1E78E9802970F2E8EF4B381731DD411A4AC086AB091F8513FCDD5AD1AFB1D59 2F557823301FBD5F7162042D02D6C4CA077D8048EF5EFB378A7702B1B95059D1 40C13DBBC6F63007776CF69A86983B7B35DAB2C6B32F2020933539BC32A50B1E AC227A45C454F46498E29D37477A6F63339D329D01F0A5953E24F0DCF0179C86 E7B774E7D13DA6C0B09A1FB25B8F5AFFEA91299A87AE72E2763ADF9479D6405A B968D8B77A436C61147C0CF2D1CF07A93DD23C9503DE52316DB84E0231DB8C3A C9A62889161116132C1FEE49787A7DF119DD9CD058F5000DBADAD308F58A493B 50211A2913D4086A7C2C3761D4DB822DCD8D70288B2E390CF48A56ABBD55B40F BD8F1A2B5E2290B37C440778C5EA693899B4EA85A00BB58FF7B3D835C5B8A50A 3082D9A96DF6276774B368BBF88EB5E9DC6EAE9335D348FB82D4000C30FF299B B146E7BECAEC9DE0753A1D101867127E98C2CFA902DDB4B64492C6B0E65E9F53 51E463808212A7B251CD4FF80D0055CFD4AD3E5DF5DA4B5559705EE6CECD8AC5 22E6E8F0B57976131C3B6E4BCE3C67180B5F698A5FB07AC238E0A5D185F0DC61 7B12236643732923BBE3A8395DD26B0D43F96CCB4015BECC01D50B4A875AA021 7AA10A6E431E3D10C03D83083D340C163F6A37C826AF07C7DA9262C4EFE3252A 1C6018611FD335933F6E06E20B7A09A7A3C3EF4C066F610D8F9B5FA2EA09BF22 F6361F6D7438CDD470BCBCC0F0FA827888FFBC24407428F21D38C08C063CFDEB E133EACB960417CA421D18DDE1FB21EF26AF44571515E31C9A61B050D58FE9A9 87E859BD810AA8ECF3FDE3CB45E212405D00E25634C3738DE3515DC420AE0620 3AE7B182A10F1E8DE2D115DB10931F644055408641D594C927725F3C7CAEDD98 A4E1BD57D94645DFC741C60347513B367DD8DA5F65040530CA5744C74D455428 B2A4D6BD384BB9981F72527E6F7B85D6EC01D41219F70BA391F961248BEEF928 A8983C7A976E8F9F09051A7E7426D2D3D4B88D3A07C0E80B7D5BD0BD8AAB5AFF 71112E4CDBB5C9D3D6E73CD2ECF485033E7E32F52837DFF854DF7236F7DA95CF 060B34D9BCC0BCCB0BFEEB4331176974367EBE22109FD60C89AC0C1C84E31E32 86C97A5539283709AC5FADAE7EB8DBF5787AF303A8A971D3DA6858BDA8F605AB 81AD5366FDDDFBFD36503DF0DB417B7356EA8FB0EA58E64505DAD398D71D7270 2F11B64CA4FBAC0F448124B74581D0F4FC21690BAFD3A5FEDD3E6B504417AF8A B17DBE4DA98E6E7A5FE2DFF44790EE5D9F05EF7180F7B4D64A2F6B43D5ED5605 D4C4E73880569799FD29764A6AB640DEA01FD765AE1F1275B1E8E4FB75E65953 0F6DEC0ED252DDE762AA379ECE5174C50BF0481ADD83584CEE21CFC7BD081CE1 6139CC6ED8847A7B570224E40EA615B0D15EBEE2535B147C8531BCFDA9D03CA4 5DB2014B650E2AD71E70937662021E5E1B8928FB2A9A8F535467AFA1C5C2A0FA 798B87C38D5FF855F8A6A02C9D74978B144FD57CD0B62FA4A3A567BD985F539C 3A09AB9BDC4359CA7EA40582FF9BE0CCDF246A97F755FD9268A814E66777B4A8 3248D31E578E354B946FA2BCABABDB95E448FD3079F1E7FA5E6C2A3B6BA730B5 A0CC83CF9A379547736474B389B43A78DBDA1F78EDFA1CAE63318EA22C83B2B9 9F8D976FA0830FD04F8437BF285FF820B15AC7714899FE14E53015274430DC17 790CCA561949BE3F8BABA4ADE84F0ECBF3CF0AB23956D9AE6C03C31F5B73DAEC 71DD3E1F9C899BC077C703E96603F86658D6AE4E4B54C94453E6F26B9EE0DA61 8370660060B0F421F4BC8DD8B39FD9DE2D548C2EDBF92B4BC0F17B854FE3F848 653BD115CF669CAD7B433469794E70145AD5E3B4DF5C937EBDA38B666803BA4E 08A258E4816DB2C31CB55C8196CE15043D6CBE8067901A07C40579C929F5148E F8987D21CC0A11B0EEC52DC36895BA348ACBF4FD15402C68F6E3C16CCEC32E67 454D842F4898F735231B86B06128271B41ACFC16577C0F87BA64C9138892CAA7 15F32F7B088423102C323F7B18AE9A85346D2729966D8678BD1E1FC7919FD5A6 D97D63CBFE923F9AB2D94C426CBDCE20F336E3AA67953D41CB9C746837440EA0 004B9A35D175CBEECF57A22C25DB77826695805D4CB9940971066F7800E46418 D32CE072742BBB254D16A63226EB627E9A394B76518FF61CA613061A21DBC201 23D5D00ADF2E933D025507304017301A0DD373C4DD306C7FA76FA0E28666FB4A 293981130044F98B2AEBE73B3C2CB7D8BD000FC413F1B1B8EA03ECF6E91A38B0 DCD19DB8ED549BF38CF292DB149B9E5862FE8CA60509167A01B0B66A4004E3C8 4A46911FEC81963594BCFE3C793C2A39CEF3FCDAEB29B6CED3D2FCB975A22650 5B4FF0A4B5246A65C2ABFDD03A43229BE1F50AA0DDD95D7E1F444216690CA114 259E5C06C5B6E61E548EEFA949FE11B05BD27B491F2D81927F58A08B8E208CFA 029A419A8844F1DACA623095F916C62BE91F4F976E58A3290928B3F4FD254C9B 5482CA53A2A0EE1E90D431AC3E12BFE8B786DEAA0EEDB88E441509E4411882D6 AA4EF95B217555FEE3C77386D0885BC33FA398E1B716E95B21B1CAB031D2566C 5C07350B3DDC0C0791354357BA45486B27983726B49F3A033436083D156224FE 3F7C83951032A390C52DD1BD628072A375033630FA4EEDC8D7B29BF9FF2326B4 0404E271B5C4818E79B506A9990BA0EB72E7C0CC4550C09269FF2C104C27F0EB 52E8FB91A69E45FAC3CB7A7AD94BC99B88F943B32F93B2A6928821A1A37285A5 97A028FAFA35854A37F23505310551E48DF5A8CD6BD913BD8F5FDB965D29E287 A88B9139C2B18560D0D2C6BE32D0A95A95A369581DAD1038BBF730AB4E268F21 D8A37C4F60F30265D78A2E67419702A98F82FD928FB049FE77182A0C09B3A491 B062F178ABBC3B043082EC01D984101CF699F4322ABD30BC65F277A22C6DE60B A6786507CD4CCBB90370D86CC2AB914F8946AA07BEB7E2DE2BAB996A440888CF 943DD717412B642DF9F9AFA6783FA6AEF6E7924ABE556D0F75925D0D3CB22B6E CD37DDC9427C5A99FC5E8E225D9B0C933448E73AF209FF8B081ABC3DACCAA1A4 8BCC109843EF50724BE2EFADFE84AFD384163A424963800078C74EA49A481565 DF3A8091A2A15F985022A21A7CA6DDD22B2515B10A3A5697088A1B61F2AEDA50 65C40F63CF4DAF0DFA7151A0D15596970367D76D6776455FE20AB3A9E5BF66B3 3F556350658C33E01D933E55AB2F0D9EB477561D1F5672360D0FADFE43CD2A6E E5DCAB05D4C4A7E51B1A9D8D42A0534BD59327406C469DECA4D17CB5D0B81CB0 9EB624FAD8118DCA8664458AA27D7B85EEFFB0FB86F665BD3690E0AC856CF3F0 945469117381E0B5FEFD09EDE5E3D357CF8FE1024E3762C858C83D12D0C3E3A2 B2753B46731F7F806FF88C6FB95B4ABB27D2DD92D7948DF9EC856E11F8FAB39E FC6E5D8CE409272D88D821C51174C363C1A74DF4939F40C22A4CF4CAAFA14008 3D8AC36FAEB5C6ED9C0321EE5F635249CD92BE2BBFA59C9AC454568B8CF55D17 F248483D7E3CF7BD58FBC65D5C7FF719D15A1526009648886BEB2B75CB8DD7F4 E5A3E08E1C7EC4AEE3B3A067E8D88D870B8DEFFC9CBA4E096A6FC658CD7AE50F E7EEE1143120E959D0E396768C996BE36E0C071A809938C3C0C895F0E927EB0A 2E0A66192595700C962B8F2CDEC5651DBBD5A7DF1416D4F80E0573332AC3AC7C 56257DBABBEBF87C3F33CA9D7CDC7AA6B1BBD3770F4B8A86F18067D11E663768 5637FB405A1D93E8D324AC2344B925E3CD824034A388C1911F3A58AFEF553234 394FE8CE85D839AF271C7B6DFD948B804C55393D765251DB4D0B397808425421 A5B4904E2EABA9170B109C88F98C9F08E9C437FE7BF47C98E661706D684599DA 6C55EDE2CC902C373A45847217382ED99741EE62F7FD205A7B7D388EA2B181F4 BA1086DC46877787F97B5B0D5873001B7DA1B3FB3F53F49E77B77BF092D383A0 644C614381A74C217E55BAA0E88D99EB8F44E1E091384D19E0EEF6776613507D 0C72F1D7D1EAC3AC8663BAC24DDBDA527F17F0803BA4B17C880D9B06EAD4F8A4 ECA94D5BBB5307718052ABEE684DE8BBA96711983C29F91D8B64A1A0655A258D DB6554D54C5A53885637B954D1BEDC02981400267AEE3FD0E5C36FAF6AB55A67 EC3A6C439DB957C12B0E038E2C78B918D5D3E412A13EF5EEE618AA530A257722 393324193BE9C5AA32ADF5E56CB6C3A24555CAF4705FC95DD960BBB3D5729B01 58B8579CB6D95217E4CE64E1E74BCB3A1DBAD1C6A83CC32B05653A79820A460D 4FD3F5815B68ABACB732D567267DB86BBBBC6B29CB6C18EBD75D62A7D341EE90 885639FD384A2C2C2701396555159A861C17C8E8D276E88D2FB2BA0EAF070B02 BD55F77D40D2534EE2FB054B563B05CD0F75B04B0D0E86FB2A324B4BB1BBEE79 96C4DF49D515C1DB1EB675907B135754FA0F6497A76123E209E1DBC0DACD1B3A DA81E923A75723163C5AD8CF3588511872FF4681B9DAA1D8B0B6748BE2423837 80F67AA795B9E74657D2034069C8F942607252CDCA6B2DC884C7CAF6330CB9C6 EB0F3E440889F46DCE887C477126C0E101885CEC8E3D0E760B4A95907D82C00B 49C1C3B739A29E411EF699A5E23CC2CC325E75167C7986BF3F6C299441E21564 E9FBAE6C2C457178C6B9D89BED52005F5FAA0754729561A1641560727ACCDB27 F742BADCE14F50E5F55DBB39B39171CA4718127FCF3FBD095D72B6E3F89B160C 42F9FD919DE6BFAF59FA7170DF3917AF4B3ECCCD63116CC34318E903E0D3534A A534CAFE8669D9EE0CB5C1EFA07BB2820D686B886AD4C908094F4E76495A14F1 30A6B5EEF84DBF85AEA966D69A073B5A111F8EFBE9EF0C9052BE0A2DD5F09183 7DECE25C8E3EF6AA54841954A7DF0B033E3AF6856BFF62C75911C6CD099C23E3 592FAE1FA4C9309EDF212735F2644BE1108905E0FA490B9476F4564AA92C9248 E6399C738BFD0E7FF0E1C392724A06702B1D1FA5E4FCD43BCB6AF37203B8C4B8 0BA5DF9115669EEF441BBA3C7B9110034A461EB6F33E6B88126EACEF89B5B8FC A7AB7A6603F5335107135B82C700EFBCB1D52E9B69F8C5D549181DB686F0F2B9 2DF9B17974FD1A2CEA6A8B730B3AAAF290201954F9A5D08A600BBC8427B0FFFC 5E725B2B454F0EABD5F6F0DA55D4CEEEEAF2B705D37F9636B171A23280DF570C 160015CBCA1CBC484ACBE4DEE164FFF987323BD33B8439196617FBA3E598777F 8C938E7F4A3EC001A04CEB895BB16C56A61E68DB55F2D31AD5821F9EF6EA795B E5B91402C3D03AEE8E358C086E5CC650416EDA5093B991FA7E250EFDBC986778 E36D5CF868DCA436935332AC924D1D764F9D7117FFBBD1CFCCCBFD3DF80FB509 F7E32D8828D9749BCA1CBB932C33EE0A2E9E08DA68E5CAEAD26970F6010E6244 D2DFE8A1A82FAF48B0848BD6B0A7EC327BA6B3D2EA24CE94BB5C7DD135DAB8A8 4D1A3602E27432A5FA8F9206BBABD81059EF535D3117D671D43BB2ACE82CFF9A 07C13A674310730DCA73D8A201D1BEB35917F96E9C5A87F79E3C467F6DEDD6F2 6A99B9E9DD8B18D1EFD4E49BCCA0893C73CDAD24A6D786B57980393905BE28CE B6B2CDD2476C335CA616AB1B192C59D41E5D307C34FF843C79A4327EF6B16E0E 79E6F3AB35E795A2A3CE782D020A74A75E3658F60B4E279810A90EB2765B8D21 D8F7677D3E0F6178BDD9513D3603BAE4897C35DC419DA5A8018C77577B51B6E6 C675B9CEE0FA363D69EDB43AC33CEA697BAFF94DB5D3F5746E9517BC92266447 4DBD9F6693BFC34246492FA396E9E7C8D089D50A05E8F989FB899E7057BC221C 813E58FF73C6F3D9A15F9201D17260FF74EAFEEBA7244EE1CFF4B8A253FA1284 1E941A3B98676D6AE11301BBBA562A55B766F02AA9E67806EC74BBA380D0A58F 3792F9C69E4E76293E79E52E1F918EB1835B77B544F335275EC02C7FBE315D2D 9D267DD794A338EA81B161CFE67CA01AFE8C799E121E01BA88AE3BE000DF64AA 83B0A2D695E38FAA08A5E4793DA29EE2490B789AB231581587470B00E1A6A621 A51CEBA30F5C97AA429563266DA8B1B66C59040AAFD7C25E8A6C92F7AA2E62EE 04B692CA6712ADF0AC255BC7DE33004C935B32815F327D159B310EAA4C1514C2 CF6F51E4FDF2EAEBDF2E6EE391BD4A7E0256BDD8E0A0CE61DFEFC2EF74FC1885 53BD9393D3AC3FF17C84830CE335E85DF67B4793E6D422A0268EECD62C3E4331 4B5AF1806C64CD8AD2068FF01B4AA9548167880F063C08F811EC1FF7FDB9D683 1A1A42ECBD1647DFB201E2E23C97AFA9C70B7F7411181816E17E080A15E63F8E F9DCDAF5F910FF52E2AEDD6F503FCCB9D2BD9718F395A67970191AAB37F56F44 09993AF24817C307DAFD5812FDDB8D942E9F6524F166AEC2A6B0722F0EF5EA74 3443A43C8B7AB8ECB702B75DA2504C2C6F1CF3343962808A431A5EC69741D2A8 9A0C5D403BC8F25E1615C8BCD312B81E5565B881494FD76921BED2FDFA936D15 3614331792E34B2489EFCFE9268EA26D5B826F262CF6CEDA4E3DB09839456326 E936DA795F4C877CB50B1455D6B28951FB9ADAFFA44132FF2404002604ECF66E 281B139C5C8B2A67E00F34F3B2058A795042E313ACF7065C4F7B4C8744A60892 9616D68E63667CB099168B0F1D50CA350A0D48B6C88791AD334D24389212E76B F37761BFC3745619E5E099A826E57BD5F8F355558AB12365AE9E701457EA3DFF F894D3F550CCF546A23056DDB82F42A69048660D32D1CC13BAF89C29D4A78BD2 0D1F0B3749ED54F16DDCC4C6C4AB70DEE17558ABEE700C5A6DD8FBB9FC149024 4CF339E642EFCF522675F9BE35A1B19A549E0463DDE985040940E1E534BE34D3 35400A0A788A134A77A8309110F19D018A3CA5A80E5833F7A194FC68A3981644 3564A74D1B6F660345BE8C8E8A8B2C4FE05FA38D3A889AF6F3F41FBD32294C0C 4AC1752395C8092744311C357046C37B72EEEF00EF5E3706B20EAA4BF82E05B7 147015347509B9A916879E48A1B4718A1F90ACA1DB9F24B2F93CC1D571E44ACA 934A1382C76BC5DB6C7C18D62E44D9230505BDBF49AAFF2C265990473EE1544E E066D2CBD0633852C202938FEDFADA3B2E76B3B1211E5950A853C0979AC2CA2A 2A2999AAB12601544B1988CC62AF313EC450CE1C5FE141ADE01F64460A2FE515 8EEB69C5F285A256934865F536F149CEB8EC4BDDF0C7C6396CDE54379FEB223A 3EDD49621CAB87CC457BAD10678BD2291CBD57C357B3BDFD51DF519461DBCFBC 27F76156A19F21C45822DD8786E113F836B7F14976095B80F31168C9248FDB0D 8FD36A6B38FCF8B3172721770C0B117A0640FD792CEAFA80DAA575BF8567ABFE 5639D370FC6CEE21905F891A64A3A64CCD58ACCDEF95B7DFF1F70AE15B4845C4 B818453B0B6A765B1063B1749BB2F1055E726FAEA9AC5825C8B3B232C3C8829D 4A91D8459AE9F44917988F19EEB53600F433ADEE84F3D4A9C5AED967A19DB210 2485E5ECB505E68746D40A013C6A6EF45D21BD167A4B69B3356E3C93BF7E7CE4 BD5D5BF81B1BA54B0229FF41F6D2AE5A4AF6E8870594C6076F5E9D308909C319 ECA5FD3600933D77B80BE9A98D2A8E5FA5C67959B970F339F900C03834DED37C D0405E727EA4E719CEE8C2566674DC146AF6452D015C8ED7733A3B843FA3BD22 0648D9F5A4893D7007548798C51F1A67BC4097BF126C7764DB98527684089124 39B85257C1F62927FCB7B87C6F11455A6600113AF067F5728F1652C4A99209C5 DB988F45B6B40A68AB29069F65437F38DCCCD1A6FE7DE3DAA8F3BFACC7697930 3E0F49707AA0670C5AC439D47940C10BA0CD8A4787E001749F3745203F4A43C5 A5DAA7CA7AC8D1034D576DAAACF3EA05C07D9DE85CF1FC74072503AC62C0CFB9 D8C9556B636A55A5F051BF06346B7DE3C728CBA59C02C2C755AB7B14E2923B3C 370A8D630BB447301D76F291DC07B858EC211288162594B68ACC1D9AE13DC3BA 265D81141542341AA95F5E32F5224D678A57BBC4C5BB9B0E9D36D3FF78C863D3 E67E5DA41C07A6DBE9438A4A450016FFE3A0F4F129B1C86A48129468919737B1 FBC0CA0C0611E8BF0C3EB21EE4FB117DD31224F64982F7B044F03008DB456EBB 1603289F2856A0CAD3C766657831E79046B9D8623608DB53EB15B932F782A029 E61771304C1D8C2C04F4FCBFFED6D4F182423242CF24F64D3B00A3303A5A5A3B 2B8E5FF78FC9FFE102618EC7E1EC01E32F10CF7312AFC00DA94237B644A28364 A27C1EC57952F6E6D3677D0A3389ED01181AEF8DBEDF517701387405C8B3DC3F 9AC0D898067D9E72A9BAFFD344AFC569E645C8B83E70072F77866B94BA736C83 CE283BE8282FE4D605A420CED3DBDD2938CF606373BE2A1700A98A2E35409270 E56F3749765F42AFB93EFC7D74CFD4AAAA281C4ACF0D674D7C0F342248E0D1B1 70372060C262CB51DF7F8CC123842884FB2FB976EF8D5ADB771381BF49665282 B48D83E3D47F0332906F31709BFFC4677E45D5654CC52A8672D7363E3D6D813A 0E81A77DC705D14CC70C548C46720BE335ADD707538892BD8A32C0646FC31972 093EE44DFFB1909E851298AD422FA247E311098124D0BF495DD40C70C63197E5 DFE5233B9403295C08D33E8D4A8AE4698116B53FF30713FE6F511B3AD0C901F9 A6A3220932C53EDE3290A102BAC2BF0DFB0A4C85C90D4D7EE9D2281524C4EF7B 50BF92BD32ACAF04DF8279B1EA0EFC9042AE1A264E39F94DD161207D71456A7D 71BE1C4B78C5ADC19717FF02DBDEB6DE423DADBC9812216E0B148696260ADC31 9CC5EF34B29FB6BD0FC198CC7337435169322FB4CB0FE46D51EC83A040440845 86FEA8E15D183E9CD52C301556935851C5FF728E4EC535534948A3ED3F3E53F1 3DCA2C67A6148A372A5C0A152828F421425A8032C1049B272AD2E4942A31C41E 227A2A7399E119E3D0A41DA245C9A1AD41533CC6671EBC9CB08C6D0D778052C7 8D2D6BEF2B9D8D39951E40100DBE88C995EA628E1AA3C66CA89ED412A922C522 E95BDE8B2EA21C591BE856F2BEC8B5C445789C9BB4B370377AA6C185197BAB22 B2DB7105AEC13CBC2B68FF1C27AA7E2A446CD9F3CD773F3D4F066080C0309FBD 8F43F59FF2A3AC63B65A543B645E1ED91383268EF33A9689955333B48901D86E DD26D052D519A834873AE1F381CBED9590A68F66860F0B8ED5DC2C1167F8C654 274E89778EDAF088BD64BBCF9CF2B333A13DA77275F1358DBB6A7F3D612DEFF5 4646974C95439230D6517BA8EABD36892FC8F576CD0A7AD8B7D056DE2F222D4B EB8EBD5DBEB6B306FC4EEDF5EB0F8E31E9AF9A46D621923A785D329BFC3E0381 1BD7CC6003140C267191A17082A8816A0483EC963460B8656E8E9C05836AE725 3C9AB3631DF300895FBA75C9AB96169111BD60215D1D72DE9CE32514F80BFDD4 2201146F36203D75CC0F5AE11D1B55384C8D7E2B04B862B946D50FFAB8ED1C96 6CAC3839193FEB1170ABFE709C96E90B152814650B2A7F19447048224EA15017 6C988ECB8D8B60B8C2C6E0477D1888EFC3B29B3528B4ECACA0054106804BFE92 6EAA549B8E6BD54F5A0AD2E9CAA64E8599B7EF2C2065E1EE7C311B07BC24D225 C52FB73184F1887C987DE116EC874FB7C436379BF579A10466A28F04314B946C 0F6104D4C213BE115C32E19CB72725EF820E7DB5540F46680558CC0E551B79D5 747F23D4B9319F9D9A7DC1748151C3B97846F60AAD13B13850F719F5A86C873B 9D0A621323BE8CDB35F7F8A6125044C75B9BFC02173CDC0395F80780D779FCE3 399F10E5DCF1C0BF0F8EA89B24C376C85A870F806BA7139532857BAC258E12D9 7684AB49EA1B85970FF5C75BE98D7C1F3AECB8485B0E9C87259DA69DD76AF3B1 CFD35EFBCF612426B7C72074AA1FAD47DF2592819257A549B0AECD828BE36397 7F32680E44ED1EAFD068CCD2674C820214CC38672562E26275D3BADFA022F342 8376A287CEAE068849878D7AF4AF4BA5CC6E807929B1660988A6E3B701F38E43 301E4EC90B9450D89F7E992586DF02AE3F7E184B58DC0966B3794C6AD056626C F6ABEF51213D97DF44C0B7D07E484CD6F3EF78D0FCCCAAF0907EB7A51551E177 FB26AF8B1EBAFD73C8DA2BE40C72EE95B1EC831BF690A4F3C8E67F674C6D62EF 29A3B0A695BBE2A668A0A6E123EC2534F42EF1CD77DB2A0D0202F21FEA32289A 848905665C0239F03FA96E79D014C3674513B743CE5C2EFBE9E9201E7CE3FC70 17D2A3F2FC6DFD32DC92F5E571E3C33CBAB8752C8D4CB70C2CE35EB8D04DE59A CF1232DF3C7E98D5C878F49DE631ED51806F2B8E0CD458218D7400DB97770014 60DBF2B419B2FC532FE7EE63FA5002943DEF85F357D6177AE39676AF39F71EFE 2B237B35C2ED5CA29A54D350D21211AF579A2B0B469B43123AA090D6EA7506FF 3D1678566EE17A3BA6E3EC398F591A3ECAF6B7D0673C77FD009914FEE60A12C7 493AFA77868A612BC00AC243C2F61C4B8DE54600A9EA89D0DE677A13FDA20958 E2A2C6C98B8751C6FC94A29F16CA28C6A6B6E60CE7490D2B72AE9D3EE8B71E04 9793F539C720D5A0D3A3F352590D05ACC41F73EFCADDBD6011F36E7C95FB50EF 1C84A263220D2976867381256354209C572735B935087D6FD839A81334BC219B 690292F69656A76CD82A8CAAE7ECA44EDDB5AAE518E070BDC1BC7B990E8EFB1B 5B2747F8B002ADBBE730B7BB27B4CE57DF7406B4FDF355B06710C351A64846D3 163688F316816E1FA7C372BC7FDB44B543EE4AC06047548A8EADABDBA93BD7E3 75DF923A4182A4F44C229A930C881E3920265A05FE5E81F7ED067F5BE371B8A5 E5CD6C79B2AFBF2B700AAF846D6074591884390D8B180D54A471C3E8B636B1FE 70F7A1203057BAB56D408C0E40F164054518D36C4B6480FF691686C68A2306CD A83495806CFA6AA664EE0FEB56314A21584A143151967284CB3A45E2504B117B F69428E57EC251971F69E10E3A8BE1B0EB5E811957E23CD2A75A434DE8240CED 8DC5B0C0DDA66B37979F74CB855A1C27BDEE877ACD13B95F5B0DCE5562CBDB3D 6B240D69156EF7425C3EA9F55AD15CC824EE3AEE94E551D6C2A74FBDCB242939 B67F34B3D9782F7E7970D4BB7611574053364B904BDD51B795C75001FFAF9FC9 BBC5BA7B2CD7B3CA475E79022247EF44F3FB897AB9B6A15643497073E35EAE61 CF7CAF098640536F012A64650CB902CBF4CA477A58097B47A84FE0AA41FC0580 3CED019F45CB9B11CE4C3F6CF9B93D19885FB6C1C031297DB35052EE906074C0 E90DEBEAA27019C1AD02265EE42D7B0D1E45DC081B33B6E14D317CABA571701D A7BB7F0404F28C491CF518574052F9D42B404580A5B8BBEBA5B57AD218180FE5 E2291A5FC3A0FD8CF068900D29E0B7E9698CE1277C740140610A271D87F680E5 B12F352377E3C98AE0DDD2383E2CB2D73BF6B8D9CE86B263BBB542D571603CA7 A2AA334267F07D0AB81AC597182ACF1E947678806DE38364B4A43AA59CD1BED4 9E1791493211ACA1281B0478EE871420AC78C203C00304E846CA267B59E1721F DE466DF93C94D36AFDB0F8CD2B82DEC0F44982E076830226E92F670153B439E2 1B25A07AE2E3A0A7F0CC4AE6355B6DB95742ECAD5C1C355A4BB75F4FDDDA8DE2 FA9AE5F655FCE522FBD7C7B98AB62B428C98D4A19FD265B54FD8832D196472EA 90B1826450CEC51261348D9E48A4597A34E56BC042E9BD33BEA99254E2EC6E37 6F39E8C1177EB368D5B1700AC1FEE271085BE5926F1BD0A776F08DB58D4E1B06 9246045D0038642EA4191CC1416135141F183E1B3EE91FCA4140472AC812331D 5BE118285E665A99909CDF2284B9936A7D79811049F4ABD6648F3F9CD666AC79 D7CE220122545CFE0200BFA4CD8F80D4639ADFFD331C63AF6241BB106BA9C245 B203702B7188AE580A17CFF93FF90B04F379260320D60ED542514CE810EC3544 9B00C5F804B140FE2BD0CD911934219EA640D6EE23E85D385DD0400B7A8EE63E 2A28A48EEDBE828A6261DAB4618E846E5394A4E33A3873FFCA04E5271D57BAEB 5965888C8D456C753972328801A8AB47CE4CB9A26EF4F541C5C41FB9D07CCB60 617A5AA29FE34A9C69F406C543D7139581DF910708A6B851F072DA229A8D52CA 22764C5EFA64C37350130DDB826C437D99CAC3514E0499FDEE9F8F5339E7C096 7E77F2956A81461B035C93E32FA5AE311BE9A3C03F650BB46411322FA4905113 76A5FD3B0335EF4959474B6A5D608B8947CA0215FB5233A48FA476FC98BCFC48 5559D27B44E31519DDB92820D0F8CE0F72AAE6EF2E2626937A0E6A797723DDB1 40F5DFF3B4BB20DB3B8B570D48482FF3B57125EDC7C846DA7E7C09FDB788A8FD F1080BF7B0D59571A5415AF0D1F48B81B2857D51AF17D665E07AB34A9F7EB728 74A669D710B47FDDA52FDD5EC00181472FC7003EE3EC063B07B17EF85D6FBDD2 CF1598C171B5E71F58FB7864FF9F51905EE5C687F6F903821F01F37BE1273493 DFB15F9883C55CDDE508ED068392C8A8B2EC7140714F0401A745B8D8C0243199 ECEEACC340 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMTI10 %!PS-AdobeFont-1.1: CMTI10 1.00B %%CreationDate: 1992 Feb 19 19:56:16 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.00B) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMTI10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle -14.04 def /isFixedPitch false def end readonly def /FontName /CMTI10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-163 -250 1146 969}readonly def /UniqueID 5000828 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE 3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B 532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470 B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B 986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE D919C2DDD26BDC0D99398B9F4D03D5993DFC0930297866E1CD0A319B6B1FD958 9E3948FFB0B4E70F212EC976D65099D84E0D37A7A771C3101D6AD26A0513378F 21EC3643079EECE0C9AB54B4772E5DCA82D0D4ACC7F42FB493AA04A3BF4A1BD6 06ECE186315DBE9CFDCB1A0303E8D3E83027CD3AFA8F0BD466A8E8CA0E7164CF 55B332FAD43482748DD4A1CB3F40CB1F5E67192B8216A0D8FE30F9F05BF016F5 B5CC130A4B0796EE065495422FBA55BEE9BFD99D04464D987AC4D237C208FA86 0B112E55CE7B3782A34BC22E3DE31755D9AFF19E490C8E43B85E17ECE87FA8B9 1485831624D24F37C39BF9972D74E6EC4784727AC00B9C4A3AD3DA1C22BD6961 7E0ADAF55422F22ACA5E4DCD4DF9FCD187A566B7FB661D0530454D0DD6C6C50A 7A3875C6CBF8EC7769F32A1F3F7FC1C072BADEC97794D4E90E0035282A170402 356E5A9CD9ABD80AC4342A5283E458A7269252F4541CBB6452B39ED54D336D0B 19928E9CD1AB26AD83EB209E2EC75011A2643813053B5DBB0246097C4821B5F2 C92554E9140BE35B2DBFCD98809A8EC9FC910FDE9E0D86457C70ACB056EBF90F 244DC0A5BBD455E15D6E3180311D52CF50B0BF7D0A7F64F3A1821E0AEDBC2E7B AEB549FE1D51088C153799C6E089B5D5D65E1C4E2D2B430CDF1FFA23CCB25D95 5C4DD885310A706B320AB25C8D742C6F29953254FA54DAAEE60ED477877D19BC D28E9AB576B0EA088171FD000B60D73B3C57F754BC07EBC9BF751B7D2B32459D 993861B7C4B0D98C422A11BECEF76F4EFC0ECAEE89723E6CED53E3678D733363 2DF068AEF0FE7DFB57393BDAA439A6A4C396F86032A98009EAE1247B7DE83B3B E46DF2898598FF5E6CA6953127432A967E4FD41CDD60D6E413059A58FA556EF3 309178B57C16A763CFC9BEEC276944BDEA255789EF4E1ECDE1EA43EEDB955513 F42EDDCF39AE522A1DC2D80B2772B05DA60F3DC15A815A6BAFEDC399C7956E75 3851CB3588E22936FBFB63A58300298B11C45D82385C083D07AF133BB1BC941A FDD9F34D5E0B8087EF2A58C54D8AB7580EE3ED58AEB83B72CB9028F472ADBF11 05A77651F118824F6CD00209EFB60C1D32D46DF39770905D31D051FF2ACECBD0 08911D3CC25B783103E4A26EFDD866414ED5F0DD28A4BBECD38DAFA3F6719584 41085A247E4D927532D5F8146333FAF9EFA9194E1AD92E49F360A9D82DAF600B 2F9977F75FDD809C155CFD9540F40E3918B5F87E4A80DC5FF5BE96991A2CC872 3C6BF8604EF84B2A8DFAFA25AD0E5D539A57ED77E59C2A1D11BE79DBE7774828 7874E7DB593866FB52EB9EF208B1E46AA05790245AC31BA19170D6CAC0596C79 C53BAF12DA95057954A4CA2319941929B5B0DCD8BD916ED3ECFB3CBF210AB41F 0E6F18A7994C298F99A28185DC59D2895463936D3DD226DCF07D251D064E1BD3 37921BED0492E3E7EA49AAD493F1630CE4639000250745172997442A918260A4 E6A7DB9C5D71AF668F45211C7156415F4E2F83AF3765536F1E791A58876A6489 A0ABBE043B9854E30964DFB12D147BB0DD875D4B7AB9F3CCD8DC39B9B980D05C 55A075A4FFC56DD89A6B837A3AD919B983CC853B658F9145946C375406926E4F E9982A402C4D509DA381FBAB929EE4837832311B01C1F55DC78F9E50C9DE931D E6FBBD9BCDEEEC242F1A07F8A553F8AE1C9EC643380BD42F47B4764DFA973F28 AA1DB67F13E8205E83C913F7C663F0A44B77390DB0728D8D567AEC20DFB27E3C 72D07B7BC03678C880E6478787177EF572934CCED6422C133F1BD638D2AB5C2A ABDB6EA27417F1FE481F8197C28AE8DF850773E42CEA308052F37822B1F89308 2D29BA6F6B934DF763FAA52671BE324EE77EA2A084EFE77A2F0BBCF031752772 1227DF860F67075368A3C0C3314492FC63B3534F9C8E9346031FAC9A1EC5E5A1 E5DF18F98F54B9B6B4DA998FDEE92A368AAC7C34CC1A0D992CA1193FD4864233 D7AC84DE9C3938DA0CA9D3627063F038E9CD982A608C447F456109B18636BBAE AA3C2B673E1689E5C34B9908D2FDB2D6C4E26F4DA73BF5F2E2407439FD66362A 067B498AC1089368549A4D94C66E194BA1C57947438304A69DC0D2913F8239EE C25AF54F070AEFF16DE0B29A40036D0E0CD446794431778EE11492EB830CCE6A F87C810C113315EE2D38BE63EB2B7141536F694F602C38CB5CFCCB5DD8643AA1 9F183091BD349A4876E18AE64469603A681CD9A7D6BF765E12AC1AC51EF474A6 8201E84EED8CC919E2BF08278426E016AA17F9279BFF24A63487D612433D26C2 1A35F5114708F95A7F91B515FC7913111FEBD7FF0035D2D4A2144328F206141B E0B6C71E6B9C72E2FE83DE9D6C1962A0056BCBFC176F019C0B99A15DF4ED1B21 14EACD3729D93061FFEE84E7F3AA5C995D60A59B59B9BE553731D10712FF7E9A 8751A813F3E2E734F637F2081D0FDBCDF0E94C0D53059D64D77A8E491F144FB0 88EED98617073C097F423E6E5A341E86AE18A5D6D90743D3EF4A31D895E829B7 9E4AEBBD8E48D592DE55971DD2380168C728D2FB8F0B63BC6CFA3F949115D1AB 511719EB004B9876B1A25F6B3400A925C18F347D79B14DBB463FC5117CB5B924 8ED40A1AEC4249C9BB145841414D4494870722393ACB675533910628707FAC34 D315FEA10CC542E43A58F9C1F52B3A6708A009674D17BDF07A1F2F2C053FB3EB 5402C92C429354C9BC1E72EEC1574B4C9D4047E66C359E507EC63C8ABFECD2F3 4F2221EAD646EDF38ADB160C68F1AE095023A9EBDB7626EC6766940F6BC5CC03 9BCEB0F115C7F36A63B79CEFBB2F3C4093985CACD57D1978F6E08A376689639C BE1DAABAC072C1EDEFA318979849AD86DFD38F9D88C6EC22B068E8BA921A4837 9F58C4678E12AEEDA55BA43B8BF3225E80EA51B7EC2664C504A47855D3A5FF0A 50DDAA977051DD315EE93EDBCE44D36FB69CD3FF3191B30AC2800B475C567473 999B0FDE8A0463EED3FFD6E81779D36D0E1F13121D6D8D5163B660794873E5DC 6CFCBA96655520547AC62D5F747D900F97313E4EDD17C9D1F946F0207BD33E94 7ECD764F816AD41C4052D12F78808ABC54E6C4D1615D669EF24E614EC86D72B4 4AD65DB77EC4E1105C59235A834121E61C8B8B8A7562C51B32D6988B88BA4207 E6E78A3FACFE87E80803BED3071C550F9D52DD2FDA135EF8635F68B576DA2DA6 3602A8F93ACD21F22A9EF271AF83A9F7E4086FD9FFE87620CCA0CC7A397337CC 5C4392BDD73C8E405F029178E8A9A8A6E8407354A964134643C767A34B7172ED B156EF502A12AC1F0C56FDBC0FBC7B76CA56E68B54EBBE9E8DB706B8C5AC7547 F69ADD5A079BCC42E1947FB8AEB7D234068181475C2A36E33DBDE42F88AAFFB8 E0C94E8BFA9172B9181A71B84CD7CC23A62A3413C10E8ECC126D613175D14100 20052F577921C2F8A527C418594D0B0B8CF7BC3BCD11D340E597BBD1F567B794 180F444444F0EB82CC884F326BBF3D09798FA92B6A0FA378DB71812314938566 68FDFDAFC5A45C25687246C80642E923F92F7AE24F38B0B0546B36193A9411A0 9D60BCEA1CAA4F2A156CB6CE81339ABA14C8693390599DD8567B56A323D75ED5 F24D3F94998D2CE8BFD3C1424B99E8CC6394E3811E1934AD83492DD6B4FE9873 2DB6B20B64E16199D2B457192325F8BA778B52BE4CC45CA4A4109D41FA6FEB06 9149FEB71B17ECF86F76F87B859B7C120310A00BADCC3DC9A49136EA0523F596 E94C5176C35E89955060B804D5FB35020EA6FB6D1FF70C8D517D0CC1F2F44105 6A3A81BDAF74A5D794AAA879015ED23F2E33C316861F5C9142F6C4E73F4140D9 195EA3FE569DFCD144EE0DD2CBA253C61F7A746D4C19EA2FCA7FA88FD3578EC5 C9188D07C23A6F19480CB2FA265ED6B1D2B66EA31B40FE3A47862EF2ECBB26DA 522BBB636A44B4B90DF789CD382C3F89624AC766876ABA3478ECBA5F4AA61A94 F33F8AC61DE9F4C534D2F6A2F39A00C7E7503C57D7B43E0BB419936A1F15B880 302A9D21367BB0AEF8BE7B4D4A3BF9827C15FD87240A802657842F5236C1AE06 CEADFF29F5387CF98BCDFE990DD4A2934D83C9B59D3C51FCC0B603BCB906909F 95A3D9C124FB386D8B6F99E3D8EC957337C00A451B0A248B9715F63E79381F45 9F5D021DEE7E48DBBA2175E033D1B2915D6756D695D55222F05701392EE9784E A58870BC8D310EA173B7BDFE1E0DA1234F7237EEBCA0C018CE24D382D4166475 829D6D6C8566F6AE50420DE80C9975E51C9301C7F7955DA3F40F4C7725D3DC9A 313E4BD39E78E3F0F375CEEC7587F0DDEFFDE8C895657D12B7728E021D5BF657 71B29B6DEEB552CCA63B9F83BEB7D895F0E053903530E1E7C4417A817DAD9D83 C26F7F0F22BAEA667B61894354A2EA85BB4EFD9448FCFF59D563010CDF5E3D30 C5F37463404ADAF017737D30B89DBC1C5692128C61AFEE17BA6FC03F6BA2342D AD0E359576CBD10F1A79CC78285C4E12FA22D4A444DD0F61918ADD5843CB3B15 BF3E688F3A541D186C43D1CBD8CAC6067CCAF0AAB8B2F87BD487D18E66CC49DC 0E40FE564F19EAB7EA56595CD0310CE932777793A18ADB7430A5363F1D13E900 7B3DD33CFFBB015F9CE96C8E33D5D3A2F17F21CA15C163414F3853BBC9ABAD83 C3B583C41CC00E7AFC4D8AE9ED14B342504B690A47EAD9DBD71A60214EFE42D4 7A26EAE4112B075FAC8035FEF6B418F6D4C8F3514F7C6C7A69F741CDBDB88EB9 EE406FDDBC710001276CAE869BF518DFB1D9EAA1F8BAAE2DE7A10732543DA260 EE4E9CB77B5837BFEC2B750B5619C2A361EE6CA052B0C64D532EB6D249642877 E75A61C0B2BCCA2C8A75936C8B378F85049EAD55FDA354DCD2F8F62A451B90FE A7149E059838BADF9A4E07E9192671A31065C7D7DE704450F707644E1B58460F B9CE54F015B3568BC70F62B3AADF38B542244476498D0DE330A443CBAE18B50D FD40BDCE18F9FB3EB5C03BFD0917321FBE3316745C719BC48EE630BE44A16A1C 0A7409C4D02FA593A7A70978F0FDE184A428B67B3A13F3BA2DC6499A489B9488 E9ADB16CF8DFA7530DA21FF8C7108AF34482045BC5D73AF4CA0881A1EBCA5F77 E16105F98CA3F9B8C3BFE6AF5E04D885AE6338D83A539593821C0BF1F2CC620B E77B7DBA808BF4E28C702D4BF161C30FB649DED4DDB712E126022A92CDE788EF 108F29964D8E25BB7282C2C3E93BE3CD2BDDB78E62097B45055E2B7422790A29 08917AC3E494456BA71085E93342151F3564311F4D5E382BDB150CF71AB8FDFB 3A25EE4669551794EC171B30CF2CA7B88181F5F15D2113C1855A46AAC4913306 C8EA4F434644DBA38CAB1B1A06DE25CADF1800DC2DD2654A874036300A55A2C6 EC47346B0798CC38598CA1FBB973F33CF18E8C4DE0EEB41159C11A78B1D504FD 3133B0DA059C68B26AA7C97B3871BEEC6EF08070F54407C14DAE0800858B1901 ADB7FAD31C60841761F12F4D3B4A3AF800775A0CA895C6CA8B7C036D246E405D 58491ABE55523BA70F53077ED92D3111CE562C5EB852EE14764E660057192F61 B85D1E905BC9985E4F2F255F8709D5B20B75166D60AFCD3B39E878466B3B9C3B 715D2AAAD82703B6CCE24B10FD9B663731CB9D891D5E086E0B29D1852E1094E5 932DF7B575D25C62A458149FE6DDC2DD11A15B2C1435D35312BAB62EF2D0FF2B 9DAB221310DC0B3650F575AA973CC66ED9AA803126027BB88188B1383DD1E13C A247FA473EB9E0B23F35314FB008215FD1FC34CC4A4828AA9FE68FCC534C0AFD 601C4E0DD281ACA81CBBD1AAE159E7352B88246FC55FD06B450E5228E0B98628 90F7C8ED630326F35B4B1E28CD04E8FF3C4B4DA8F38AB2C74A698DCAD2D434A2 C9A6E7068169EBDC393114D2ADBFFE59C7AAF242A1A475B5DF9C68F00DD93B31 C2655FA15CCB7E1E3BA76F59F98ADBA95D0DD5FAA368EA0E8286204C4692D1C8 091A2D117401490226C8F5755F1E5A6919990CD121AA3C8DF37863CE021F296C D370ABBB8567EC7457AFCA11F3EEA6F163EEC74D88084FF6EDD1F7C3F4AC7554 7F2281BD9DB6ED12EEC004B771089DCD3669B8E9586219C331C1375276050B60 D42552B2878A0AD3E3C7F2F811AD7311FEE9DE25710DC60B55C770D7751A2B05 ABFE29A174175075DC037FEA8F6C98562A136EAC3AC048BE3FE75D763335C1A4 089C4AEB6B69B18A5FCF5D5CED98895CB76DADA573A89501B330A1BD94D64FCD 3F31AAE561EB48C6FC07D6539609678A2EC11A9A6030EA9C41173B955710A473 6F0B24427DB3B5CABB905D6D0E40116D2B31661255496B940E872FF6ACC7A080 C2A2B2BEBDCF21854ED1EB3EF3FD38CBC073FD6A8CB61D205695616BDD783155 56C78CF619B1DECFB870103EC35DF2D15AF01B24403EED6B80391835591EBBE9 E74C50429E7991AEF2E43E8212E01589635AB0736E7A033BC0442EF2391C8DAD 3AE98D63416B0B990B4821E369A938A2EC81ADDCC8002FA5A82BA675F0ED4667 8E22974C39B0F347454A79FCF6AF5CCE572AF4DD2BCB2B4BD0A8750CD8392FF3 CEB00AA27DCB68B77461E43AF19CCC33EA9264699719CB334495C0704E55CFE4 F2253ACC932CF4FAB3BB1DCF6B0E4DAE6D823BE7A5B175FCD08DD01C8CB53A6A EF57BB1301443F985671E8DA6F4B4D634E66CE06838CD4E639D75EFB2B3B47F7 5AA06ABD670FA66262E885306E3C200FE7CC57D64BD755805644885A538F40E4 0C21AD7762AF92FF53DC2FAB074AE50237E7A74CD29FCE4F0AB03CC627D8D6BC A486BE1AA120AEAA412EBD39C43034B7F22ED6771C7FCCD84B238CB20FB28E68 0E012E680E379D3A7DF4C329B6D89D048E80A11B8277F9D007231A0F7AAB8100 A9B074556574A0358E6861FD5F7BAA87EFB791D58B0551A2F4569B5A2AA2293E AD98EBACECE0D9C5F5CCDCBAE2B4E71FAE3978F70455A045B28BAA5F9C77CD4E 8D0D3EF8F7A74439AA63C1A600B7851679D98B555BAD2549CFF44978DCECFB75 377B0E3744E03C9BB7700619D92CD4BE1BE3C6EC4B8DE1DF5EB9A151D47E737C 254EA5796B41F29627B1EEB409AEEA04913BE8FAADD940EB7A914D50F530003F 042BC0250FDDC0A658BEAE23D26B48E59C22C8156C85CD381FB105FDFFBADCF5 140E00CFDCD8BF3B351156653EC74248D8F8C259C0B938AEB80A6BFF8E9CC836 39F82B50E30EE4C76C08A14DBCB2E6CEAA7BE408FB634C8603F9A49FA8E17364 007A825DCCD1F9182A7B0A877A4EACCCE98AA198C9CA781DDA25335D8B46E346 786C8B77A124AD68EF92D6A248B8339BEA3AFC702E25BF675589D37DBC1B5A39 CF76C92326663E978BC842A63884658151766078285A94BA5C164334F8298CDA E7104D16E24DB35528736C72A21D6EAAC5711E767A537444E1B1C609C9EC110A B03B7B34FB43C83BBE41B4E7C7DD28347EE2A2110A6F496105264AF63ACC9541 DF863A16BAE957DEC4655ED8B68D882327A99D18711A4DE2A3C2DCD1EFF8CEEB 1FFCC112E5A4E75049FB3A455429A484C7CDA1F6FCE39393D9F54CCB546A0620 AFCE59B00C0802F886D6CFC6FE9CB706DE6C592055018E9401363380099B5BB9 09E734CAD3C05F91DB8BFBEC9EC779CE1A21D0696A4C022778E70950828347F2 A1973A0F039B4DB510332D1C4789DBA9DC95C68033520D8139AB2C40A5B259A5 0064E3DEAD8138289D9836081306F77C6D453630B2E9FD2ECD1446A3FC6B2D7A 0DF7115FE2B10CAF11D144100B7734BDC035A232915E39C42ADB9CBD9F9281FE 5550A34BD55F3F7585BFF1D6C551E86A2CA5D767ACF6923F7C7137B3CDCCFD91 41A2D96DD7EFBCD09921BD04D50A5C7220E1DAF2207043DE2187E6384F6A0385 C02EBC85A6CC9CF831496A07580A20DDB9624FC1055FDB18BFCCC7B67C35D1C8 9FFF21D295DF8E1CAD176BEBC4C6A5D3B8CF492DF64D54DDF792CE92BC253D71 248B1FD10658CC09BCFC235088DA9C12AACB29039C22708C524030CDAB11AF9D 00C4355496E909C88535437F24FF6F640453C494A7AB1E4357684154B895B329 AAFCC0E6B6D7ABD23D7190B3190A9A76339595AD2E3AF988B516E1D391619D9B 9052E5E342580B9E7094DB8190B897D4CF5CDCD3AFF71A9BF91935CF1A76252D 61711B741B322CA7C651688321E2E5F4D8D2A8E9D0697A955934D705B8217731 7C6B61A495DB9413E07D69933D7ADA4DFAB6E8ADCB2AE7D8C2D676EF3B531B44 55EE892194085231F95834D33B0CFC4B7088C81A455C57276FE3D8B7D254D642 3D6037D4A2166336D84B02AEA28EF9110416ED58C1A37BC9AA2A26AA47D50F9B 6AD16B24C833D0DEB68E104D2E08F98A2CEE8EB47A120E9880F173A2B6D1D250 483DA3D50E78B54D5DEDD94144A7D98D9561B75FD4516324617DC81D9B5D5489 87E72E49311B83E1572124F9E3421DC4DFA72A41F1035C0BCB89DF6B3378EB14 3FCB9823516356074F79C871BBDECDDA07FFCC4722431EAB1D71120A635BED34 3FCF7A9E6AE5BAE49D7DC27E8ECA36C6C3950FE60D91E74A1D4669DBB9DCF1DE 177C87FEA963D1E4BE79662213081ACA55EF9FD60C5CFDEC1F87945B737C1E87 A343AAD6C8CCF9F6CF50E0EC66123E3CF4033265AD4213E0D5BAE1CAC99ECD96 B1D7756E85B96354EDC963360B1E4F9F1315A380FD1FA4847550AB5CCB5C8BB9 230E7AD105A4578E21DA0A7047C66B06D91A8E06784FC48CF2271A2E5C51370E 587DA574A8987AD8C6E76E1930D7AC0234489FF7D22595D1CEE9BBA139F2ABAB B363A90B62BA13D5D34BF8749C91971B52D9B8C567685149E5ED14D4A43616C2 473A76D9F10D62E7328E191431E91FCC3165FBEF9D3EE7859B0C0A9702F1071D CB79CD31CCA1BEB1FD9462E7F9CFBAFEF8FCB7D86FFDED8A7470A0A4D8113FE7 0EA8DE74E19C5F5ADC4B01D4C1B27E1393D3449B1285D6F0F0A9041B936A41C3 218941B33D3472F46DDA0DEC84A0339B5218CBE53DE3516774BA6DEA013C9FB3 039BF4DA71BD5D6A5C5CA415C8 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMTT10 %!PS-AdobeFont-1.1: CMTT10 1.00B %%CreationDate: 1992 Apr 26 10:42:42 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.00B) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMTT10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch true def end readonly def /FontName /CMTT10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-4 -235 731 800}readonly def /UniqueID 5000832 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5F00F963068B8232429ED8B7CF6A3D879A2D19 38DD5C4467F9DD8C5D1A2000B3A6BF2F25629BAEC199AE8BD4BA6ED9BBF7DABF D0E153BAB1C17900D4FCE209622ACD19E7C74C2807D0397357ED07AB460D5204 EB3A45B7AC4D106B7303AD8348853032A745F417943F9B4FED652B835AA49727 A8B4117AFF1D4BCE831EB510B6851796D0BE6982B76620CB3CE0C22CACDD4593 F244C14EEC0E5A7C4AC42392F81C01BC4257FE12AF33F4BFEA9108FF11CF9714 4DD6EC70A2C4C1E4F328A1EB25E43525FB1E16C07E28CC359DF61F426B7D41EA 6A0C84DD63275395A503AAE908E1C82D389FD12A21E86999799E7F24A994472E A10EAE77096709BE0D11AAD24A30D96E15A51D720AFB3B10D2E0AC8DC1A1204B E8725E00D7E3A96F9978BC19377034D93D080C4391E579C34FF9FC2379CB119F 1E5BBEA91AE20F343C6420BE1E2BD0636B04FCCC0BEE0DC2D56D66F06DB22438 452822CBEAF03EE9EAA8398F276EC0D92A7FB978C17805DB2F4A7DFBA56FD6AF 8670EB364F01DE8FCAFBAF657D68C3A03112915736CEABAA8BA5C0AC25288369 5D49BD891FABEFE8699A0AE3ED85B48ACB22229E15623399C93DE7D935734ADA DA7A1462C111D44AD53EA35B57E5D0B5FC0B481820E43222DB8EFCD5D30E15F9 BA304FA879392EE0BCC0E1A61E74B3A1FC3A3D170218D7244580C7AA0DC65D19 741FA5FE6F8CBF60250ACC27454BBF0897CA4B909C83A56672958752ED4B5E79 E18660764F155E86F09EFA9F7685F2F5027EC85A775287B30E2069DE4E4D5712 E7D033481A53A2702BA7542C71062173039030CF28D8B9C63B5596A9B42B33E7 D922944A38713383D3648A4AF160A3B0C8F3379BA4372BE2E7EA49AABA75AEEE C5DDE1D8BF68483C3D21271280ABB91D54CC819680322EAB72E1250A760BC8DA 726405EFE420635B5B7F0B48752C06083E92BDE06401C42A2C528C8A60381227 CEBEF0C9440DC034DAD9C19FB27DB399BDAEE22053591D6538587C768C1B7B0B 7D1E222D2D8AF3A6473CC4C0D6C3E0DB49068CEB8C9BD1C5CD486A50DAA10BC7 7D6286142355E3F21DD254E27C00C442728A0BAEC9D3F17AE9CE320D365152E9 EB0D5E3874F2BCEDA98521D23FCFC30B4B69DAD2ADBE80E5964ED0ABEF6C73B6 DAD30E2C5061E3747FE536E1A5D190D028F2130AF608F5DDF9DDDF1E77DC8437 ECB3EC93B33505DF47884DDBD1DC6BBE4098DF04A29AF6FA3AE344600D0AAB53 B3820DD7ECB600A3B8001C51AF2CA7A39AE1485A0FCD5D16F0657F61E9655AA1 B8326F1813FEB669F4EF61CCAEF05098C73D6BE54CE3936F10EE4C56D0B8486E 66F02EDABFE670DFD8F4C41F743CA204E5C7F64B9D06544E1AB0449A45FABC91 5F0536F53E88DFE702A9E92DC317D5587E49A2E4AA2D6C07BC2974FBE2069E05 4A56D8029AD43F8367FB7BB624A49847435ED26374035D5B1EB9505B6D8D7555 6665128B99C201E2B34FA0F362F572FA69E160A4AE99E0E058E53D548B7BE991 76C432D7FBD61DE7DDB8C0BF8B01CE184C35806E9141B79A6DB955DD756C8EE9 C3114D383290DAFD03286DD852D73CF5EEA5657245276DFFF49506B1E5F3EF7E DAD841A79CEB7ABD1ADED33DDED4BB921F6CBC1C8D7F711169380254070114BE 0F0FABFDDF8DFE74F44D87D8F424F03A3D4EEA65BA913713F837C5128203F99E 12BDCC878BA17B34D796FA747F6D778EF068DBB771554F9C64DBBE16024AB356 FB15A245924EFBCDB3BCD58ADB6AB154DAE796268F407EDE778DF79804532EE4 DF63522FBB599137E5DCAA0054CC09924603DADC05F0BFDEA4D1C2CAC0518633 E4D5891FE58A37D4055BD86BAA99E6B64CCA60BD8B7ED9A258C4EDD356EF78C8 156756286794E407A857F49DFD1C286881CD18055466F50CF2D768F319A2B1FD 116DE2BBD1C0E481D77EE0BF879779465E0E53605DBCCCBACCC3887A4CA8CE1F E5D3E9B3D84D1CD5BE08DB07B5A324C5A752A3773FBB420E35D2E2FAE456C7F7 66DDA4A2B0922EFA48C7BB12942CEA6EFBBCE12BBB85DE4D19E224E9B602ECD1 3B28CFD50CB2C66DF52A6B4E82A7E9846B0C9C8DB8E90A62260184FC1A470EC6 A5EF9FA92C1F9108F297AEB5C5618AC3DEA1EF3A730A16F8771FA9A65469C26E F63373649A4A726FC526F1D3186E8C92B3F1940DE24E3A30600F2196153E2B62 1A8B7DEC5781F3577EA3109C9A5B3BED4EE646625CDAFAC8996046851B50EEFF 8D42D20DE055117C0DCEA3A554DBE37D5EFCDAE137564303458F4DE9BC4248D9 79D0FDA7FA1B6551D4CD22F8995E514F11A224C572096A184BFAE2CAC0F49AFB 6344424B5C8940AF3EC477AB1CFD986C5CD99402D5A42C0485245938FDCACECC D9AA7E145D3F46983EAF9C0851C555EF2FB1F6987C6209E192BF798659B64E03 21751E55FA15B81CD76CB3F15DF85C528CF092498D126FC4DBB7D56F0164514A 999B6F2D3C2C623B97D0439CED312BF5F691573DEF8FD249F904AB4097028691 03D14E024320DB6D4F93C68926B8881B5485B445A668342F88E58F57F13A58DE 078296EFFFA5680BA7F2148852F41BBACFFED59CB89E459E9C71AF71C1C1C267 A2E22492647E9E90BA72039B18CBBFE8EC94B921C5C76B2FAF888BEF44E58CF4 484A5A41DF00263D1C4A99B1F1E887EAA3617C6ED0C38AECC08310A03C2870F7 FA0FE3A6D8DF769B55758342D5866E49C9724566C896E82F850DAFE1FF222629 3814410C1999D616142BDFD986C2DF597365AD905BE00CEEF4A1A0D4F71F7560 4FA1C02BC5D4CDAA18681EDE45A682619E7FF4E2CC574751757EA43C7CB85520 A98D8B47D45E291B0BA25EC803B465198F32981DBF99C4EBF3004FB5B083CBE3 A68706583F79FE0F3152B07E99F0016C9FF4B5B54415CB366C316DE071EBD49D B7535C5640892CB99DED62E24B73D6BB9626C685F9EEAD6FBD63679B3EF89DDF C503EB242CE1A0382877C1F93DEB9A4863863A908C640DA19BB24CF48CDADDBB F0FBF8968567FB87147F678EE8D3498C21FCAE562075A15A412CBA80927C8DFA BA47B7E80F3CDB6B1EC445197B6B20662BBC206C75E0EEAA11F245CF12336D49 4FC0235C17FA03991579C3F31E9A7254166B9144815891DDCBC805B59DC28CA5 E8F542ADF39F07757B06F9E1C8264BCAE3FDB6C710BC2C4656B997BF7E895DF0 C769722B5DB9EA254B34AF588A77064DA887031B32CCD2180632CD7EC4D4AB5E BA28D887DE6DC1B912C99AD7BFC0891CD1B6B8C836E7E3A037B2484E5974112C 830575D110DE9FEA4AD94D37E2843306A6CF744EC6830FA60774133D9C49E9C1 DDF8F9696D0A9A2BDCEC578F3D0BC2CCB8A22A5A0A1DC2DE4826837555B48549 8600B1A815CD60295AC56C048EE480536F0668D80990C823C80D5D30BBD7BDA4 3FB7F3160EA29C4DC74FAE15072613BA3CB0DED6CDE0ADF14F74FCE31857B969 947F1D98EAF5AE0C7B620475EB337630A05DEF26EC05A095154C800F5FAFE76C B9EC090F769FA91A2AD6DD034843DA9328355F24ACAFB92B4CB596170D86C6E1 DAB56B39DDBBF92BA5AF776B0715836F0C029214AED42CE59B77134DFE157736 2EB485B49D22EC67442AE02CFF856E5D5A218CC248545C6C748B4BB775B6F4AC 1D5E5081A6DA89F75FC9F57877352B11A78B8AA91657769C8B896CAD5DD35899 105A8EF32A5A587098F28DAB2D73DC010BCBDB039932FCB8FD0B2FD870653A2D 3F083D1F775395CCB83607167C83CAFCFDD46A094FD7FF92C8E8E4795D1A3EEA 859640EAB90738A930838BF0096CEBB153E8E31C6B4EFA0EEE9A3D6C3409CD86 4C0C881B927A723D7F0CD26EA22D19A84E063D3D287DC4A0C52BF405D0BFE2EB 9657C2F1DD5DCA414E1511A40AE5AB0666C5F3C35165094243663BB42ADE8D24 2371059D513E6133804BA892255AB1EA5DB425C93333FF05ED72C46963CBD5EC F0FA3A0A8F69D540A80709F7F6B0D661F27E8A7781C9CE377E2A6DA6BF4B9A8B 8ADF364D6BB4539A047E537F07A173F6AAD56AF23D86A9D185D7C513BEF444B3 74AFD0CC6BD827F8A4A7279AD44B1F4A2A2BBE646C7C29C084884EA31A9D982C 06FDC4B1FE261148CDC88B7C22CD1523F7DB0977F0CF1313C15C1A37C9563C13 59D43FB09DD1DA1966202DB846071B8FC90D10170B0CEA1B399D9348C12A6B48 A4D1B7E29A6A1BAD9DCDC196C6ACD309701472B2CDFD74726F32B3EC006C8BA5 C3C42348D04B854A715E104E4281C0ADBBC185E79323AAD97D8431AF0F9EC782 C2A09112D320E9CE73B22E076EF0FBA42FD6B841085B5D98AD1E21E3A5C5FE52 8C70E2ADCF0F1D73AE9FA188DBA10201965ECAD0FF8B4B3BE337C5E70E2A8C27 25836812ED9370F96241E9FDF1B6C2E027A0FB686A64A6F28B3158376E90ECC4 49C3576B52AACC696097843E79300AF671FA5B616A32FCC185145E220329F456 7B1718BE152D3BD2EDD04F902BB4004B86A351E42C89DDB6408D8DA5BF5B4081 29141535B88C2FE9ADC541407E8BD9AE33BF87E2BF7226BDCB924BBE65A03715 D8B22133004BD27ADCA61299C695B3067B773ADACF4728BC2936E88D21010822 F6D6F3EC7FD2D8A7595ED63F57622F49AC02E2F1BE3CE85D47993CF0508A60F5 4244EF2AAE8913C5446AAC25A79F4A22E49C40FCEDB7094FE4630895FC6F5DC4 344FFDDDC2213D3CDF06DC5E1BC3D3459337E78270D7E8E76BDE266B680C46B7 807EC85463C953CA2FE7A3BB752CA06A3D76E7A9754FE659CDB49151A16137DD 5CD47ED45FED97EC9FA52E3C93CBDEDA1B20CE230E4C107C04D81536B848C2D3 0D00495BF85B734602597D3FDF875F67ED5414AF8E75EEFA25C908071F3B69E6 83C8DB7F02477D339ECDBDED5BB3E4857BEC3D2E3AACC6B4A88D24CE90126AA1 69B040DCB3271DEE127E4A282859DB081315243A656DD7BC12F6A73E0B4E928C 72184B943B68B6FE55F0B0A1DE89AA9E5BB8F7D6B6AA767613325FEE4D862037 96B50FCF8CFD28E4144014FB6EE3D06D9D61AAADCCBEE13D01844913D41A365C 86EBE419EB591DC15CE5FB034311D28B94E608E30DA850951C786462177DE9F7 D9D1E24400F7BED0F8A3FB8376003AE13DF1569D93723227720D10EDB8CCD871 B10FC3E1FF09D556DB948AD8D33F4FC83AB339D89EEA5558CD497083DDC9FCD8 6689C802347E6B3A8EE054B2E0F8541407251C55DEDC791D9472AE888C2D50CD 4D1F1CC15A582C70B5DC75C638FB77AE444D0F1F629347E47FB8C82F5BD454AD D3F7534448DFBB390C60DDBA8AFF3F184F8C1D093BF297CC262CD291C1D3E30B 5EDB2DECB8758241ECB6D9006374CE0314FC311E20A806B4DF51C22A6965DAD1 8E0CC65BD6A7994529B7F63743B620A7DBA3EF3AC151E8CB880423D2AE76A39C 1458339A48ABC944D1226F96FFB82C5FFB8BFE6C18C759BF04D73E46E357A853 FE4A9F4F2457C9561D4A209A2608F9A49CC41652F181738CD572078A09023854 285A26AC4D578268A52349219D80E583F16156CF11810890BA43A338C7C071FC 3F6B3F65BF4A8959EC100B476B4BDACA054DDE15AD338D00B52406794538F7A3 54EF215BE1F9BA6F26FD79CA739C1BDB58959453C280D05E9CF81AC7F3F622E8 8B64A06AAEBB6583190E86642D056856E1C07110903998CECA2CEEAC915DB36D 5BEAB4E1AA29859BAB9E8A440086C0A39E26B0C2BB309E258CD51C886B7890E2 8792EC0B1C8487B9518C01F466AA62338E8ECD3EBAEFE6E0F775B18291F8580E B353376ECBBD1E79C7C3E7CAD68F28E269327DA29B4CCFE024706D5D06E314EB E470E9DEE1E53D255486F0DF6967D08DBFA1B17E9D6BD419970CCC0B2ADB2185 1CC2450254C55045FE2938CC6F2A9E4A116C557525B56C5FA9A0D98AB69E1F13 8C0FE8DD8CFCB16D962BE0D018D402BA00264A7150C6319B8ED8CAFFE842F147 190B5F476E4CA354A0AFB3054D211719A2EE14E116E95852B0C87329D2604E55 466154743994C2767038AF4742DFF0ACD657C952D8CAE386D87B1DB0D2E77838 55ED60F50A58A5DB1C54A29B132D120EF7E2B5C3EBF73FCF68ADC2D701E29015 6AD13300B61BD05E60100B8E58B48860FE3C77C50747939A1913436BE7C44ECC 2288AFF64F228FE0856B060F275CEB07D050026DAA8AA6BDCE301B451779781D 6E112D19BCE0A5579763B2307C959F5886A2938806599FC9002A110834FAAC80 E888863F10D57D1806BD5443CEDA18EB8C1BBBA16EDFAA599480E90B895B706D A4E44CEB207BA8B2C95DD1705D73DC3403DF0EDBDE6F4E801FAA74ADDB89A860 ABD1F77566915965C85FEF1B1E1C318606E7AB5391FB449DA176E3C0A66AA142 DABABAEF0AA2D200F8F40D964CC96498AF5905AECEB8A094D4073ED583EE6D23 9D753BA24DCCE3A158FBF68B248FB70100D506B3AE645A533DA349C891A43E3B 130BD45480B8C4479928EF547EEAB77720CBD8D95F710DC8B525014E8120C61A A5787FE250186FE83A0EB4D2C538CE92AEC4087325ED888996D25AD8E761BBF1 48D581ADBB10191444DE1B6433FDA1E2A67E829FD046514C9997C91B9FF7DD87 508BA8476BFEC442C73D3E9E8E009CEC5010D2C6087BF3ED5F180C41A8419F88 711D28D6E19F33653C8468A48E08F17C64316F2FD1015494E950D94E181F03C0 043E7527B6A405EDD2A8E14BF1FBE2D3BA7EE89B7499B3B80092E0C48EACA94C A9FC6F20A9A46C7CB1E0F83C2413681A502AB62EBA2348246561C0BB080CCC5E EAD3FDA397D63AF6ADCAF6D7AE6A7EC66D70A9C8BF269A7BE483CEB62EE8D629 7758CCF2C501BF49FA5B60FB97434E198295A2675E9D6C0CAA65842FBC613BEA A214D1ECAB9AF3867C805E103D3CF43AB56AE38100882EB4F747400DD4028A2B 4A55083E6420CEED09235DAC559D874438CF87A0C1D2A5C0BEF0E17CE9445E19 5B92C322D18BF4272C58C6E2E77BFE7E75731C199E1FC8B2CF15829FA1BF8CA4 226968E859C9F27953FB5F772C12A94B727930AD46E6B26D57B0A0FEF32F54F1 0AA55662F192F866C1ABAA189938CB51E1067F8D755109FA130F6CA99A9E9EBB F29521E434B9DDADCF640F66F66AB5ACC1341A9641B35077FF1B7202BED253CA 63958858CC2D9613670955494CA0D6268DEC0EC6CBB2E2CDF43B39886C35B2B4 08202AAE34EC387F9B96503A2C8E76AA8C7A71D7672D5EF4C404096412F1DCDC 16FF57F097A8F3B81F68D94A7EDA93DA5E9F85D9401A563D2FBB69D329FDFBD0 DBB2D5351673DB35083984D5AF9EABE25EDD36A3C63E0B64696052EC0C4ED109 1161175CAE19B9F10BCC08A018323DCC0305B27364A1210010A42B5CEB22BBB4 95C3D16EC43B8432334301C311CC87F6708C42B68E856E33EA8EDC058BE71CEC 80D62307328E7FF4657B634639591AF50E35A56593384CDB02CD43660AA5945D E8601168E3DCFC1107D5E1D7BA820D94673A39031F1CF34A2B7635308686071F 91589CD6B5851BA7508582C2B5BBDE34A75B65C8407AB02CAA87300145584645 74F443F86D6E243B97D19C7FFA01389E49135F8F7404E394F7167FC4568A699F EC5880BFABC0697DF28BDEABC630FFE04B9E605DEED94D83EC61543DF832A475 9352B65373B7AAA980E91DC5F80400C7262B43826EC1519CAD68EAF9E33E307D B3988AFE39FC9CA5BD20A65CF2921E8474F8689124A2286BC56D20542CA564A0 C2D19B652FE79E48B51108623163946D7A6F411BCD8862EACFA22620501E686A 03B03449CA8A7523B3C8DD259FE5E2DE154E2998B8CA9E8D685D3F451E54ADFD 2DF7E85564D9E067C2E496CFE5CEB6B6240772859B74EB2842A61CE107B1B9FC 56BFA95BC5DDB4873C0B453B9CDCF7BE971F30D81CE6ED45ABF6744457449E66 BA15A8E515AB1049E0F8593C4CFB1079756AF9B9FB3E6EC609CBD4D4EBA530B8 D249DA6D99FF84FBFAECAEB95FEB7AB232F3CE53ABA9ADFDF470EB8D33EF1F92 EA651BC5977F9BDC3C7DFBB0DE0467664D32980E65F6FCA6B9B4A3D36005C01D ACDB70663154931703AFF52B9A0D69BC85A8C07777712B8E0CC47937B420708F 0AE0E0F6894EA1AEDF569518F9BB60FD4F7F34D53284F7033E6726A2177FF859 3DAB3F6E1F1B6C5CAE857DD13746848131676CF8E29D46A0B2A08E9CD49BACB8 C96DB8B17426F119FD55EB7A1FD35410A942E776F545BC1770BC40BAEEC4CD22 2DD8967110CD288B846336275849DA4762CB23426ED847A1AD464C7F6A228488 348FDD8E07146AF32E44C759FBE707CB317A264865AFF5E688ACA739B82460FC 84C89D24C0402802D601B97A683F2B2C6F8C4617E40875ABFDAF152C49A2963A 2BDC9537A0821E4880015EB25EB568EF7A6DC1628721E779CF9923164FACA117 25AC97A51179CA5E11867FA96F918BFB557AB28BAE18B5C2221E316830CAFADB F89DF6513A07E4F3B7C04B5042FDA70EA76BA71B2A5B2C671C6DC56D484BF92E 401B7D7632809E20D34023B0EDF9B8258CDC162F3A4A4ABE8E80C46576C56175 6AAC3E045D0D81C50B6CEAC46B56C38C84F57D779EBEF656E0709D576F84102C D1FEF55696D0A7AD443327D6ED4ADEC33F48DFDD0E780E53EEB83367BD6C6ADA 295C5F53B22FE4A19738714770B6E672E43FB8287C9B615125E137A229438D0B FF2821E49E2AACD38ED452411ED0A132458B2A327AE1FD76D691BF3C48C690B4 994B2687B45DDC1975937052ABFC20FBDD05B703111ACB37A7FE7FBAC99D7DE1 14909D003335329CD1EEF74C2F37670DEE3412BDDE76E1D741EBB51BDEC15600 3FB037505A0150B95FF0CFEACC3ABA1D9A32BE4053C804C647FB1CFF46558E90 BD21E0D744C208E62D59305137AAD687EFA00C3BECF422880FCA6756671BDC15 6C3CE66D9ABF467C869D04D282C8795A25E73241D320689813980254098872DE 066E6DF6CE17635A563C0FCB4CC07C2F9B201FAEC1F77767F3C4D20884DCE701 96B285EC51DE37701547F415AC7FDFA4EE0B687E471C6AC3129A33D4E76738C1 529B83AE5ADBBD89B28BF9D8AEFED12241E45409C88CB6F6FE27F48D2E8C86CB 37B406944E64700CFA27011C8B5AD2E48DBE179F2EAFBEAD7B2F4AF4A7A6F723 235D23BA05139DD6BE421A17EF5F2E8460332D4AE3E48644043FBDEAFC2CA7E9 544D92395F1AB5690C943CAFF753323116921A2BEF99339842EC4E522A00A6D9 4701DE9E294DCB8067819ABEB739F3AF6D844977D368D868C0D8F29678D932C9 53A3AEAC1A85C8174F6ACBB5E915206C1C6A5B45D108ABF0A6714C1FA0B1E7DC E683F1FB2C0E722F386D41301FA83E8C000437B67D41AC1E29C4BE6B4F5C10C6 6B19E43795C3E96665F5FE5AED4225983B5B73AD7F66CAD312525D99057A0519 28C7EF76374D0A398585F49FAA4DAB277BB5B7435BA6BD5A7D31547A74EC61AB 84A7D2CE6EBEF110B823CF9FCE66CBC1D26480A85838ECB57B0CF1B45769F841 F76982DC2A1FDFD78C6B31FC27ECB38E51DB32AB9FF1A313EC7D4EDB25B1CA71 85A5FB5B43B80DE6C78D7E3DA6928C2360E0C6F103F774DED1094A60B041596C 8EFC3A4766C7431EA86FB3AD6AE55B88E451691619E9E78B0E584A686C0CB7B3 60D203B9356472BDC6393B2F396FCC1C2E989D511533F0F3E7B05EA62B8DDDAA 17D572EB5D2A0906ACA5FCA43F5E4334F5D73CDC7BEAE297F0843610945BCBF9 8FF9198055C95AB29DB3FD452EB907EE0A0209402028370F07EDB62F19D423D3 1CF03979DE85203BBAA07654EC8646463CA218A812637516043AA55E52036F8B C01A8692ACB9C8F7CA8E09E81804C85612DBDDB484F667A2335A290CBC697DC7 A546B7027E91803BDF8053FE6EA4945DBF76BE80D56D1F93A4FC0CD6F105F8CC 83E5BC6325D1E180E989F84BF046E3E4F55FA69D0393C2EDC0C2922FDA75206A 3571CE45F973A1BA110BB9271AD0D55C35481FA93CD0002716FD44A6E6993A1F 80A434F32ABBFA8806FA58D65C824AFC17C1FF17D2855E7041C25939B0AC813D 6C22A86EE61195AD166BE485C514EFAA4BD8C2FD57D0FCB948B97771B48B177C C61645AB1205A41CA29F236DEE793888C6F2D4F13A383801E0B13ADA3C4E3D71 F3F29BD6AF8B26F1A25707CAD7B9EA3C1F66001C7A8E1BCEA6E59A71C3BC60B2 C5DFDC852884FD95E4739C450751AA915EB606532929C70DD68FC45AF857A394 E7093A0E4492055517ED0101D6271CF75179232409D3660A1E78343067A2C9AB 5CEFD2E46A44A7323AE9C2F1D40C312EA4F248EAF76A0ACF896EF39662AC601D 3ADCBF665BAD1ABAD59C42E0A763259780EC75AFCF61CED14AB432890158C3C7 21E0327A0392201F08C4F66A4795FF05609BBAA9F4B315F658C73F970A123058 2621B61F03BB942C6D3A28DB178360579794EBF0D7EAB385357E317A3EA95B70 1E5394383A32C85534C12ECD1BCC451683A0BEAF3C4AC4AEE1158BF4B8F59661 4C95CCED4BDDB1BEA58F1BD02BAE81B5E6FC0D5E597E79901E2F26334ED58250 5EAFF9BB8119E0B139407A7FB8614885FE55BCF8C025067B632F0E760320A253 16E5022775624611927FCBF81EB4751F8F73B5069535ABF9CD0E3428A907EDCA F4F0D095B29BF77B4A90BDFDDC94C88149CC3979A03713858A317F6B5BD79A27 22859634E353D51C8F5CAC56483EFE85AEEC25345E73ABB4124B839C2A58A4C0 6328A96431B0411B64D65E90859696F823B81A53D85860CCF91B607EAC65D256 D39E94E34B3BEFAA548B8E91B0D931E8E80F35486A0FE374EA7A5E64F6DF802B 6779329A0F2E8C59587316B4D064FF1C6F7FF427A8F3F5DCCDE476C87FAD31F8 D98BF53002B1EAE1AFC83CC203812B692403C3EE4620D22C82CEB40B8D839D48 FEF11071335FE2D5FF26906D7F916BBF3FA8EE7A2059E040014DB0EA1F0F9C80 D327C41D2AF6CB30E2C6F3BE619D5A6A4821862E02D318D71886B7A6E591BE1B 4E10356F031759BE8F88A0F451DB9A2E7A44B34A09A268F69762882ADFB03126 65EE5EF8EDBEBC01E84A55B0E0309A4A85187F6E70868E12AC08B2B195E0328F 8F496C25292D2A67B39B10E1392F9AD647A7984A53CCA5C35CA64CDD69EDFB38 951D0AB7F0AC74EAEFA7259B2FBC3CE3CCE97F10EB462F042D3A93BD2C65025E E558620B0D9BC5021EBDBF1283193C5274B8B90BA9C98B09994F9E08232AD67F 9708E35DDCF0DFB1DA5F2D5CEC3BB4322105D6C9BAA173DE47D4EA70DDA747AA 3A1DBC61CF3AF52498CC6B0D06EB3B6E7997B0B39E262EBB21BF80B35F3228EC 46A766DEEFEEE79717B8A6A5BD50D24CCD59EADEF5DA77C15485755FF48E4412 014946DA9801FBEC1A2CAC348896E5A7C81F36C246CF3F71BA3A49164CBAEF1D 59F2E65F72252F5DB1EF22F4F61980C73F50C399A6F3435531F826E384408C5A 2AB204B76B3C0E7E83C1D3BCC722EE08A8E66C69EF3D9C7292BE61260CB94652 A67F84550709AC1122B6FF538A24EDE178C35B763D3286CD1D0854A40F6E69B6 013A9C1A33835CB58F6FE413527C0C2B0D344BD27E9DE980226191C5731A4C23 9CA868A706077F79F10BF19F2B778115971CC2AC123B8B1EBB2E09B4CBCFD24B F1DF4EF0F2153F672441CBF7FFB0E64661E4BAB2932B8D2D3D4517A565734F3D 30B77FC82DD45170FF8A092EC45C3EEAA296FB665C415A040401F3DCF16E88F8 C51B97C6215485B68559D4D16532B876B1F26F537ED420DF388607B8046F522A 9FE423C1489C5236D7DE6AC5B1942660BE715E1EBEAA264C425537AD6DCEF77F 94913055AC4D4299AAB7503A6A9635A318CED5147DCE59ADAF0642425DCF5641 2CB26254438120306D0ED76A65DC171AC414F03F8715411E008F1DE6832DA479 E441B3D03B7073F9FED7ECC35602E21BEC520F6C209177942DFEC952CEEA062B 04278794B1AAA97CA460688712319D1741CBF5E2C536497BDE33E27F75AC9DEC A96411BA374211DC761961BC0C990961579C67213F6FE841885DDBC52A6C7B01 184FB33D8C8AE1092D9A28622458E72E08E44B77450226656EAFD599340357DB 77358395F311966B1DE628EEA4A21CA876DCD978D02EC1890A93AC4690DF4FB5 52A532EB2C24A0F7E9416843197CC063492243942135E2097C0460A15CF67B58 283453548858AF32F0A4086433647E2AE27B27BBC2D9C7D0258105C6AB2D5143 8B0B1099D4B2279B2C32F28BE1FB831AFBCF8A7EA6BD51BEFF1A0986A417BD2D 1C7651A235330D1F5A776D1A37CC946FC8E41C390F3A9CAC09800B62FB21FDDA 186F4BB8588363A53CAB115AB983E0BBBAF1187A49CA6820BFD93A5F72326965 CFC483897AD56543DF442960D22679A56E578A345168742923B58AAFEFADF10B F1B50FC83535078E43226F32F091AE4B3416E74C0DB58C9F27BEF3F952E5278E 92C8788CD441EF39D698304DF66A214D10BF1C608FE53380CDD5A13609CCD65D 18FF5922B565E88C9077BF2E12344C3FDE7EC02F3713ABE156A2CEFB7B852E82 C79A8E698E9257CB5F7CC6ADE2BB0DDC56E95682F2CA9B287E4858EE28C148B8 01E439058126CDE9FA94ED0EADFD05BE78D18FEDF8FBF5A3189C903437786676 DD2C68B8DCDD872D404028CF8D4C47E9B5CDB8AA3D82EDDBB68B991490F9DBE3 3EEDF40384A6F257EF1512B908CB17111B6280443976C56F8A56B751C0E9D09D A5D61C9BCCB6379A7A710FE09124ADDC8CAB8E71DC0F1772B29630B103A10699 43CB222BB5BD6E7BC70D7D7106AB66514CE69BC37F6416924F0EB7BD9476209F 6AB6BD7888493EB4ED55A9E1BBBB2EB041D10E092851C8ED3A40001CA5D35C1E 5990F8923EBA1ED391960E43CD9F5A3D415F61DEC83390BE8AAD659FF0BC9797 78F4D45509B3A57740A06D796F4239E1AF5128C54288755EA0E31EAAFB569F60 39BEFC44606731414B3C5B15B88662096924BC862A8837796440FEA8E368C875 10DFF0756947DF5332DEACE67BEEF31062B6A643B49144F8545EA7D9461B634F DE1217997EFCC7E3293B0BE861E0F81CE4C8167D599DD507B0BB0E111C08445A 865C229969DC2F5E3F7EEF5B523D3C1116373A83C245F94CE4B503718DD08CB3 FCFC24E8E8C7627E529F72521F0BFE764E851B08E7BBBD4E9886D92E0F17C5E7 08B6E21C54A964C3CB08B6D7C367070E6ED0D667044036C343AABFCDB6C8E665 B891A0A936856AF932FDA61AF8FA962BBFE74037AD393C128E60F611D4F11C2B 42D7C0881BAA203913E81FF68FF365B758D769024BA97D0CE0A5272888967AF3 E0743F34AE4B0F2F0CE61D1B0F6D2A36AB2E72B1B54A86BC4DE5829BCA386AFE 33429B36FD37CFE9CDBE178380AFF2095948786E1021DD82D97666DBF54E80D3 CE578C9FF3FE1345050B1A17C0C131ED59A12F6B0C23B3E2B5C37B577602D068 530C82258DD8AB704A91502D0644359CB72790EDEE5B09C7C7DC5537090F24C8 E0722A13852B545EDE060A35224FEBC09D94033794BBE1B51741CCB419A50A62 D55BAFE10990CF7A1758879F63684C3BB8A3C07995F273067922B0C0A380F164 8DCC11E87F33C6354A30DDEA84E735CA06327F8F13433DF6572C4C1784951398 BB3AB6D60C8D38709382AD60FCC06D8257D9A17BEDC11E9D814BF4E693773325 FF7752471682F5EDD47E6A063ACD4A12C21047C9F16AAA2B8B06B6610255112F 32644E65E1EBCB4E5990B620E1C115FC27F91FBA032ADFE83AD84D9307EE9E37 CAA3471857C0837FDCB84B57BF701730FDA529F9E44785E50BB9343A20116F07 2D35C136318CED242D3A26CB3F22BCA729558BEC29A93F5A7ADF91D0A5475CD3 A039A0CA0CD58F234FC8920701BB47D92F8BDF9EAE62440A3E4D336D97EE73CF A831ADB786DFECAF0651A0B12179CB405FCCBE2EF021FEF7508DEA6EDB5529B8 C47E1D83F51E7F086FE8A291EF429360DB4289D3BC735DE1F003673FB139FDA3 5A187873F643B439409509198E767574EF06A40D65E2317EDD0B44AB4C7D95F4 1AD6A3CB3D59E43EC1B6D7E41D23041C769D889185F8AEA1E17B7A2E06310C5F C29A7DEA34E1DC9C19CDED896AF37DDC24A8B7555C45E45AC864889D1E6C81D0 8F6C9FF244260C77E944061808371539C4D4DCA100E88E0489E28AC5F576C7B0 BA139F23E53A17B5AD88997F94E3B8B174079F69043E0DE1EDE88DF6219C3B4A 000454C2C995EE9C647E7292B212F0B18AC51CC157C9CC897F495566E0BC5688 3B58D095D0A46183E3AE5F7413F1386301C5C60D6803895EE34657CBE4604BFD 50E2934CC8843649B439B517B7395808ACB81104C9F1C7EEB2FB6AD3C90213CF 343B358A9965BFA5959B32F0D856EE3199FA603CD1CEF587FA9ABB38E2E5A401 76FEA684E6717447BFDEB03C31141239AF46AFBC08A3856718B47DB2664DD126 5787FAC44C6D937ADEF0A1E44001D48D8C07D4098889C3C9E9C70DBBC0BD593D F91D48D4333D0DC7B7E3662C017187335CB464B16321EC8A37D62E87A01145A7 2ACE305F32166D8653C0EBE270169A87F458B6017EC429DF9ED1DAF0CFDAA9D2 40FA50168B168399D257C911301ED0551F46E8E3B207C12CEF67E1DEADBBF71D 9B3B9C133EAC95CCC574E0649EBDC04D18B5979FA426C5A949F4386AC7CF09BC B535AB6EB118376F902DDA38668B93FDCA937D48DC787679E68418F56A8DB25F D71127CA050604D94AEF32BD17AE5E4EC55790B03D56BAE9ED85165902B587A7 C4DA6239589927173127F579CB17671D281CE7D69502F7AF36ED99A8070E70ED B9DCC92E0416ED082A2FEC7494E88000721170852980EE0B988C6A963F6303B1 11BDB4C5B4B467E578BA8F6905B9DB1A4BBB544982CE60AC7AA1A148DA495012 CBDC9389D5829B138B8ED95B558571FB77AA084709D11521EB25FC977655BA25 8AD09497353D0CC1EE31AF6B104B9D3B68A902DE34A1A59BACBF328DBDC12AAC ED936D98E3CBC2FF5B73855D8434862067A0A58DB577559A8BFCB8587201BFEB 5E1F7F629EB2B204C1DBDE244287D192B857A90E2C1524F01D0DA737E84BB6EC A55C01F66D9F46A4A1B0932EC795F173282367412C33F5AD3378E480D25431B2 93679BEF3B794FECD75A577591CC61E568181C2CA149B8DC1445A3B8969F6434 77C67141110283EAF1A0E8197CCF6D2A2EB83D29DB5EDD70D7C9B21FD1E24237 CD7E5F04738E38C5EBFE16996DEF57D86C966BA101F15D1ED12A52980BACB550 B029B502A03A894118DE8076BCDD72229746B48F12742BE34EE3DFEFD40D3834 29EE994D63FEA58DB6334A86452F9678849BE6F2EB4E1D1C305FA9416F33E545 2CE45B38A98FA04561BE71904AB7E7B5EEE73B2472AB5D1D6A21817E2BAB34E9 15D0D4D30D5F60A4071625A45697B9A461153B2268BDFAD92B228E622D027D32 A9689196EAD798BB3A1FD0EB1CF5E4E657B99D566B058B13B3EC448BBDB9B831 C147FF01D7401FEFB9A6493DBFF3B324324B6AE9987B51164038BAE4C1249C5B FBA9C6078A9586A546EF1F3080A2473351ABA71843517855EEBBF6ABFBBF7121 B0FC9E18BDC4143C98DB3292D94C360C1084D11A9C85BF69724CEFDD8A927E4D F7BB6FA1EC2D6F98BC783A7BC15D5DE0B58BC00529DBB919A4C6F54B99209B68 8C480C6AD5E136DEBA2FDA31EE8728AC7DC480584ECBCC34C979E4C880248F60 274C1A8EECC0BB7F0FFA3AA93A637A88522A5B72EEC97E6A04E35FB461BC6455 367C23583C8DD8FCCBDA046622F10D2EFE1F06A688C676598FDF1AA740C569C7 7511F38EDF2247B2F1CD286246006A09182436151447E93F322C2AC6BA4BEB1A 619BA8BFA7A55B87BB29893ADAC8E10D363E12D8AD1EF4FE1BB1F85AF4E9A877 E597082183855D10F63E5CB811AA4D33C7CDF7DF66198E09722BC653629E7B71 3930A0D7D0286C9E5DA2D6301EA21EF501FB868B7581C8203182049B1A516DCE D15D97D4BC741B398F49FFCB5D092BBAE4C4D3A8220D7D51D8A5C12A38AB27E5 6D4B06BCA68A248264BC11A233DE5F268AB64FDDCC2426E49859F528810C11F6 79E704DC4E050FB5C2D3D0EE6E4207368B43AD7A924F566A61FB04339E8115FB 8E18C17EEF887192A5F47C8677B6A4F4E6629493477E5F9D2EEBB1B1EE3E0654 898226F072C4D5B31504B4C810884D95254DC5A6695844FB02764CBD3D7A47DE 4FD67A0CFD26FE4CB1F67B65DF835F37C0F0002D13367420FDC8587F3D64CC65 5BD8A3E7DB4CFC59D296024ABE262B7CBAECE6D5F6D0F4BA09E495EA10AF7C21 3598A870C11DFD5E73D41986345660E7AF71229F070E1854CBBAF087F81B0D2A AA0C3213587CA134D223AA3031AB072A78D428F9AA00F17C05DE44BDD4558602 E93DA6145CC2BAED27A1E4D91F95A27062FE8999D1C3EAE4DA343BF20DAF941E A6320924629BD1DBA3F6D07106587E7B3E32F6FF989B5AD219C74082B6063945 B5AA225AB7F47F07C0245F4FB5242BE1771701711419FF262A5B0B00E693710C AEB118750C5DCC383B891592F97F96C88C9E39A484E1608D9BC78ED7FF3D6123 147A959BBB9D6F28DD1FACDD9B57A8587FDA7FE20CD1AA499371B0194033DFCE 2A302DA29658E625D1969CD37BB637C47BDA3F5BA20659600CC2A9EB8EBA14A8 6C41B00E63FBC1D84FD18F4CA3A0DFEEB21C5F3BB5518CBC8A580FB0E54A60CD 5A9B393ACE416E8B3E06227B229FC63287EC6D5C583EDE3DDF91D0992620EEEE 0675C532D444E03A777EF544091644E4D94E5063A176C260BD04A96AF29501F5 F71E5E5ED34EA33DC33B9D53342B07EC8698DF474ABD9345F050D19CECC5D5DD 2834E3921CFB46646B5F78F7693FB4D1977038661A72062578DE6D79F753622D 647032B5E0A2DCB7F9A318EF35286D30DAAEFECAEF127603803D09B9ED549E9D 796D15736C5D0694680B64A388163583CB297C0C2401691C208CF2CF8EC8B9E3 4293EB92F974D74C4238A22AEC08B5335FDF8922AECDDE995B4EBDDE70337995 1D3AF6EDBAB6E1E51D7B4916D2AA350A2542409159C2A89ADEE0F9F1AB6F52CD AF17FFB2E07C00E22912C182391A7E75956A14A2CAF460E19D2CBF5FCBDE2723 4A8BC71D1BBF53A11C36B15107667CFB42B8F5FAB02DEFC847467878E9933A91 7D77100CC2A28354806356C7190C76AEDE63BA271F10BF9AAA90E9A836241D81 9671618A56E16E0BB24BF132270A7AC530C2BE30DE2531D3469D8E47109D8753 D690E5DE0643AE92D23B4B9200527B0D7FCC7D4A6531BBC455F673142CF2A8AC 477A54B4B7306601E7D45E8B955F28065C36A6472CB278D1E33544FBEE00CA7D 621FDF9399AA84B6FCA4B2839DD23ADE1468BA4EE074B9F09FDBDD5F0BBF3703 9A2DE79569786CD916AC8D39BD3CC3C8435038D88D1F14C1F588EBE3C7B2CCAB 492242A7585980C8C7C60F9F3660CD29D38D3BDEDCA8825DFD08240D3336CE42 8280B9BEA5091AAA05481CED616F2AA5FE1D3B3C50C4BF911BD02A6E8EF35E99 D54E5929798E37A821A4911F23A905492A3941D7DD8DBE5CB8DF7D4F04829FCF 880BD5BDA475104B9800E901E018D3D1C1F2A1648F5E6CBF6DDF4FC088D336C0 8B50446CDBFB7F5EBEB07F730E9E03BF30FE460AEDB53FEAC31E476028C191AB E740BE59B5A4DFEE678C9C019F6E76A769842F0DC28E189AE2D670DBC1B87663 EEEBC0470A78812403CC6DFA030223266A834780BCE7405792F35D64B0CB3B6F 04277AD13D5DCB19CD625DF40073FEBF45F685D40B53B699B0542226506A1FF6 5485424629BD35E7FD4E011DA422882705879524B20A1B5C32B3DE52FCEC1EA8 2F1CFF38C4B1B2E24D13C6112DC518EDE043714135589E5943F609AEA30C0680 7273F192A9914CDBDF493DAB956459927C67412A2AF3173EFDF2BA24BEBEA818 8FE4A8A6173CCBAA11665E6F529C922422F2F600C1D901E7B44D522BA61AD3B7 A8C9703CB75061A0F95D10202FC2988732B01AF534C3DACFCB960E9F5876626D 9A9890F48676A2F13591539B31C3AFEAC89A6C090D5A1046FCCFB6E16FA06283 895BA9DFE59C0F6D0B31600139F5D461C06B422840C5055515D1AABC4CAF162C ACF080EF99B19E9586DFEE522196109D601984E7261BE99DA7F609CA236952E3 B99472AF967258F62CB62889F2467C6E29D22706FF37BE7B14DB173B12B74F89 1C66CAFFCC47DDF9609A8AED640B1F6508B404265DF33A2CFD6F1569F8F5D5AE EB9B39DBCB308576BDE909082DD57683FCFDE990FB04492D76CDD5A13FEDD921 AE9DA75DFE0C03AEAFA305CAD2B70C4381D735822A379B793A0A79402BA0200A CDE8D4ADF7C221AAC9716FC37E9A7E062848320CB46A82C52BE21ED5CD7803BD ED8FDE06FF66ED6E3E767474DDDBCC3CD2F08D6F4B24EB7C9D3345E8E24C2060 C60600373F496DB53CFA8107B412789DDEF788E90AF8CE6812D2844A62664EF3 CD6AF981ADEF5B22F9C28129CCB21AA403B21ADE14EC50A929837D6D32BECA0E 6D69E72423D0755B4BA0108960EDEC1EDEB53F2134865DD6EC6697FA0E52392C 87B71B85D3B02AD322845E6A4C1797AF88F2EDB351A5E8570111821EAC397042 BED2F1F278800D68D663A3350CDD992B528E3D2176DAF79AC03F6455B1BD626E D15299042B46F03BB46B992109329C6F67F1CD92A620FB4D806558D6CFDD75DE 4F7D6C558CD5325302BFABBF40001F90CC940511F63F32F112EB958944E37A60 3642C0CDFC7941D9EC65F1F5B2805EC17A6662FABEAC3F1A7CE8A4958D64FCD5 7759F5CA294236B5834B0071972DBCFAE0D89A1BA76FA1EEF2C8ACB12E45C8D8 939B3EF1DA3970ECD2A330AE415757A89E44CED997FFF9F6378FDB532ADAFB25 872A690137609D91405F4FDA7B432D432325F1467A7C85363A9E2825F86D5B9F 9523E53FC5B58D82CB2890D43D172B2CBABDA71E5B83928A6271468C19710858 4BE45647AF5C9BD930E418E321AE20B3D28980B1CA53F8B2696043BCC4C925F2 18B0AFF8E8C2BC1B85A9134BD28FC51E5F4E803761720601C5D9D87921116C34 2D832BB14EFA08032E5D7C0C4F14F118883DBB1CA0313B6658E3BB5A7ABBA497 0CAB64E66515031BEEA7F0311CD7DF8CCADCB38103DBB1D60CE59FEF567B2755 D0A65100C8F8EA6220254AFEC5D179796C4F87808A76B3F420A228544CC12427 AE7A5E2FB6CD76D4668DBD5A22FF8161EF3FB20EE9FE64EFC4D1E466DEF81D20 A395B020BDB7358D50019D1CE3FBE8067ACBE03B2B1C6088401CF1C8127C5E02 480CD7CD5B99F262B2BF0F0805E487632FC89FEAFC0869BEE7CC4B905720B581 D4F15698059512906714F69168338435643E7B9BBC1FDE03269DA45CBBB11F02 56EA5151ADAC358C2A83383E744466CFBD2568A3C50D24B654F4FFBF7073F21D D268A3AEC6F5D96E508EC4FC3E0E4A16CD99383549486F5C8ED1719926D3A949 D475A239C017F58B5F07F177B6597B7F0DBBFFA72C8CC600EFF6730175087AE9 8EA75C69A3A58EA46CEF33E61D7491E0D111D9E5B68393481B415F924DA0CC1B 676E823591CCE366897C03451306141A3960022548588E5F7CE30A08DB1D8159 4727FFA59EEB44ED08FE6ACD5661DC73 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMR10 %!PS-AdobeFont-1.1: CMR10 1.00B %%CreationDate: 1992 Feb 19 19:54:52 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.00B) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMR10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch false def end readonly def /FontName /CMR10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-251 -250 1009 969}readonly def /UniqueID 5000793 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5CF7158F1163BC1F3352E22A1452E73FECA8A4 87100FB1FFC4C8AF409B2067537220E605DA0852CA49839E1386AF9D7A1A455F D1F017CE45884D76EF2CB9BC5821FD25365DDEA6E45F332B5F68A44AD8A530F0 92A36FAC8D27F9087AFEEA2096F839A2BC4B937F24E080EF7C0F9374A18D565C 295A05210DB96A23175AC59A9BD0147A310EF49C551A417E0A22703F94FF7B75 409A5D417DA6730A69E310FA6A4229FC7E4F620B0FC4C63C50E99E179EB51E4C 4BC45217722F1E8E40F1E1428E792EAFE05C5A50D38C52114DFCD24D54027CBF 2512DD116F0463DE4052A7AD53B641A27E81E481947884CE35661B49153FA19E 0A2A860C7B61558671303DE6AE06A80E4E450E17067676E6BBB42A9A24ACBC3E B0CA7B7A3BFEA84FED39CCFB6D545BB2BCC49E5E16976407AB9D94556CD4F008 24EF579B6800B6DC3AAF840B3FC6822872368E3B4274DD06CA36AF8F6346C11B 43C772CC242F3B212C4BD7018D71A1A74C9A94ED0093A5FB6557F4E0751047AF D72098ECA301B8AE68110F983796E581F106144951DF5B750432A230FDA3B575 5A38B5E7972AABC12306A01A99FCF8189D71B8DBF49550BAEA9CF1B97CBFC7CC 96498ECC938B1A1710B670657DE923A659DB8757147B140A48067328E7E3F9C3 7D1888B284904301450CE0BC15EEEA00E48CCD6388F3FC3BEFD8D9C400015B65 0F2F536D035626B1FF0A69D732C7A1836D635C30C06BED4327737029E5BA5830 B9E88A4024C3326AD2F34F47B54739B48825AD6699F7D117EA4C4AEC4440BF6D AA0099DEFD326235965C63647921828BF269ECC87A2B1C8CAD6C78B6E561B007 97BE2BC7CA32B4534075F6491BE959D1F635463E71679E527F4F456F774B2AF8 FEF3D8C63B2F8B99FE0F73BA44B3CF15A613471EA3C7A1CD783D3EB41F4ACEE5 20759B6A4C4466E2D80EF7C7866BAD06E5DF0434D2C607FC82C9EBD4D8902EE4 0A7617C3AEACCB7CCE00319D0677AA6DB7E0250B51908F966977BD8C8D07FDBD F4D058444E7D7D91788DEA997CBE0545902E67194B7BA3CD0BF454FCA60B9A20 3E6BB526D2D21FBD6D78E21A936F2E123C0F6EF41AA2266CF51B513EBF49D4D9 2C0C93820A37010A4C8990B3D2551EEBA36E8B8DC122B1432A6BA9A8A674CA2D 5F3DE1AEC33589A13F6DBEAFAF69B753BC0DA94017AD3D1CE981FF38A306FE6B A6A35630A7D636C1FCDB936F6BF9366ECA151A7994261C5753A081645F671114 B5E2F6BC08A8D70AEE71C81471EEAD30DCACA08D817FD44D968C90C13CD61C96 450AFFCD62A4DC0AA440A045DFCAAE74590B3DD20E53BB454DB1D1CE0BC5EFDB ACD8357B38D57AD256B2271C04919BC6A7394F2AA1D1820898E726AF96F1A4AA EB28A369B460831836F084B0D4AFD3627F1F2E08EB4C6265BED1C8B6E64651B2 51F5E30028E43296A0548F6683C9241AA96C01F7B4AB203DB761FDC536FDBCEC B22FF5B063D808ECADAF3969E4697995ABABB9715C492B201BF5146D61066780 E278AB7CFA6BDC04E55F2C0C1F2D4C0276E0FFCD0390BB31920407207AC57329 1E6E5688C00BEB6C5031C3E0E116A9C711264EBAFE4EFBB816CE9EA5EA827C5A D3F494E59E191D6487269BA5FDB468183A6E36EC7D65E4DBB5057CF7905EB895 B4DE2057FC3CFDE594B3380636F06F3DF2CFA6BBBB7A91544738A53E8E2C906F 20191EE7A0A0EB4230B46B218B6E0F05736F24340195D62C69D693B51D46B291 4CA758C27E1F9C7CDE0CDC01BCB9108E63522C46C7D8F6EC54D6B9C45B388FE8 4A8A1B5899B195DF172AEE66BA2446568997D1B761133CE60ED023F6D8957226 C2560F3D2E8DF52D35EE09F44D6519060FB5DA6D70022E0D5A8E53CDE99340D1 DB63E7BF075DECE4AE3BCB342E8B6DB9721CAA604AE028F20B853EF0414CB723 B3506AFF4D812732BEBC5CFD05A21A8D7ED0964612290FDBD4A339DCCA48A416 25E53F4302AC7696E256FA1A3BD35F47FC00C63829013B86D1A26A801319EE15 0FFB2E7AAC4C01FD73C29C2376B73CE5E992441B0DF69F87B8CD7BA6E4A5D27B 33E09BC473C70D3922CA93DBBA9B88D0342B6283E479645A74BF527DE4174FD6 8DA8D6B242E0088264845B956487663A73E8E672A2E9EDCD7237A52A95D49307 79706777B3882F31F29C281FBCE83C854A5A1D10160F5A6ADAA2E20291B510E8 B0608924678D515EB7F2452AA787BB7D77A88286BB140BC90B4E8D09B59F35D1 47D975CB8C7A329ADB34744179F0E7A75B37196ED52D27553350947E67DBA706 09400045ED6A680542620F95F5B242CCB02B6E6BF6547F78AA9022F98447EFA5 B5D6BCCC3491A9330CC49BE3D72C34DEAC5756EDE45948A1B4D65AE953BA742A EBB9E8973CA5736A81DDCA5F7DA80BD5C07430FEE080D288563669C47010FE62 36B3C5CAAB9A45E86A2FDD4DAF3F85BA53CD71AC8A5ED1139E6FC19BB8C11D95 FFA063859F91D6F579E8CD062A00E8D1D37B11C717F41E5F9E3051AFF77F04B6 195C0B9DE5491980816E814416CE9EEBBE52B33B5A5340DA7EEC49204639C608 01C1EF4E0FBE84E33A1FE549E172D3AD12C9888E2B02D6CC14B88EEF85EDC4D4 696B00A669BEE00685E959E6D0831D43B87D2843F6FBA80F22AA4440875E68C6 DB2ADA3647263E9E07022ACDC7705AF031045E415F468EB8865CF2D0A61F5B92 02689EE81BAC1D4BE02CABC0D1B0F31398B13B3EF4318DC152B8B3CEC1349E45 96A45FE68EF80710A814D11BAE63039515C10EBDC155AF963D064E3D1EBA219D E3491B017CC936C5F4A13460A0BD6A051699FE69C92C45DFB917DEF30ACD223C 389A25E538CBCCD5FD1F6EBB0B68E4144AEA1E680DB9E9ACC468A8A857176BBA 73484A9C397B6B1A6585783B558BE07EEC4A165C16CF6C47EBCB6E76DB456E66 9A2BC6044703BCBA54D77A13437DD8FC4CFCD9078D009DA224C38C72ED3C0A2E 75DCB5D3E39928937612BBFAACB4441D3425B85DCAD98A72B0FFC457BACFA252 5DCDBBBC05F7BF56456E18078271C3CE5201C1E55EC95A95AEF9A777CB68F8EF 2EAAB49C5A2193218874FA930675824F86C8128B57CFD95D39BB932A9E660AF9 33E7FC321436D60A33F71F621C138AB17C80D05C088D8D7021EF9EB3C60958B0 6A562D92B3C7B5C7514C152E67F2FF27B5625126014EC53EC2038E2AFA06B648 0B346FEB201F1F1EC58FAB51E3C412D08D46769C87304F792AB7D0FF196E2D08 0DB8FA36B759D0566DBBF914BECDD4DE2928A3E074D4DD0A1313F78235CB871B 9533A7FE7FBA8D18E57F25C70E38C2E4F8F3A851A351389EFAA0AF7537417363 A4DC0A7AF955006DEF061EC9C123AF05BF429E42C1B7E3736917BA4CA753CC25 1C201CF483D515070BB13D9D876C53D86EC536CC8D55B284A83AAA36C6A8F4E7 1873B30A30FAAC1525E06969C78545C5C764924C76BF60BE18E9E3F24F98B8AC B5019E0EB5CA2277F47386683D5F5ABFBB925D24CD984A84F3E331CE22A8EACC 6B0C971C2B50F6907B8AE6484241EEF176CB7510BD776B706C02861AFEDC3A47 B864851F3BD236319D38CB02BC057A300EBAC7636DB45D4144298E4E53FA6F4A F49C4FF5A64FB25E483EAD131090F000D7EC5C74369870C1AD117137B2FC2A2C 2F9FA5F5C278EA3AD7C8DE24DCC694A913771A18B7B05FD20654C482E695E070 CB3DDDE756CD00D285E1018319DEBAE88800BEA98A5C3244A541802D43BB986E 30CD0BF4ED47D6B91C521EBAD322E0D06275ED54F773F38528F7DDEDBBBDA2A2 7A662A3858FE28886448F0CFD7ED9E6C91F854DA27014F2AB900B667BDD4B6FF E60231C4463067130D8B75AB8F1C74D121B3ED3E6FA72F17BF2A336D4FA448AE 6287207B58323010C9E26A4459D380E1736CCA648F3767D2E7DEF262D5BD44D7 9E5EBBFC0162F7283D08DDBCC5EB966EAD35D503121160E9D76001879B3FCA13 33125CB6764B0EB0CDC9C7D81152C2CE14F35DA241A0050B999D27659276B7C7 D0ED63BA885F5EAE9368433933AE27D53CA71F417DC03C9EA162358E8A0A9761 B8BCE37C1E62B0A6966B644D4509181F4634EF73C135F7D085E884254EB680AF 3E36E97D475B14266ADD61D65C0A4F9FF7732457C1AE695C0AB785E5728ECE81 FB39ECD0B00195DBBD836D914098D43D1CA412ECD14DAF7E4B959E154F058F65 DB61310257F26244BE4E2A2BB026318BEDB231965ACB3B3871DC19ED2D58AA44 1BEBB8F77B490BE34AF280EF3CB72651C9AD5EB8B5E0D5234DB256408C9575F0 C840CE3B7B36C0B975175BC47ECEE96B7828D2B1B59A3C459CA93CEB15C22037 904D7A4BDEB817A3EAE488DDF3269B349FF7D1A9ABAB722AB50F460A2768E06F 48D893AEC345841C396BD7CFD3D27B6BE6D10F188265FF7A2C7C0D44E8BE764F 5D942414782C405255B11DEFEB5E6C5B9DB8A42583C59AA61B96D34EB5B3FE2B E7C2794CE8E8ED5006F8484E7AC1A2E5C261B6C853D330639E77514B62F4DE33 08E2E8D22597FC5C1FB9C69CA45892C884EBDC4FBA2B078CE2EB9784DFC4975A DCC9D03059AB21787919C40DB8E5E31C7BE647BE5BA1C9B40E910F31BE84DB42 273A0F9D8D3C96302027A3668E7D6DB12806534030AB362D65AC85B2388EDE96 A2F8521FDADB04F230D529043D173B12DA39BB5B92BB010DFCE4E1391EB2B8EB EFE065AF670BC4A54E89DE8C93B6FFAD8794B279DBF0CD053DAA4CC10DC1495B 4F0E87C3D2BEA2B60855749494820DEA4CEB2EE260895A9EBF23F90E57AA14E4 905EA820CBEEDF648E699DE9AC7E55DF8BAE70987D7B2B5780F20CF70632A013 0258F02F426E551847E84D8BAB6C89BA63A0E05DE4492E9C291F4D105202F9A8 C078150ADCDA36A2C3141CDC1063CDF2DA03ADC01D6277C25BBF3EE7146418C7 FD1539170DD884D3C1501F4F90132096152BA5C677EA2F4199828B752936CAB1 590F8378CAB5268C95CDC423FCE97ABEAB845BEF7E9BDDC4A34D165ED1C28F2F 7FC67AA6BCE0D7D2DB8391065A2525F4859A3A70936EF8B683E6545F58EBD57F 5FA9A36FFEB041B40C15EBDF5E52DB8AF746B0DCF9EFBAA55AB10F469637F6E5 1A0FB4B61AD4101E5B0D4103F64ADEE9AF0347214357A48328481128EEDC0516 BA2782B2F625F831DAFE097A3F129D86D8B10F0BE724CE6B47A3275F506515C4 FAB2F56A1A5356B73FDF00070FDF35C099152546844443B908D3CDB5CA38B553 C189A999131A03098A3A7DE03C33C2318EBF34AC3E2B9F24C463E06C97B09990 97306E15CB07D98D46CB527AA59C08649D58B331E242CA198D294898A0CA11F4 601091717908BF6E5D348F9C46B2A192F85412AFA48E7BEC6FFE5FC26FF04ABA 22D25ABB701091D9F0783A4D7E4F8B81BA3B9B3B6D6C76115E5B9C6CFD2D3FF8 68AEAF3F85EE1F0DC6C47472D34822B446E99C6EFD201BA2FDFFC360035070BB D02F83186089C022013314C996308E28A06945E527995477951318A14885A9AE 943077042782DA8DE2204803D6266404397672B174BFEFA13B7F9EE38EA9D273 5107CACC1F290C824CE4BFA5CDEC6D2CE1592563A8224E7B00D1AD1062F7E2C2 EBEA933539FFC1D13D0252BE816F9F8E84AF343FA24247F77FA981C45DFE4B41 BB4CC28DE10E5E595483775092C9545C977C830C112822656822D87452193A98 5F624566056B212252B5F5703FC474CD2079570290171A8F532DEF9B6073EDEB 97E9E8453DE1A03ED7686172C973C98AE1660607EDD72974ED10F4D6BFE11835 CE85F5954D4E6887D7F9B96F344D81BB84C1EB57A231E72DC36588B487D0E15C 6312AEEEEC8CBCBDEA8A5BB42558CD1A42BC724646EAB12687759524C7AE670B 964F28B44833FAE9658FDEA37AFF03F65C41E74C9E520ED69E801D789D6516FD E5852A041656463BA98F9438741586E623B5174B0BBDED07899A8B44CCCBE545 CBA890239332DA16F0D791A17450F3E82FF10572D0355F4A8348D5919A260480 CC3F19D41B017F01647A5B96EFEDBF5C9D2369128572CAED1074DD6E6E51BF0F 539532FB8964551D6E33CB7E571EAC7CE815EDC01AB2E160394E8010211E305E 3D50396AF840588EB640139333669B089A8A811C1630AAAF601FF5D7AA0B60BC 86AF3E3F02DD5279F6CE04280ED5ED1E527BF3523E8C039C9A92F072735BB01B 58F00872E235872DC6D2E1E1B9A94CAB46C7F286170A18097A89C42D1D0768CA 92F14B724B9B1F4D9777451AA9A6458E1A82A902210506B76317ECEA4F325850 EAD0BC56E52FEE44E02BA02584C79D5C13AEAC26A343146106DF3991B196B9AC A2436744312FDD5CAD6A202222B0B9285F6D66ADA25E938A459BEB3F882E3817 14DCC3C1BC1F383B6A1803AC89EB3199E916950299105DC129F81CDE833B6BFD 27C9FAAB3D643D638E6CA8B4235B42F23723C9B556A296A127830E40A5E4C9A0 AB12479156448217BA510141C931B38CD9B6117F9655E1248CFD4C01E7933037 37BC26A9EAB7AEFBFD9A119346D0AABFA660D180C09F82D4B9371993FA147F33 53EAD031820DD51E0876A957939F0DD180E3055A4DEBA97720DB669CC0341E7A 4506B65E00948FB2C6C92412C628BBB4B1A98DD172855A1B037856B86AFBD275 0839A37CA7921B46CBC307F6737D8B455F8370435F132FA14140C31D146B8C08 A2C4D0E37B2AD68B9B44EEE6822D7CABE62CC0C00E68F57654A9C167BCFDB691 7F855F95B8E822225BC5C67C991EF694A80E6A2185CB45503346C39089AEB47F ED00FA53AAA2A0A7B48B1B09A8613D747EF8B8DCCD586D5C8E926AA4CAFA171B 6A2EFE4FCFE57E43BC6D801CA4C5F905DB669AFF10B9C428B529D2A74149B711 84AF8436D214955A3A8943B5B4442A329B13E8D1D5DF865D3F8684A8DC848F5C 5627C56BF6AD984EDAF65E844B52E9A8E4C097AC4AF17F7C53555866DE72559C 153E9DEFAE45AA80391A8B6A14C89FAEC6DED7D9EEC07DCCE3D3BF78B481B26B 5519AF5CFDC99EB6D289CE16A5AF35C4C759A8FECDE53327A2279FA5D7464929 3F5EF28DE9D52B74DF8B1B7578A6461BA5DF818275AA8A2080E0FCA398EBB184 4BE33EEAC03B1CFB6ADE7F42D03B24C9BDBFED0D336ED92311AF57D568B52506 E937C8CE8774552D352CE350ACD4D1696DF770DC0A19F44DE46B47AD38AE8818 CE414B913CF229C13513100FA4444A9E220312FB209C9B3BEFF190FEEEE72302 CD9EB16F165792F1265034B2EC7A598D0EBE4F6FCAF4FE61BE90D1C276277DB1 26FD55C474C7D656CAF0D8320B2D26F70B90979B151EF4F384A58630DDC3FE3E 9F7A50ED9B204B6F32915AF595934B8C5C2A90F8FA7F091EB28544EB73FC80A3 C590299707DDFC9B0C3A561DE1960EE492AFA68996D2E821909E05B44F58D61C 628B3AA19CBBA5A09863F53CFAC1F4A237049FEBABC9FEAB10FA40316BE71928 E4B93F65697761C0241BA056E81868F9DEAC47EF81B58369FB3E985AD80DD2F4 BF954B5D7FAF7DC28926FF30CC17DFEEB418D7CEFCC6B9B9305B8182C8520162 5BF243D38399CE0E991CA6B37AE5B260318BC60AAA31AB83EACB94D450991CEF 3B80F638062341B141F3FC132CF15E420BE8E3CB70B163C0C81FD90C51993AB1 5A8FE524425E90C41F16888C6C74CD3BEB06A7433F0E9A55B784E6DF94C1A975 8B52CD014EE3A2F126A36F84EF7A13CE61A55B00F57F4B05B2E9645E7EBEDFAB 0694B1B1AC2AD48693A7C26189FB82E4CAEE978B61CAFF06DCE1C48E350869F7 C7D9D349BFF2F6F8F2C9727499058F04C2BE3D409736D685901BE757599FE26F 521F8C0A9F58D9608F36DDBD89CB0195A1CB1355A7BBAEB24955F498F21A3E20 C4EE0F6DA2F7FB1CE95F1293A109A3A408E01B0B6E2518A58677589F042189FC 5DCCF25177E6DF968041A955AB420DBDCBC62BC5FBED0EA024351872F0E105B1 03AAD9654738ED51F0B578535F5D09665179D43918F12357C924F1EF4AC32A05 D284C73263C56F0E830BF3204D12D7A0798417DDC4ED976196E0278D53D3BDF6 26BDA449B968E36469983564DBECFB8969296180AB5228781287A206DE3CF97C 62E0B89800B88615C85F930FD2DC2999A3CE666B5EA70A4817A862253A330564 DFEBE57F431717ABC9FACF723F936D9208638078365FC715F430866F34886309 5808AA6BE3A75526DE4D40FA3647ACB17D436B73D3E254D6611F6D0B923F097D 3552D862BC7471A4E0C7EFF7E7DF82144A70BA87B80FBCC075E8A3A1042ED091 37607467DA506FACEFE2BF77AF8CEAE52DB3FBDE09D71D457D3094B50FB95B19 A01F76E7C28A89B191D463E21718FD2D21C4A26A12DA3F3A49CF887863ED433A DBB75A15783497C063BC31CFE7DF5D10750E626BA729293604D246679E9F2827 947A6585B3A21A37F63EED3F40A3AC37E32AB72783094086284C5D6DFDF8EFD8 6AC963F8990C26BB2B1173AC92F2CE386D2259C4FED6E646A93681A1B44CD95F FA2CB44AF29110B9FF3BDA349B83396BB1BD7E1EB182A638C399E6DFFEF799D7 EEC4EACCA0FB2D88DFB6CDA5E76D3FA96532956A168CF938B008BCD6B0064DD7 397DD5BA2388B0F863614B7EBC302AE91D360C8C2765F48E1E8922CC219034BA 6DE5EBF99438FD7B8662E25CFF05A4EB8D0C975B44CD5AE4AB710FAAB8DC747E 84AAACBA1E93231C02DF57F3A97B7C5D653BC50D7B8B4AF75625AD677A93A7B0 88587F98DBEE1C86CD4F31CB9E4779C7BD602A4B16B186564E6BEBA57AA9F159 A352ACE0B2881269B264A2E58637787DFCBCFD114AD3953681708E01742BC93E 6A91A4ED906584D4B955CC49035CE79933D085539D6AA9618EBC52CF7190CDC1 2AF6F189421C228DF9598945C864E229AEF902D7FB1DEC19F52FD45787CA11D1 A9445644E1B968A671D506A5C2087B5A078E00C53DE9C82761EA93F6868BFD76 010BC61B2327BD70C43DFEEF0203CB7A24D348B1BAB64A781845089F3807480C 431D001802C9E318FD65EDAAE835654114A13BFA6616DDFFC9269775D7D8136C 03EA5A0371FAF13DC802600CA223187EA5A8989A9E976C0F6E77FA1DF6D25310 033EE638D7A0609A07883AAC16E0E23F7A0DB368A250F5C9D620072161C8CBAF 01DA5210C183CDCC005BB42CD57F78FBCD7F29FC4D840229F99663332BF4E131 FFB100E0C3722B9B35E51AEF5CC8639C576CFB95457A618422AF6D3952ACFD79 D62A8733C3B4ECF3E74387FEF09928D21166D80AF5496C334F5E6097C2A3A765 357CA8C775E5D64184B32DA7B6EC86A932DDDDFF1569F4281DC37954CA6CEC5F 5D8CF751EBCE396982501B98BF07F243514A77770F68064E14B59D59EDD68BB5 F5E1FEA9D25EF7214388942AFA60F877571D22764B35D547142D06DD1C0512CD ACD70FAFB1E7A37E4D3F7E2540A6E558AC65025FCF5F97C8E20DD720208581BD 4A067DC3B78B1EF07C2C45319A3E21D5A8273DB8FD06C76F6307B3AFEB1553AD E3C33421C1A2621E918562210ADE7F01B6446A968C5387C5AC762096FEB1B23A BF744E672EB61B92CFA67638707B3C5633DD93116FF191CCDC3C9E61D17556A7 0CAD86DB894A23CED5C75E63391CE822A5D6D27360FDFC92D5CC363F387515E8 3786DE958CE40D45EA1BF4019F5657BA9F0B14DBB03D71860E4F34787DA60421 F5456786C3220E68DF825802D90FF65BC26E2E15967EC51654D6311C7E6102A7 4355CADF2DAF4933FD2562E80365DB5AEA07A69E04D740C05431D77B5180D8BD FE78CA400E2EC06BF80B8A29D9F8C1F15834B981D2FD25A12A9A0270FD42CE97 655FCB4C7DA7BAB40E22E2E4361E9012AA4C46723D4A8C423BBC548E6C4DA445 F7FF67725269F8A8DBB801DC4F92F900A0084EFB3195ACB89D6CADFD89830B99 F74F9964E0D641A6DBA18D51B2D93B481B2B4D0DC139DCBBCB5A48A336DA1B34 29B4AD3FEDBE5EDB32AB3513D8493FCD265009C0FCE4FB06E0FE752DA75C4B22 04425C19FD03C04B41D3196294FE7B928DC9E89E496F20A21AEF5F8FF28A1341 3150BBC658D3C5FDE98486EFEFA6E538C31043C7A602ED42377D68320AD6D036 0647A09CB0FDA298D2F1BDE035FA66BCBC29E70F6138615AEC973EC027D9C1D6 D368F02E3923B78261DC39BA7C96BC35FBF9ADDD3177F07DFE625A54B2BA3574 99E841B4F86DCD8D15FD68CE18FF73C3BF32CA7C0F888C4D8C20971C03F1279C 44F1BB99D654ECC7F496D063D212A4CC7C5942EE199270519078F87BC702BB7F EA79A80093650B03402BE46DE83A9B6051FF90369FFBE67ED5A0A5047A4AB74B E6E24AD128A467A329A4730F8E430FD363135E11DE786A1B52A87D0F1D9DF162 C51B45E8EA0AF7372C219A469CD9835B4AD115C2EBA2ED5F25DEF8082E042A0E E8B2C0B7E5BCC670F4E237ACEDFF2120FA7BD968F0FCC6B0445D9924ACD3BAF6 15DAB6F71E08F7F4D472B264FD07FB2AA86CCCD8ED75E9E3CAC5E3D25DA18A0F 9467CDD554B613AA90C696E84201379B76231E7D2FA672960514ACDD73BACEBB 024924547EE41FA088C27F92D754AA613A1A952842E99C7419855F2A0601E04B 40F182D6A7D631A96C8D5961257434A8D53B3A820C545F0AC41AE37CC001B196 3850ADEB78DDE8721A981A4ADA7397D795215DF138724A7C03C5F43D42893DA2 EFB34837919376E4E8FBA0C5428A1D4F1FFFB6A9109D3D76B3046D85BA505AA1 129DC266847F8AD8AD1A0A76A889305679BD596667F466031F30C9DF9B41D383 F9C623E6C90CF542A6F89DA41B489E4E62875CD918A4EDB8ABC98B0A03A0DE2B CA27B2B35EE2EBB36230A513F2CEFB7CA3B5E93CDDC60B217AB3ACA5F21D84CF 00F06213EE7B137E4A7D76E66C1F98BBF36B7D26D680B0F203D9259CFFF71470 863B5FDBF4BC70ABA0D2F4CC12FA0DF9AF47C210C8CD0DACA57988AA0572B167 C983D7CFB0983482FBC453498D7C75B17387EF520C978B335F0B9480B8FA953C 0C05ED8D47E8272AC5F6A07EA35386825F563C4BDD78AFF0BABDD626B1942F62 5FB5B37AE6C2031B34A76CCDD57432176E491AE2F28E24CEFED075C649279B69 FF1A71D2C66E04C32409881561BB6083654ECFFF5A48F088E24CF69627FE86F4 85720DC91D8FEB483F76E9B253750690A47A7F4C75750ACDE767186ACC339191 A2D8B51751C143E576D10BF90AD8B30FED4BCA46DD2C89E318E2A05DBAFF7017 7233BAF55354D1659976860EBB2CB2E14FE335C58F758CCA0C4E665F336BEAC3 0ACC7740931F1194EB19E899B6332B2BF69DE9785E48CF03A9B249E9FBFDF088 9701C6FD61FFA23CA58B7BCE0D0F57B10F7A4C1722F1972D9600A03FC7EE30D9 8512AE0A9BE016E3F5BB0C59A1D64B5FAA649A36B26D1232E4C7566CAC1D0492 81AF64E5487782241D1AE6EC7E56C0FD3FBB9D299ACF467BD7A716A7A2ECEFF2 7FFCEFE5746B78C8EB0DEC4597407E1E13C76DEFF091829C429000D3080E737F 15DE03DBB180A4372F7F81A4C3CF0A5A7280DB987DDFE751DFBA58E3D8C4D952 DACD3347FF682A47EB41CB71DDEF6275D3905558B41261B3882CE04E6DD5D123 CA3616FCE7F2BBD2B56AA77F3E8147225F3D54D22FEF33A801EF05B820668FA9 16E92C0B2A501DADE37876B84161D1BDA55F6AAB8F9C2D3AC57BE45DCFF985A5 14FD60AA6D2D267ABED1758BD476E82EE3DE9BBF460DCC28575C6BC40900E006 D678CA744A21B9742C0174C44049AE25BD1450D4EA97FFD70E8249F91B43C38F F9646B0564BA455153344537BDAC1DD1172638994F1D24A23D99A72095CD1C26 9F7C6C63FD267895278DE903A205E1A51C3D6639DCFC4FCFCD9F48237FEFA9AD BB63BF0DF472749C2F42E3D672F4502DF93DD1DB276EA5411F5D32106C7E147A C071BB6E7331694F3156DC9AC417B0D2E4281799F463B588FFA255803241BE73 F43F189BDE711DED854254DE60E00B8A116DD70A0040D7642A694811BE826BF6 A1CDB842026A03DD8929D58AE336216495B362396A72FFCF18AE4B1610DA80EF B254715CE2071E13B50C9DCB3F22D44A71496D8AF7D26B7D7C526022060A7921 4D5EAFFF4476040EC0A9BB399E35063C879F8A28EE258457364C42B73D1EE7BC 24BE161F3A8168E9096DFCAC238DCD21C6C8790592C7C86B285EE9D0C1328EFC 8F783B8211CD196C6E2673EF85F70CE8271B59D4E6FDCB17D996592E9B76043A 62D87F5762C2058ACA71E62A0C0D258ABB8120947D613EA94C556B5F464FBC52 9F56B7BDCD293AC12EA145C4F073C77BBCC204251077716DBB03F726BD9A2AAD F8A3F9B8BBE848414AFD9BE1630DA3D6D8FB1F580C88F17C4B1EFF9502301013 F2B2931CC5CDEB8493C94D33284B69F0080B693F8BC57608246E4C12D26DA66E DEA606EE31605540C54CD2540F7AC2A7C4304CAC7ADBF3ADF4038AD3FB7336CB E979F2B171F74112F190D141996394DCBCAABBFDB0435A4617A15BF42BC6EE75 A85BD0ABA8F676C386A8F27967BD15D0ABFE09E4D0E6177654CD73B6A9548E71 5B55972D052660CD2658861DFDD4B674C847936180818FE732B25943B9361E0A E1C8932727909E01EC17F65795F0A998EC8DBB66E41C62763FE10AA63E28BC2F A75DECC47590BDC6298E8B33F535427156171FCC7DF636880AC953F75E9D3E91 D6680231AF5799FEB7FBDDAF45189427512F30837DFC88423CFE7F9D4D233ED8 8B6A156D282BD8ACE841F6C541194310BB125AA4CA59AD13D868C79A179C2CDF 8FD78DF9CB4E739A2B9D9BA53AB7BA5CD719B2B70BFDBD03A3C3DE2E10CF9266 A70F976C41171F7C0F1701497477F1D89B8A071F18E544B7E4FC7CCA28C36EF1 BC06A5F5E46B488B8588C3A88DE5DC32A230500A5C283CD2E7A43209E1F5C9E7 58C8D8BF9933EC32C9E04BBAE9256B33411624A4A9F0DED262037C2C33840964 119AF352C912CB33C2EB8A00CECE467EF6078A720C8C003B6B400BDD6ECC8E6E D1493F0FC1BD7CBBF0D15340AD17A419A4EC94948A2D23A7AEC849DA364FFB06 08B9A78C61920A1888D7434733481EAD01740991B428B1738DF01C58174A2E05 2441AB5DCBE9EE8C2E551A0C24740DC17A89BFE1E2EBD9590855CF440B5CD4BA D2D664D3008591A60394DD0F189CDEE9086252CDB8750BB490E0DFBB467156F2 EA9DE59CE9CEC9726023A1E6052B54B39E03FB6835E7D0E6458C034A0A47512A 9194D49E52E5E0DD07B1EBFF0A892283BDE8094FBA6A749CF086A79CD1E00004 E1170EF83356404FFB274AE8668A6DBBF8A81F5088BFE6CBABE4CC32334EBD0E 7B0062D237331E48DD677A55F50D7EBED728A15B7A86CC2CFBB1D1FD14D85086 E9A45F032C28721F1F7EE5FAD0A0874CB928B87E0E7B640E715F2747306B9797 AC16CD2FB470EAA44AF8675F240DE3CDFEBD0EC7B2A2C19D5E5921A3BE0588AA 828A9FF0E500752DFFAA162C55B9B7DD381BA4F4D74DA66846DF0763C22F0633 A073F38C69877E951E45EA8581C6676A1CD6A1A3CD099753DB8277E91A7F30F4 5253443B85209C9E532FBFB64D1BAE5BA02D6A58AAFB10778A39CEDE6F209598 8BCB27287ECB409C412E5E13433F10AF2177192B94D17EB0E80727EA07534536 1B6CC2BA665BE638098C7A1C4AEBE573648B2273DC92FEDDA1B73807C6AA4BB3 D053E7CC45DD7391E0FEFDB66A3379494254A7AF09F0872D0B357EF070C2B914 D5A1FA73948E4DD0E56E3C20E739107617C74F617DF459D39FBFA098B8D0B01F 666375E79C8B07F53D4AFA787860BE97D9EEBDA81A1CC0C86581F62AC368FAB0 B47A7324D318260F926CA93C52945F61196BC4FBB2B54E300B2D2D71C3FF801B 65B290FC47FBCBFA4BBF71EEEE246E3D56C58891638040FB45246A08054F2C22 797D12E4B4ACECA1AD64A15B62140B60CC2638B4E872645AFE3D039EA60DEC2C 3639F7F61A3A375544FCF40FE6363C6132204077168FDB1B888437DD6434B644 CE6485B82DA63B9EE5B71BD8258FD4D862F85539946FA0F293B3D4B28EECFB66 5C6734F10631EC3944306DCC64D851BDBE311F5C62C8558CEB2F03678EFAEE06 144AB251945DD01914405F1A5DBF6CDFD54C1149F61B5D0968D24EA75472D9FF 7B07823C08836F1BA2F0A9247F4718F9F86EF72458377D9D68A91C9EDF8C4046 C0ACF1A8FB6038B2E100AFA2038EB5151B8534CEA7060E48AB4CF311531DBFD9 3A129F6E339707D5AB4F00C1AAC7E354570E02159906F4C2BACFBD9AC9051CF2 CB798ACE0A32759A0CB8F95C125EF26915C250F940481A1909B1CAED0758179C 66C40C70BBFA1D7CE48980FDB1E999B6E6C631A619810D2BFFF0746975E2DE13 3588BC16261B231D18E82A2E8A78826C46337F798ABCBA67C7BC1A9A57C23E8D 272851EA16258FE16FDA8CCD86473ADF3E8DE587D77861A4895D8BEA006C0A87 6773B9BD6AE1E1510E5532D375830E3A59B29811DD25DE1831A9A82B2800E640 375AC8584759C65808E98EEF724064DF8AD7B6A531E2B8B4C7AE7E5AE572B724 5550ABF6990FC5FA4D78D7143717B3A4DF71078320B26C2D9D7493CD7B4B08D2 370D2C289F0CAF4D010280E99185315577860B942826684FD2A67900588D8C4B 7F7E39417141A6E8A03B85A30966FF9A3F2D3DA9D873517B009824D41646C875 6CEC7E0B123EE51718D9790AA45D0691B761F4F032AA0C20C1A9213DF5CAD9DF 3816C16C56469DF5D6D1B43E43E75FDAC1DBB1BD9B04B488B5E8AA5EF59CDB33 96B59D1033F3A744B5751DA877646A7DD42792629BEB7560DDF41C1158EE4BB7 DE41D848BC4C3DF5FBE5095DA6243AEDD57A20B935951B8A1F66CDED566B0DC5 8EC8C4B83583BB46A8E1BAD76D018C876364E3F86CEB22E1565D6AE4CC7C57E9 6A8C5197FA285E30300C5ED5DA94665752EF710FE9B45E1A5A1E7B18BF64E239 A181D79AAB5514FCE0D2E50A270A3347B9B7DEC3E65B62737F396593479150AD B6A57AB2DFDBAE875F2A3A7F1B85E00D5246DB11FA7A7406147C68A19B9F7B6C C30651D25B7E669F384485DA39A3CF10CA502CFE34E96B2E1A10F49BBD0CBBB7 7B5DBE9996DA980C740BBD672233A70E0D30CB63B13420D253755F7721CE258C 269D7C97B0F5A4F792551A5E05D1368F53D3040BC1BB3C3308BF686B78A389C1 E58D186DC3690994FE9B9BCA64F50073B51381DA4E93A5E077331E5335A16AD1 7F66606041E0613602B97699C9E4FE7ADF20F1AB4E493C167BC5F04E736D3687 DEDC0F91E48C0136DE82E3C8932300D6083B2D0C3E538D28F1FA0DED3C74AF0A 42205C39A9C2424B8AF0E163701D604DB66E419E37D08FD1A1887E6C6C69A124 EBADE130355110E81FD8C44FD4A0C19B9079C509B46198C8087CE0DFDBA9B107 C1CA6746AAE13E488A1C381669316A5294BCE44E7BC5C69D19BEBEEA3BDB7A60 53A29B82BBE92E7CC50A5F032DBB9E359B1BB96861AF7D27778267D38A53701F CFEE56BFBB2FDDBBF9F4D6FE85C6DDDCE28DD3EC0A8EE99B94CA85E3330DE19D 89B142F65DD2C02A3323EBC7F839CA3A35C720DBD41FB4925B70DABC41CF87E4 A69317E84D27A8AF02F8EE1B28EA7547C94AC5C5BF9A3268554219D1F05322DB BFA860464FAED7D63EA03F8DEC64E04C0E6D6D31BE69FCB489CAFA3B098212BD 041FBA9639D6D9514913ACAEACAA8A38EFEA0A719A105F62AEF569ABDFA1132E 03BB6C582772997FC343C866081D9C7E5A0BD5494001CCE63BFFED84CD31BB2A E9F301DC95AB6D9531D4B700128C27CC7363F9DFBF14DBDC003C4473AAD71D51 D6851820F2DFC377D51B198422F07B79148EA163C07FCCAFD5B428153D86EF42 1C5BD410FEF4945C366BA823EAF89D9F356371A3D56FD18AFCA1DBA7519A8A70 CA61C44E940BAB76AB20DFE2996B1C026BE3A000F2B30ED5C9F3837CFD616A74 F6A95A138C109A1439F786D9B17AE6DDBE5414C1DDCFE1DA2FE62F3A05FB98BC 164D22CC30424D24BA8D7B8FCC4DC73F2F37465687143E36AC22B51AD82A935A 7E217B24F8686E3051FDBBE477F1AE7634569CF66699FA52159F04FBBC61151B 23918E9515C532327C9875631B45FAEFA724080E5A84334DD22A7A4602FA32A5 286746AE2CB29A259373CABD67FA4253A22E586AAA9FBA072EE363A095FF1A63 B4BC9956B44167E784834D7B24E97B4A6C105A8268797ACB29EB90252BCECC61 D78B30B0D6539898968D00DC9E7097155ECDFD16E06041000A39D95CA12F034D EFF4ECB5B2CE0C99E4D9C89BBA1F860C05C5DD2AAE00C212A00689568C7D338A FA30F8868C4E0F068BE556BB9B26F19FEAE93FAEA55448B78912EDBEFCBA36FF C5ADCCB208D83DC1B5A21437B87F2FF52E5F803367C17AD0B103C031D02BAAFF 0F9FBFD9DD5ED865ECEA553FDE9A5DD19BC418870717D7636BCE2998C758AD70 065D38F857BDE7530AD951498BBEFE349B18B5F74606F893C9FAD338D96C95A8 62549B0BAAADA01C2EDBE14E5654FC5AC983347FAFB6131C525F7B91677EA33E 52BFAFB0EC245094B81D4528E89A6174E3FB222DF645E80711610C86276FE9AC 10FFE1C1CBFD93B52156B14B32BA3E6BF70AA6BC09C86A225ECDB56E1BAA8352 0073C33899827FA9C18D4D1D662613225724D609E1EC22CF87D163E637F4E331 471CB4DCCC1A74542021ED8DE8F8049C4DAFFAE98D0E005A9C13364A77AF8014 CF97F7D0E6C352045D41AC4D7DF231E505537D5B057F01130706D1F7CEB450F2 B2E7AAB293BE9D7FB745F880EE969BF0F987F014267F99904A246700AD4DAF1F B4EF8E1A1BC4B57CC7E8E855518B2BE7CA4D626313C5221052FEB59C285A593B A95AB0F5DE6712DFB8D1AF8F230985F254B89D039FC34D78DF0A32D0347D9461 D7108F720E40D308204040DC3568DB1D720BDD8B17D82D9D1AD485A8F857C2F5 7CE27D74A6A36DEB318BD5403A73EE04177F758D8F92A9BC64F0F61026E5914A 3106525D52F6143D9BAF012075A2B42231C07EAB587DA47107CD9E1E1E804DC3 DDA0C60C1C731A5E5868F60469ADB2D42423C62E38A8303223D47D56FC93201C 6B0017A8089F8F5A4233850E979000DF7814B4C21B004A8CBE3A56A17F581AFB 59C2070BB3AD0AC811B1A72BC36910BC774A05F479DA43AB92352A78548FBA7D 0F4E9968307E81AB6B8C281EE5BB1D94D945A68F940FD55404426DC4736D6837 87295D06CE40C33C34638379916B7C560167876F35FAF4EE82767D13271905D2 C421DD07EEA327D28C73AD11F17B3851E494F4F02ADC7DDF18475C19F068E78A F282C98C049945B11A3E1E6F21A41419D335F206F2FDC6D723138A94B0F387F8 932C06836E1C8DF698B91B8E4999A1121E5C6279FE28B09EAC0C1309BB176076 87D3EE243698FD51EDB9D652F32A0ECDAA76BD760A6F860BC83FA17A6056AD04 33C54183937BA9C52C6F4A5502B50D4F56B51C3AD17EF117BF8E4AB6B6110250 09C44A58E7B65CFAB643718DEDB779A68067ACA27C8939878C98CC5982DDDE83 077A89B4C3C2DDC1D0F49E793C3B8B841CE6B3AB3AAB7E69BB261F53E1224712 0D21E7D85AC54FDD1D62824196BFC389D6F65C4EDBEE01D0B9059F336754B6A7 29413F3ED17C06C77428649A9E747AD2A6D568D45B17A09E1EBA62D863C8248D 395FA85823C708107DECD5F7A661DCE5C910686ADCB6A196E3B4409EE8A74170 891C32FBA4678A4549CE0419A913D36DFFBF4B6817EE61934D27DF0348FD38BA B8F9DFE659B3943BEE84A5A1631E3E385CCD902F9695F7562D17E6EF19FAA554 E25B1B607C1E73FBD6A647070FD8CC4AFDFF0D14D4F8814AEDAA2DDA2AD38FF9 1682FDE6A69F5ED3E155911B8A48236212F08490F3484D894D2808497F1BF255 878C426BC9E7668FF93E08A242DBF0CE229BC5896BA4509757CF114BCDA29546 F7777C8F2B848B24F7A359FF3045E829A0E8B87263A915371ACD8C77FE905D58 BC503D05312A2DF245873738C36FEA0AF9951A0391A58F78D0E232505F8C121D 43D63FCF0C202550629187B24AD15396C037114C9C3819CBCCBCC5607AA1F7C5 1B6E04C319894B57D67DCECB01895BF455DC580DFF9CB28D4FE8D18E03AF3813 CB288068E1E6B20820A94950340E0DCEB5B698C4F0094E835C5A783A605A7D20 F32ECE5F04FDB2A1317680BDA7D6982538ADECBE9181829A6A19EF095414F2A9 5A90BB324B41A13C1B30FEA70DB496DBB41EAA47AA9D7F69FECA9920B4D2320C FAAD1628B3A61C194A6CD5917B5838E30C381C5AFDF093A2DBE7CD6C8068B49E 2D0E1076E804D9B15941BD30D0DA5DBCF359F67C6524DDFDFD00D969B42E5164 0D74C592D3D0FABF0D0B600499A1684D7E8674F6A485185EFC84D2D79FFEFB45 0B62D120698F61E47D1784433C6CD17DF9E42CE7A26C526DB1A06EE1F8BD734C CFEDAE05FD845757951CF1E778AE3F3130D413F66F9A99B08817A60664DA30EC E304CF5CF545E3FD75F823CDDCE127B2ECEF92EF178F15DD40C25B53BA149BF0 FB44CCC128C447BC61F5E1EDA0EC04B849D6AE4AC26E111E4D8E27C38D548E2B 092A63F26FB88DCED1468B6E4A57D9F6C92EDEED25C3F37CCB4B16E9C22D4F0A F3A18B40C032A3308DE7A2F18894D49C3AE8AE9DAC9E0779AB900732C1D1E161 39BDA2A9187EA021E12AD0941DEBA59726642E226FBAB33581FEB1D047F66EE5 6AF95F481ED25B2DB7E909C402BFF5311A3B40BCBAA8E8DDC858F7F82CCAFABD 06CA1DA02D199B520638B4CD5134AE4283C6603CA69F4353D9024F4FD108662E 8109D27A28483086FC7C38A65BC281B7178EF665974E1F014590DCEA3C98EA53 71EC1BC38C538B196E2C5D1963B1F33C19ABB286905F49C8B3A3D5A158E3AC42 2F843B85CC823AE7E042F528240E5A08FDD88026E1CAC08B9F3246DF67484973 D85422504300753E1E499242F571D3961FE3D87A7EA1F19E7702AB645960112D 1445563C0A52E36FEB3BC7FC64534002DF7FE48845A7E525BB164A93EFC51138 D2810123D80F5B03EEA808BF55B9487D843C5F37F57F915EDAE6F45BEC8FB5F7 B83C0EAD08961E8EEFB1724B96CA93C543D2242AAA5691FD2C074660B76C792B 6228A2B9F99E0A043AA04489ECA852DD2B8C726EFD4FFBF1E17317B7B3F20297 DD3A4768C1EAE917D7294C5795B70B8A868B89CCF5C0CB02EC3B3682F62DCD91 607BE53F9584A90DDB1321A7AF15D5D9E9C71FDF7D12E328A00F4AB65AA3E368 4A78A5ACB1BBD0488A0BA8832AD3DD6A5B1CFB3CCB68BA32E4258996FC06D7FC 0DEA895A36BCCC34F62118E58257700F245136F6B85E222D4C0CC7017A2F8BEE 84FF8EA745376052EAAE3F8556D23DB07DC96446D3CA7BF661CCDB0B35A194BD 48CCF7EF075CF48BF8F3932C3F01C1D3AC15CD2D23EF8D8EF5F5D375901A8C21 7312863751EEEB1873FD5F088AB4A85ED5CF85BFB578FB3E97236B1CD0340CD0 D45046EBF6542497BD2415E34F73980461B1CF1F477917F082BE464664381989 B53CD82E467489C58B700C4916F8DEBF94CCE35A4DF7DD2D829B66B4240BF982 EB6895D86C3AB45B4EF7A2F7DAA42FBB65234028CD42A59D2027571B17A7AF25 139F67EED7BADA707A6145C6D0FE8A275046863BEAFF74AC1909CEE6B2A6B140 881F9F6A286FE734D6C76F007697A3F877397613B9DB35A22B7DE00552AD8A69 A9FF225B46A2A26140C446901FB14E5ED132D5A0E154523F8A8DC089B79FFD9F 6F5454319926B53EF52A59DD4DC2E45FFAE05E3A60D101033E4497982C969EB0 B787D57C3489ED12174B4DF01D49F62BE351E7D41CB2388F57AA5C36BCFA3FD9 DA722A0FF5DAD24F700A8768DF5B03DC7502B22CDBB687C3C3BB3C70ECF17E9E 4719370AF1AE21F83AF146867640EFD646AB266B68B81EE367ABD5030FE9763C B38FDF4CD76729206A53AC5629057E5FA4237C0CF256F361D3A1D368D6E77702 357D8402D15501884EB55F0290D150530A0FF344EFF3A0002A949E31027A06A2 8558FBA081F132CD1DD8D42B0BA05304DB2E5CB0E01DF4DC2D3BB79891CA589A 549B657224F34317C19AC243635337721A52CD8DAC0EA88F1FFFB7B42DD9F715 81D17F3601B3DF0340F09918D2DC1A75CD22F4BC167C041C03FC14A5FD043E90 6224CD33410163585B825BA478DF82A8769DF179C1C621A1F2F2E2ECEE9676F4 1D9A9ECF00B6A4CAED27F6B8EAE7949E2D01C525F0A21AA4A248891CAFE0323D 1F65836CF4A40BC9871291BD19F174F8FA5B5B5047608CB4380888A769BE5334 033458EF4015811DB20A2EF916E07BC56F7CD38E0948C50CB864FD8FECC8A3C8 FA80640CED8334ED2767D6C908347D2BAF4225994B23C318EC224760A1F8D976 55EFDC2637813904AB3DF5ED1DCAB7D4728F205AB1CFDFF30EC80297B3B42D6E B92A32B31D7542239FC63B8A3F7833909ACB38D4BF390E829E9267EF00DC64E1 E51BD1707F968DD527A200C6CCED9A46B3F4324E4EAF1B07736604D8D27C4C88 91C55448A20543EF82537AB816E8B15EA218C5CE53307113F798022DCD9ED30D 318105E09C878AD8398DD11375F063D7162915F102643FBA5AA89D4DC8412147 95A8C73B208357B1C15C686F8D48721CBE088AE46142702D1BE69FC012765868 A88B219D4521B19EE2E00FCF590AAC9648773B8FE6CBDB1CCAFFCCB0537DED09 E3F897DF81AD8EFFD2A305B2C02B781F32E237EC3389A071D87A818ACB08BAB6 A5C64A5578D171FCCC1B27297D5F8F98768CD944FEF804AF68B8998C8704BE18 6FF6B6DAAEDD3F5AD72EC19C7077A5B1401E3C2CF55A2117615282BC1419A893 E94676145ED579455783E17B2319DB1655B67533B4A32803B256C14D57534A7A B07121415D3BC2DB09ECA4247A210F0B9AFF948E49ED425F80405D1EFB89D843 D195DE6E0CCDE7389AB354F0283EDE8A17DF98A43DCE0135E58751600866BAE3 191168B7441F6226CCCB8B4647E5F1140E3E0934F822FC847D878ACC364E2637 06D636B423581EF21AC9849500CBE96669DECAB75BAE7A41EB5628418CE3968A B986BEA3DB9CDC6F958A386C28DEDEF74F5743918190F96B4DB34D43906A3BEF EE5150F60024B98E2A8FB4932BE760F60430B95B5BEC79897C9C9F36BD927922 D95559C4AF570C0B1FA3AD7646B086CB292C35E19AF6671EC4357152208F4E18 70E82A349E945C5DAC0433C4C0E1997496CB961C122CB0F8C9B3CDDFBFF3DC1D 5FC92A62B150CF7AC7B79A45A57837DBB455C14A0D0560DE23E431FE55423AC3 6EF4CD62D96103A1A9402F81C27C73E39B836643FDF89130F582B051FDABEFA0 2886AAA4F54AA12B2222F36DC4D275EFA0A14F5B05FC3391708516E6BB05BECA A57262EBB0C52F1F409F8EACAD71CA41CFF5531446A085B32AFF86A8BED3F770 9ADDC3CAE6220493F1BC14006DA67FECFF912091D33BD78EFDE35F61DB809AEB 8B624A0AB3D29895867CB3271ACAB3C093E0D340FA4BA92B11862D79ECBAA7D2 B76A88E58BA70F28AF422E314E6FDBD13671BB355891D83FA905C502F626F470 7B807A7BE63FE07960E2B81BD7A6DF3658C7C525D757CE243A705BBB72775CDF B1CF29E251D2D731BE83CFBE56216114673149A2C21AB52DCCB8DAF68469C4D6 A4DC5CF7F40C7879696DA5E988BCD9DFBF416D157465F720F72DED99D3E72E52 A34F5B8B5D245091918D19DFBA49005F55C046AD9013B83A1ECCD4960159939A BD1EAAA1A50FC2E06931E9F2718CD9D720485D2D8E0ED48A81177FDFA9E9D71C 84318ABDCA62948C57D40E2F6873978995EAFD1D5BA616E0F4ED4F695CA3A4FA 68266AD3F6C480858A64D4ECC755275E472937FA41B590AE9850865E30E68C08 9FD60DFCF1948D23B401B50D7581225632F62AFED1DE7F297971DDE5ABA08875 75D7F0DC84900983E374E6214B7E8AB00AE9EA2C8E55DF1D4FA9C0844843643A C1223C8419297989CCE0B4419256A82A8F4647A900FB269B7865DE7A1D786B9D 76F12F1A2729912DF9250A58B26B66B162D2260F60E5A571C684444BF245AC86 3014C0FFF36B3D5B1FCD0224BB8418A8CD80CCB3B4592CE2FEC57556E2369BA0 D0127CF95CD99724ECB273C76C86516ADB433BBA193BACFCA66D8DE5F2467D92 192ADB00C303ACBA0B6A191DFD0F273D2BE679AA076D0A4EB7EEDAD613F5B8A0 6D8E4605DE82AF2265822FC38323C95BF47E121D76139F8EADB4828E38D9AEA1 83E398E813C29781E471FA7BBD1B84230825E7B7508D12B9C184E49E1F362519 55BE29A772DD379E952B2FBADC15B0BB23EE3114EA51BF2DCB6315740BF6D5F9 2813801E35113483E92FF9412A97DAB62AF440F9331E8CFBE8DF1868FC639133 04CA7765D00A2EB9678445CD81E0F15D49E5295E00548B77D68FC736974AE235 F48AA54D7E6D4AD822EAB69DBD7926DBC27B986351D08A58A806D7111B3314DA 7277C44EEF4ED612713884EBD03A33A66C0868F7559D4906C6D12AB02130B34B DCD64C7A648379199973E10D9B371D9E03AB26C9E537450AB11F5FB5EAB99216 98CCB9BEB86F20AAD73F3D5E63E18E3F46E72A735EFF5B0F6AAE06F311FAE72D 23BAA558C879E412A2E127A4344B369FF0125F64EF1F6F55DB1B4BBA22B3F316 E20E3EBA3EE9F587CF48FDD18E1A8DC5A93124FF067EC5563349509B5449CEEF E15973E775D5BCCBE3C93C3EC36AAE3D95D7D0696235DC5D732F6654D8B53A3D 1586C2AA605C2D8F75F75C57F9D3C7EB900AA1468FAB6A94C25924251C04EF12 9160964CA12F9E0A34D3E058CDE1FB9D0AF43E9F83F6B6DD0988D3F9143C0A4F 62CED5116EAD6609E78BBE70E7002988A8190F7D2BB3E730C6DFA9D17BE7A0D9 DBD35D212EC95F09DE64CA07DDF689BD65BC6EACCD8A0415DA9BA5509AC119DE 6A70B944FB296FE19868A652C290D91C3BBC8E86B537CF7D9A4DD3C348D75F6B 8F477E8A3E7588FE4C23375D44D2CB8CD8FAD87305F8AE8ACE65C7F6A24F74F4 BCECC22B70F9A927BA132B0CC385A63E4E48E103C89C2BC218DEC754C667B605 86D19DF67BCA17CA902FF4519F305F2FABE58482DFADD029CC1CC4E7DEDAB4E2 B256662CCB18F6DEB2085DD042E5FFD7E1A5E3F4A88C5595B33ECE86CFED79C6 FE5DF6CEFB57C02686A9BFF105F6E9679294118C6F8737491ED2E38DFEB6FC1F 8875A6744A8C94B04BD7E17D62E3234DA3FC532D4AA2BE058AC8F06142492D68 D5F1DC79CBF6C746C0399432EDBD7A038B1BCC357E035DB85AB377FFBC77AE66 90B0BED6B57C558D9E4180615623E04BFD0F0EC255EEACF1B3080BA6FA5320B3 96A2918B18D5D1299515CCCBD955154C9081126833A8B9449ABFFDAC4C6C36F6 11260DDA396666642A05584F66AFE276E111BBB9D26E6394FF2B935043DC3A0A 7B14C4C3C4D8C2F993B6FBBE40483E6A2371AE10FDBD4844B7A7C4AD47EBEC61 D934F9E6E1155922A731F78393E8FB26EF108726D947DF47B080C4055DE2ABDC AE2B577B84405B4F41EC147CB938E681E622E2BF35534C1AF0D1036FA5E94A13 CD3424F524DCAD42525CAF35B5D5B65E946EBFCF1EF9876678726EF8D80E8231 B8C6F33E3BE6EFE9CBD35ECFE79AB12B13203F44E2FCF0EB114CD8E83714A6D5 28F1BA841C313C64EF4A1A2DBC2DEEA7152422D3C7D36E73AF6182857340975E 7F2424323CAC694FC9743ADD37508F1578D3FE4DB653F373BE04B7DFBD2CEB57 584ED3DE76DEEDFDBE48BBEB35AAB7FCDDD45F62D81295D5068C0F9EC39CB941 E902D70D4F245D424F9418D75FC3DEAF5BBE5AECF8798B8CC6E29AA502888C70 7D3C81A2826F604AB6A04A7F71F48A9ACB0C4096F5AAF4AE379FBAD2159B1378 28F32336783B3849C1BF6BA6196ACE55B42FD8725E89EAB09191CE7FAF9FF4FA 72E076F109911E986494EC35D73F0F41AE198624D9A75F3C 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMR12 %!PS-AdobeFont-1.1: CMR12 1.0 %%CreationDate: 1991 Aug 20 16:38:05 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.0) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMR12) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle 0 def /isFixedPitch false def end readonly def /FontName /CMR12 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-34 -251 988 750}readonly def /UniqueID 5000794 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052A014267B7904EB3C0D3BD0B83D891 016CA6CA4B712ADEB258FAAB9A130EE605E61F77FC1B738ABC7C51CD46EF8171 9098D5FEE67660E69A7AB91B58F29A4D79E57022F783EB0FBBB6D4F4EC35014F D2DECBA99459A4C59DF0C6EBA150284454E707DC2100C15B76B4C19B84363758 469A6C558785B226332152109871A9883487DD7710949204DDCF837E6A8708B8 2BDBF16FBC7512FAA308A093FE5CF4E9D2405B169CD5365D6ECED5D768D66D6C 68618B8C482B341F8CA38E9BB9BAFCFAAD9C2F3FD033B62690986ED43D9C9361 3645B82392D5CAE11A7CB49D7E2E82DCD485CBA04C77322EB2E6A79D73DC194E 59C120A2DABB9BF72E2CF256DD6EB54EECBA588101ABD933B57CE8A3A0D16B28 51D7494F73096DF53BDC66BBF896B587DF9643317D5F610CD9088F9849126F23 DDE030F7B277DD99055C8B119CAE9C99158AC4E150CDFC2C66ED92EBB4CC092A AA078CE16247A1335AD332DAA950D20395A7384C33FF72EAA31A5B89766E635F 45C4C068AD7EE867398F0381B07CB94D29FF097D59FF9961D195A948E3D87C31 821E9295A56D21875B41988F7A16A1587050C3C71B4E4355BB37F255D6B237CE 96F25467F70FA19E0F85785FF49068949CCC79F2F8AE57D5F79BB9C5CF5EED5D 9857B9967D9B96CDCF73D5D65FF75AFABB66734018BAE264597220C89FD17379 26764A9302D078B4EB0E29178C878FD61007EEA2DDB119AE88C57ECFEF4B71E4 140A34951DDC3568A84CC92371A789021A103A1A347050FDA6ECF7903F67D213 1D0C7C474A9053866E9C88E65E6932BA87A73686EAB0019389F84D159809C498 1E7A30ED942EB211B00DBFF5BCC720F4E276C3339B31B6EABBB078430E6A09BB 377D3061A20B1EB98796B8607EECBC699445EAA866C38E03ED7D4F3EDBCA1926 2AF6A41F67AFCFBF3630C943FA111E4CCD988A7363F7C2B75EAF5830B049460E 0D2B337988F150B9182E989E7750C51BA83DF37685483F86D1F47478883F3F6A 4B7F768DA5AA89E8F163029ADD4A9209DE8A4F285766C06EA859639B92CCCDCA F59B1C2BB8D588CA754D1257BFF76B53984DF4937093AAEF79009D32A29A4C16 FB610C7D6713482C48D7F9E8410C0F00AD6E67021056B6035534E79F05D14EF2 4E863E678C5A1ED2D8C3D6DCF64B09D231534803695892C875B0A2B3D028528F 0A57ADF46FDAD29C74FB8875F3AFDD48166FFA72D98BC8469B868BD982C9C0E5 3F8DB3113CB2CAF158BB34596CBE9317C4666D34E73B049F1F6EBF942BF6B39B 0EA7E005318B9D3FF412EC9C3CA2CAF1818FA170F3AE2F9BD8FE9659B1E6B157 F8C703FEB85CDF2BA61DC253242B7FEBF92EF7C5CAE12F64CE72A850ABDED07E 3221DA7B86DABBF02D41FE1FB30B57FFE4079930181180D06B9644797A7E88A5 3ABC63FDB7FF6FFD91B2B47935D7286930E963823E2207DFB548B57C05B649E4 336326013545CFF9D923FACAB660DADDBC85D753F649E1B8CEBE765CADD06010 D1EE914E95A38AF12863D6E8A9EA99CC46AE45D6E47C782D45650745451E428F 3C5011B1F6CF4E6CED048413D70DA051D4191764939FA2E6436963848BA29150 17A9EB9887B7B63550E9C81C22EF5DF0A88CFA8A2C50FF7D4D6188F91B621BB6 671BE7F606B7065EF0C790E16B756C36D652A90720B31170382F73CD0D730303 7B49E5EFCC6CB0537E912C32073E20A942F60B182C3248DEAF36BDA0D21F4813 3E822821B05CFF7C5A42B3890C4853F172D0F61FCA825BCDB74B4A01180B04F6 9EC615279B48924C7CA80E99F75D70F4CBC89793CD0AD68FFBF6019A1CFA2FF8 6007A5D2BF174F13F0F8C021FD1F571725E265309CC0F2BBD3D75F11D29DB092 B67CAF158E671F16CB64F441C906605D09B1C9546495446F3F0D70EFCF84BC82 AA4BD4F446EB0180BF24FA69E2CF788B12D21E35AEEA87B11536DC43FEAC5726 58847D74F3B0453DAA95082097533EB177A84BC438E6226666A1CF8521DFD168 16F07AAAB4861D39509C9749AA657A82A2B4D00DE38598B7CE5FCBA7D2EFD2BD C46DA44A4D1B1C4E1FD5CD4E17B1A776351EF6AC6DEC1B8C6A55E9E5FEE18ECC E427FC0CAEDA9CCDCD4EF78105A79A593E395B3A60F5B729BEBBC4BA5BB69DDB 85FAB1BE068E95663CA2D891167A899E1C59A1EC6AB98D0B38ED068E621FD8FD FC29E1AAAE5AB739BFD4B0C63F258BFF1D5AE25F78E8043B2263C73973C3944F E4848D2969A434CF8DBFC4F91B87F9C4E51B53F0ACC8B947312998EF18DC2056 AF8A12149449C52E17EFC5C859E1873138D80654D468799BE1C15045FE21406A 034FEF971CAAF0EC46409816BD6D0A785BDFF4F2AFE6FE872241429D4D617AFB 1BCF6FFD0783F65AEA48F60E4A442754ACDABA8173D2661B194DFEB7BB5F158B 73B1E90F519FAB516406325B965A188487E091781FC6D6B13162CF5D9E48BEA9 30A5EB4406F93029D0CA9474BE32D648839D76C77BC5ABB6CA65E9BD84AB8105 ACC2FF152F6FEE1690A3C63B6D61F83BD692A0587B443EB02EFABF6F7F84B87B 0A6ED409EE8F79FC1B63098CBB0F7F4791AB2E3668247B2489890D1E94803EFF 591E7A5BBD1CD5BF290FF8D6AB03E7ACF69B3D154D01F5A0AF85FFC31A491264 EA29CCAB7F3FB355D1E3270684628C6F9F6532E8F2EAFFC41EE3C6CA66C68452 2E0DC35D497EBE524256D6503EFDB58C28238C4E59172B7062BAFB16CE917F07 3DFE43A9C7BF4DDA22A47169EFE1635AB47EEF3ACB9ABFC176BFC14BA9C6AE04 7F26056916D41EBD8C922BB200206857A6BB7483CFC52F51391C242E76CF3050 2C3BE51216BBD67527A743BAF67483D6A0C0BE05AFCFF37991529AF16934B314 01BC01F4367070961185BBBC3486681B3DBFC51ACD7EC2BF22C20D25227EA3D7 11A5E837A10FE606A056BBF5B824A0BD55AAB07DF2BB18E994025FA56FE63FF5 11FE912FB2A96FDF88A8A01C2647439F0FBA8CA06FB03A7D16BDD0241E39D542 7349882981C3A2EC4C500DA682398E1E5BED05735E30368C9D7AC12ECBD9CBD7 5DB3DF73747007DBDE3DC0C5C2D7861D8A784EF6027BBE5CD62FCC10CAC6F66F 6C760F25B216993F609F09CBCE7FF476CEDEB1B84619E209F59AA089E1312340 2903E675222BFBED3DA3BF4024F9817981ECA2A3E3EE5E99F192CDAFAFA264F7 1335335E44E1BB89A7251F5B37FEF9D4617FC9FAC06375B4E865BE93D8B40C61 3781AD1668469542DEC09A3DBA2170790DD683841DA858CE0E51C2BE6E91AA26 0C171F673ABC0528B55B3BF01FE92AE6A0E9EC66B38666A749518B073FAFD355 9DE262AD2D1FADC9098B2B16EEA973C3D7174B6A8262658DC80D7C55B80099D6 AA891607B238C11F50F7F5356BC6B96171661A2DF9A72D46714BFA1FF7A47CCF A435BD08829522A9AF54958F42D2CBA7B7C0772B24703EAF7C3B23CC00F66B7D DE77170BC9031BD144472832CD7CE8510CB783D618924E84BB02E9816415FC06 3BFD099511A94362CF7352906367B66E0DB106671B2668CF70BFC3CD99004162 49E30A003F9A18F852DD8419B7B963B1DDF6CA79C917F500D6A709EF832841DB A1930A7BBD7DEC3A3E266D396DEC0B36E13F7FB83383A50A88109061A749C080 C9FCCB22886170A8E35BEBA3A9D8899EDC903770006C5F956C47B09EF59D9AE8 7F7D3683D521023363D1CEC3F21ECC0256DCD00234A7986DC0F11C0E90C07AAD B0E831074282115B08FD9846365025F50D0290424DADD81A530C92D60198B6A3 73F51DB742AE4C20CCF36ABE7A6A3B51785D26729B85D839AEC8C7DCC0EBDC61 E002F438481514E44AEB611A3EC6CA3089689E8068675858B82CC6518FABCF1F D29AAF51415B85860D442318B73707EEB73BF959E5055EFC8B2FD2C61D2FF71F 9D60D14EFC3FA9B91E358DB7FD1AB81D9F3A3EB4000DC393FF449A146CC9B9C5 E9CC3B4504FD1A295BBDCD4E6F0E6DB31888D17BA5082013E34AE2E9F5E8011B 996570C901D4CAC0BD53B10DC1DF8A5CA86C6584193CC8FF474ED53D05AC4E5B 375A2A4267656A5F8754679A2D2E6CD516FFC61B42B5F43E2098EEA68864AF29 A2BDB74F77486B81732A3BC6D7653FCE5EEA0A257C802D3715DB1017955CEC8B 40FCAAA9EF8190A7F510D6C9804ABE40D0A1A6AF2426C07C0DFAA40255BE4421 520DDE0DDE283046F8B8ED90AE8275C338E90E2C31D0AB37305382A83C69337F 5D8326815476683DC6961F09729A0F1A5D11848F514E0328EE5EC8A32E3E2059 6DDEE75392780B566877D5E69EFCF676A23F9E1B0AEC9CCE470FFB5779CDBE70 BC2A45DD887C9D3D536B1FFB38E3F2784A97474CBEB482B1B4F60C137ED63C5B 49AC5F92C306F7F448EC923692FCE3A81EE5418B0B7C2E30A964B2384B8A41C5 A438C3EE7A3953DB16BDB2B7E96CB9B9FFD882C0549102E80341AA80BD0A1A33 567713B92B45FAA2F0053D4BABD845F400E78F541FEDEC0DEE2E16C4CFC92E97 47F385A118C2F292EDA769BD6D573C5075A457883BB0247A0F274996A3320BF2 C7928E923E907994EBDD3659F9D38E7972D49B20CE9E4A148BB1F494B7EBC503 7E042F0930629A555165D8E1E3223FAC70D9510FB8CC5A153DE43EF70FA94BB2 1565B0DF0EF5DC258E28E38B8101DCB53DAE1C99A89E4C0302A83E2D00BEFACB 17486191E97634098BB65095AC6FB3076D171EB64A3894AE2AABD0B5A66D856E 49A756609186110588A77A5D381EC9BD6E8013C2D885F099BD2A16B93BB0AF7F 062D7038925A0B7138137F59340988BF9725A01DEC6F05249250B2D0F6ED42F9 0AEA740ED72B3B41D9572317C95E7891ACD41A4E07F0E43C5F14DC4242E5A83B 781F81A3A70483D93ABA7BC3A349C2AF36780127BF937B14B1B9C5C764153059 66366271B76A47650E7418C103526C0EDF9EC8B1791C4F963CCCCBEAC824077F 0F953906F2FAE7136168EA01EE63FDDC7C527CF0B2E05B512DDE2647AE1DE690 C4068DC5C5A095BE6F4E15BC57D8E0E5B44F2C832AE456E58C47C876A82F54EC 9DB7E80C9BD6A149705AFE928F07F75812A37D5FC18B78034FBB3AE31E7B190B 0C7EFC7CC42B1B8FA849FDDC244C02E5788541AAE83769ACE0C1F7C2838C3589 235C2F0F723B0E0162EF2F8A31D845EFAB47EB37FADE970C34A984DC0C994C0C DFBDCACECF2F8C72FFBBCD82DDF9CB5CDD87DE68B5A1CE8C14304CB513B837DC 2FFE70421A4734B66F452EAA88E6304076FA76CD799833375BA311A3625EC2B5 1E5225E8A1B8BB3F6101A8E9B9A571512878F582E28C481D9508E93C8BF8DB0D B0A3426BD12B301C1DFF1B5625429E0E6144B3031E2B4A3C0A884C115C0F6453 D94BA5AA16256E02B3ECFCF17B441694E784A7F0BC05B46BB54F6E036BF759F7 BD9C6E5984926D5F52C1F184D7089B00A9F3C12DFEFE905A8422F8D783465286 C972B219487C02774BA7B1C657C20330F43F8543FAB1499C8233BE728113EF5D 60F1A95E7CEEF3433BCAC027AD06307D826DB15D8DB44F8460F2C885DDCCE6B3 EC91AD8A28E883EC02235F237D7F527D9DD60FDE9EB63E8B08D38AFD24C519E6 7DB340EBC3A88638BC99007C8D7B2BB1ED95F13657533D12ECA4D6DC4F2ED5D8 2E92EE73211C2CC643596A5C983BE102F261BB85557B551E019ACA31D273069C CB379E18107176701CDEED435361CEA13DF3E1D2A8BA95DC2598E3B4AE1E6276 14E6171EC770E25202E7B796EFA657EDD72DFE4F9B497CCDF31F1125E25B5DE7 CA8C16438E2B30DD646E616C5E2EC8063265884E59255C6D0729E80BE0F683A7 08CE890BDAA4A22435AC3FB0BAD21BFA2DCA7FE9B211E805BB4F5A9CACE20D38 58E00762690091AE0C020E516D34EC8D12CB4B40FF34263AD1D05844CA3B6E4E AD6A560F8E21F0F2ABCA7C3B9133DEAD67B3789118E187652DBE04B193C97F48 C01C8F367A587B2B09671420869820513DDB86C8525944270F9F092B4EB9E602 5AE4B8F9D647AB48FD4732E9DE797DE99EB6188A23DBCDC4E3B0C5F1437BAD83 E838550A49BF5BFE3B237C876C7C46B7F9B8302C28BC54C41F9F6F308FF2AEA2 682AD86904B826EF59BBDC94B44866C745ED233FD936C0466388F7FCBB4A1D96 6163EE1AB80FA4C4F306C49933B59D13FB643DFA2FC4538B454C182479D55649 DF8655A739696CDDF3623A81304CEDE9078CA006B1AB4DB4295C43B28D793EFE 1C8744BB71AD96126F9BD9F0DA1579DF2AFAFDDBAE113C544D94CE9AF3F4D811 D195B067E8B72D8523CA3ABFC878888C91EC2A5D5F3F2824DA4E06D5DC5602A5 4B3F4939A40865A8094A81ABBE1D6C212E190FC944CD256AE7DF35BF3B32FA44 E5601A780F71679DA27FBDD29839E10087DBAD4290FC2EEE0A8851701D7C314B 8084FF025AB4627D56C675EC380DA3AEA0996921C38764EBE85E225C8CAF2818 D135C55EA364D41158894289FC942F9F7BD8432DE3A97A57EF11144D677C55E9 68E5C580BA9A52DF3C5769AD8CD0298F8D1001DD20B3B79E33ED898291376248 0F9EDC5400A48BF29B69539966EEDFFBC1D9B756EBFF1AFB3BEC85E09BC30970 4B05B102B660F1ABD1CB5F6DBC41DA6FF5302AA38AA53C197DDBFE4429D14FDA 42624831BE68F3436D5CDDE2033DD265EF8F8EA1166CB5E8851F31B92C5EB726 777CC884D2613BB3ACE0ADBA416571F30B57AA900C50399E78A7910539E5EBA5 902B38ABC327993163084C9D30450A88147FD3E1DC5576186EC83741C6D97009 CD0989E6E5F9508C1677CED9D1F4A2CB7E4F3B03F5A76925BC40E95BF6CF2809 8A924D0ADAE7FB4A86269C5A30FC974472D8670B5DF6D9D33E90F8F650EF3FB2 BE0C24AB055CB3750925CCD58FE729F178ECBE1CEC9F290C0838486CA095E416 7995FDE28A7A0872311FA78D91CEE90DFA136F3027774CABD2F6D0736FA16758 92BCA6C5104C66FBC74B0BE62C8486E1281816D2199889B0106E575C209FF5C6 EBD0F63DAC3405AD6A6611F47F67D6CC6D786BD0EDEBE1273A587D4C8A996DA2 2C31476070C717133DF8290BC26C71F8B9F6D109E3EE48027EE6F8A5C578C8F3 CD0E81FEAF731ED27F5CFCD9ACD724CA457E34CD949D9E2105731CBCFABD36D3 0E5BF274A880C11C96AB6D86D37F6CC6263CC22387877C2DEF198E85DFCEC858 B0467B0DC79244EE43FAA1CF572DDCEC997C08B72DA45F4DAD470CC000958D1C BDA5B6D2028143A90510E6DBD3A3C220FE58A1162AEBD71B56FC4A1DFE03A79E FB0B30AB0C1F4C75151D2C8DE5A5FE9ADCF0DE954F2F2329C2CEB4E6B4A9E471 5F68FFF2740D66D76E789C73FA508C9D72A017004611090ABBB82ECF251B0C98 774E1B7065C2DAED36E477F7FD39170CB2BDEC3B28F7CCD92DA3FE652B649111 C01A2C3A3E54E91B6698DB07D363A3DF7F5912B71223B0243C597BAD28716C19 B6AD4148EC13B0471E67938D17DDDB2E0D6369DD8442743B2967CE9770279578 AF797C385D4C75D7B97B10C62E078FA93F5709702CFCED287D3F2172E7B1969B 143EAB14CB5578B9F8BDEB9581B306B6CB37F9AFD6A211D86B9546594A932AD8 B3C6F5A71068AFE43881BD4D864B5AA95A6FC73365A31C88A21E0C921A4D2644 B8C009045FE28EC8EC640F2460D24F49AF717AF6BFE85CB8C3E051F80BD06A2E 26B0B6328B7FBA2EBE90CB823D3F215C5F92C7084D708C2FD83D8A7D547A1C6D 57711A5BA9F821E2EFF2A8A79ED130CC6E09FE27DF66F8F6218E4A2FAEDCB996 54FD86AFB0AE94E00FDC3612747D5576E266FB052DAA6DB85B7A6E2EE3480440 B04E6ED6F0251D3FE3DD5DE27F5CD8303BE1FCE88F08853D16C937F336F43ACA F79892199B27D230174F761B87BB9FEC1722C79054D3D7CE67DEFA103FA1FC3F F4611F6BF1D167DCCF4508B559BBED6BD400B3AE8F566BDABC42457C32348877 750E3383D72A40C5C24EF71BEB2C9F57C0F2CB1BF3AF6D233C133D36D963D0C0 16F9835F2A3A2B27A51642AB00EC9E8A7CFEB78DC5CECFAB903F229E125D71F4 A9BEE91353705C6FE4203132ED2774D0AE4B4A495450130B59D8C88473FC4ABE 6D31F43F397ACDA1EA9FFC4CA57B5DADF7AD702922EEE77CB631ED98AEC82BA5 62FBED0EF96B6C6DFCEC81E476DE36990CB9F5 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont TeXDict begin 39158280 55380996 1000 600 600 (loki_doc.dvi) @start /Fa 135[51 1[51 51 51 51 51 51 51 51 51 1[51 51 1[51 1[51 51 51 51 51 1[51 50[51 46[{ TeX09fbbfacEncoding ReEncodeFont } 20 99.6264 /CMTT12 rf /Fb 140[83 26[120 88[{}2 83.022 /CMEX10 rf /Fc 139[30 39 2[42 1[50 73 3[29 21[51 4[67 15[65 42 65 23 23 29[36 5[50 22[{ TeXaae443f0Encoding ReEncodeFont }15 83.022 /CMMI10 rf /Fd 240[42 12[65 1[65{ TeXbbad153fEncoding ReEncodeFont }3 83.022 /CMSY10 rf /Fe 132[48 1[50 50 1[50 53 37 38 39 50 53 48 53 80 27 50 1[27 53 48 29 44 53 42 53 46 13[53 72 2[72 75 91 57 2[36 2[60 63 73 1[68 72 7[48 1[48 1[48 48 48 48 48 1[48 27 1[27 2[37 37 27[53 56 9[80 1[{ TeXf7b6d320Encoding ReEncodeFont }51 83.022 /CMBX10 rf /Ff 141[31 3[41 59 3[23 2[32 1[35 100[{ TeXaae443f0Encoding ReEncodeFont }6 58.1154 /CMMI7 rf /Fg 198[33 33 33 1[33 33 33 33 33 49[{ TeXf7b6d320Encoding ReEncodeFont }8 58.1154 /CMR7 rf /Fh 134[59 59 1[59 62 44 44 46 59 62 56 62 93 31 59 1[31 62 56 34 51 62 50 62 54 7[85 85 116 85 86 78 62 84 84 77 84 88 106 67 88 1[42 88 88 70 74 86 81 80 85 6[31 56 56 56 56 56 56 56 56 56 56 1[31 37 32[62 65 11[{ TeXf7b6d320Encoding ReEncodeFont }62 99.6264 /CMBX12 rf /Fi 141[62 1[62 62 2[62 62 1[62 3[62 101[{ TeX09fbbfacEncoding ReEncodeFont }7 119.552 /CMTT12 rf /Fj 134[40 1[55 38 45 28 34 35 1[42 42 47 68 21 38 1[25 42 38 25 38 42 38 38 42 20[52 9[58 19[25 1[25 32[51 11[{ TeX74afc74cEncoding ReEncodeFont }27 83.022 /CMTI10 rf /Fk 129[44 3[44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 1[44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 1[44 44 44 44 44 44 44 44 44 44 1[44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 1[44 44 44 44 34[{ TeX09fbbfacEncoding ReEncodeFont }86 83.022 /CMTT10 rf /Fl 132[42 37 44 44 60 44 46 32 33 33 44 46 42 46 69 23 44 25 23 46 42 25 37 46 37 46 42 23 1[42 23 1[23 1[62 62 85 62 62 60 46 61 65 57 65 62 76 52 65 43 30 62 65 54 57 63 60 59 62 1[39 39 65 23 23 23 42 42 42 42 42 42 42 42 42 42 42 23 28 23 65 42 32 32 23 1[69 1[69 42 23 13[42 3[69 69 46 46 48 2[60 6[69 1[{ TeXf7b6d320Encoding ReEncodeFont }93 83.022 /CMR10 rf /Fm 141[38 1[54 3[27 2[27 39[73 13[49 49 1[49 48[{ TeXf7b6d320Encoding ReEncodeFont }8 99.6264 /CMR12 rf /Fn 134[62 2[62 65 46 46 46 1[65 59 65 98 33 62 36 33 65 59 36 52 65 52 65 59 14[86 4[107 9[85 1[88 65[{ TeXf7b6d320Encoding ReEncodeFont }26 119.552 /CMR12 rf /Fo 134[71 1[97 71 75 52 53 55 1[75 67 75 112 37 71 1[37 75 67 41 61 75 60 1[65 11[103 1[75 100 1[92 101 1[128 81 2[50 4[103 97 1[102 6[37 67 67 67 67 67 67 67 67 67 2[37 33[75 12[{ TeXf7b6d320Encoding ReEncodeFont }44 119.552 /CMBX12 rf end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%PaperSize: A4 end %%EndSetup %%Page: 1 1 TeXDict begin 1 0 bop 1583 231 a Fo(Loki)46 b(2.4.6)183 471 y Fn(A)39 b(pac)m(k)-7 b(age)38 b(for)g(m)m(ultip)s(oin)m(t)d(link) -7 b(age)38 b(analysis)f(on)h(large)g(p)s(edigrees)g(using)751 620 y(Rev)m(ersible)f(jump)i(Mark)m(o)m(v)e(c)m(hain)h(Mon)m(te)g (Carlo)1649 886 y Fm(April)33 b(2003)140 3686 y Fl(Simon)28 b(C)f(Heath)140 3786 y(Cen)n(tre)g(National)g(de)h(G)n(\023)-39 b(enot)n(ypage)140 3885 y(2)27 b(rue)g(Gaston)g(Cr)n(\023)-39 b(emieux)140 3985 y(CP)27 b(5721,)f(91057)f(Evry)h(Cedex)i(F)-7 b(rance)140 4145 y(email:)37 b Fk(heath@cng.fr)p eop end %%Page: 2 2 TeXDict begin 2 1 bop 140 231 a Fo(1)135 b(Ov)l(erview)140 463 y Fl(The)29 b(programs)e(describ)r(ed)i(here)g(are)f(an)h(implemen) n(tation)g(of)g(the)h(metho)r(ds)f(describ)r(ed)g(in)g(Heath)h (\(1997\))140 563 y(for)f(Mark)n(o)n(v)f(c)n(hain)h(Mon)n(te)g(Carlo)f (\(MCMC\))j(segregation)c(and)j(link)-5 b(age)29 b(analysis)f(of)i (quan)n(titativ)n(e)f(traits)132 662 y(using)19 b(oligogenic)e(mo)r (dels.)34 b(The)19 b(programs)d(are)i(in)n(tended)i(for)e(p)r (erforming)g(m)n(ultip)r(oin)n(t)i(link)-5 b(age)18 b(analyses)f(on)134 762 y(large,)22 b(p)r(ossibly)e(complex,)j(p)r(edigrees.)33 b(In)22 b(con)n(trast)e(to)h(`normal')f(link)-5 b(age)21 b(pac)n(k)-5 b(ages,)21 b(the)h(exact)e(p)r(enetrance)137 862 y(mo)r(del)k(and)g(ev)n(en)f(the)i(n)n(um)n(b)r(er)e(of)h(QTL)g (a\013ecting)g(the)g(trait)g(do)f(not)h(ha)n(v)n(e)f(to)h(b)r(e)h(sp)r (eci\014ed)f Fj(a)j(priori)p Fl(.)37 b(Join)n(t)136 961 y(estimation)23 b(of)g(QTL)g(n)n(um)n(b)r(er,)h(p)r(osition,)g(and)f (e\013ects)h(is)f(p)r(ossible,)h(a)n(v)n(oiding)e(the)h(problems)g (that)g(can)g(arise)140 1061 y(from)30 b(mis{sp)r(eci\014cation)g(of)g (these)g(parameters.)44 b(It)31 b(should)f(b)r(e)h(noted)f(that)h (although)f(the)h(aims)f(are)f(the)136 1160 y(same)22 b(as)g(with)h(traditional)f(link)-5 b(age)22 b(pac)n(k)-5 b(ages,)22 b(the)h(op)r(eration)e(of)i(the)g(programs)d(and)j(\(more)f (imp)r(ortan)n(tly\))140 1260 y(in)n(terpretation)27 b(of)i(the)g(output)g(are)e(v)n(ery)h(di\013eren)n(t.)39 b(This)29 b(program)d(do)r(es)i Fj(not)36 b Fl(pro)r(duce)28 b(LOD)h(scores)e(-)h(if)139 1360 y(y)n(ou)d(only)h(w)n(an)n(t)f(LOD)h (scores)f(then)h(y)n(ou)g(should)g(lo)r(ok)f(elsewhere.)36 b(One)25 b(reason)g(for)g(this)i(is)f(that)g(the)h(LOD)140 1459 y(score)k(approac)n(h)f(is)i(less)f(\015exible)h(than)h(the)f(one) g(used)g(here,)g(particularly)f(when)h(mo)r(dels)g(with)h(m)n(ultiple) 140 1559 y(trait)c(lo)r(ci)g(are)f(considered.)41 b(The)29 b(other)g(reason)f(is)h(that)g(LOD)g(scores)f(are)g(computationally)h (costly)f(\(and)140 1659 y(tric)n(ky\))i(to)h(reliably)e(estimate)i (using)f(MCMC.)h(The)g(approac)n(h)d(used)j(here)f(is)h(to)f(estimate)h (the)g(p)r(osterior)140 1758 y(probabilit)n(y)e(for)h(an)n(y)f(giv)n (en)h(c)n(hromosome)e(region)h(of)h(at)g(least)g(1)f(trait)h(lo)r(cus)g (b)r(eing)g(in)h(that)f(region)f(\(and)140 1858 y(p)r(ossibly)e(o)n(v)n (er)f(a)h(giv)n(en)g(size)g(threshold\).)140 2007 y(It)i(is)g(also)f(p) r(ossible)h(to)g(p)r(erform)f(a\013ected)h(only)g(IBD)g(sharing)f (analyses.)40 b(Although)29 b(the)g(same)g(programs)140 2107 y(are)f(used)h(as)g(for)f(the)i(parametric)e(analyses,)g(the)h(w)n (a)n(y)f(the)i(output)f(is)g(in)n(terpreted)g(is)g(quite)h(di\013eren)n (t.)41 b(In)139 2206 y(addition,)27 b(it)f(is)h(also)e(p)r(ossible)h (for)g(Loki)g(to)g(estimate)g(pairwise)g(realized)f(kinship)i(co)r (e\016cien)n(ts,)f(that)h(is)f(the)140 2306 y(kinship)33 b(co)r(e\016cien)n(ts)f(for)g(all)h(pairs)e(in)i(the)g(p)r(edigree)f (at)h(particular)e(genomic)h(p)r(ositions)h(conditional)f(on)135 2406 y(link)n(ed)22 b(mark)n(ers.)34 b(In)22 b(fact,)i(the)e(v)-5 b(alues)22 b(estimated)h(are)e(t)n(wice)h(the)h(kinship)g(co)r (e\016cien)n(ts,)g(as)e(this)i(is)f(normally)137 2505 y(what)j(is)g(required.)35 b(These)24 b(v)-5 b(alues)25 b(are)f(curren)n(tly)f(not)i(used)g(b)n(y)f(Loki,)h(though)g(in)g(the)g (future)g(it)g(is)g(planned)140 2605 y(to)33 b(use)h(this)f(mec)n (hanism)g(for)g(implemen)n(ting)h(v)-5 b(ariance)32 b(comp)r(onen)n(t)i (approac)n(hes)d(for)i(link)-5 b(age)33 b(mapping.)135 2705 y(Loki)22 b(has)g(b)r(een)h(used)f(to)h(pro)r(duce)f(kinship)g(co) r(e\016cien)n(t)g(matrices)g(for)g(v)-5 b(ariance)21 b(comp)r(onen)n(t)h(analyses)f(using)140 2804 y(external)27 b(programs)e(\(Vissc)n(her)i(et)h(al.,)f(1999\).)140 2954 y(There)34 b(are)f(t)n(w)n(o)h(main)g(programs,)g Fk(prep)f Fl(and)i Fk(loki)p Fl(,)f(whic)n(h)h(resp)r(ectiv)n(ely)e (handle)h(data)g(input)i(and)e(the)140 3053 y(MCMC)i(analysis.)58 b(The)36 b(data)e(preparation)g(program,)h Fk(prep)p Fl(,)h(reads)e(in)i(data)f(from)g(a)g(wide)g(v)-5 b(ariet)n(y)34 b(of)139 3153 y(input)28 b(formats,)f(tests)g(for)f(consistency)g(of)h (p)r(edigree)g(and)g(mark)n(er)e(data,)i(reco)r(des)f(the)h(data,)g (and)g(outputs)135 3253 y(standardized)22 b(binary)g(\014les)g(for)g (the)h(analysis)e(program,)g Fk(loki)p Fl(.)34 b(Also)22 b(included)h(in)g(the)f(pac)n(k)-5 b(age)21 b(are)h(sev)n(eral)134 3352 y(small)e(programs)f(and)h(scripts)g(whic)n(h)h(help)g(in)g(the)g (in)n(terpretation)f(of)h(the)g(output)g(from)g Fk(loki)p Fl(.)33 b(Throughout)140 3452 y(this)d(do)r(cumen)n(t,)h(I)f(will)h (refer)e(to)h(the)h(individual)f(programs)e(as)h Fk(prep)f Fl(and)i Fk(loki)p Fl(,)f(and)h(the)h(pac)n(k)-5 b(age)28 b(as)i(a)140 3551 y(whole)d(as)g(Loki.)134 3701 y(Also)20 b(included)i(with)f(the)h(loki)p 1096 3701 25 4 v 29 w(2.4)e(distribution)h(is)g(a)f(small)h(collection)f(of)h(short)f (programs)e(and)j(p)r(erl)g(scripts)140 3800 y(whic)n(h)34 b(I)g(use)g(to)g(help)h(analyze)e(the)h(output)h(from)f(Loki.)56 b(These)34 b(are)f(included)i(in)f(the)h(hop)r(e)f(that)g(they)140 3900 y(migh)n(t)29 b(b)r(e)h(of)g(use)f(to)g(other)g(p)r(eople.)42 b(F)-7 b(eedbac)n(k)29 b(on)g(the)h(scripts)f(\(and)h(on)f(Loki)g(as)f (a)h(whole\))h(is)f(w)n(elcome.)140 4000 y(If)f(the)g(scripts)f(pro)n (v)n(e)f(useful)i(then)g(they)g(migh)n(t)f(b)r(e)h(expanded)g(to)f (\014t)h(with)g(p)r(eople's)g(requiremen)n(ts.)140 4324 y Fo(2)135 b(Installation)139 4556 y Fl(It)26 b(is)h(assumed)e(that)i (y)n(ou)e(ha)n(v)n(e)g(the)i(latest)f(Loki)g(arc)n(hiv)n(e)e(\014le,)j (it)g(has)f(b)r(een)g(un)n(tarred,)g(and)g(y)n(ou)f(are)h(in)g(the)140 4655 y(top)i(\(loki/\))f(directory)-7 b(.)35 b(The)28 b(simplest)g(w)n(a)n(y)e(to)i(compile)f(the)h(pac)n(k)-5 b(age)26 b(is)i(to)f(t)n(yp)r(e:)140 4871 y Fk(./configure)140 4971 y(make)140 5070 y(make)42 b(tests)140 5286 y Fl(The)e(con\014gure) f(script)h(attempts)h(to)f(guess)f(settings)h(that)g(should)g(w)n(ork)f (with)h(y)n(our)f(system.)74 b(If)41 b(the)136 5386 y(compilation)23 b(do)r(es)g(not)g(w)n(ork)f(y)n(ou)g(could)h(edit)h(b)n(y)f(hand)g(the) h(\014le)g(./con\014g.h)e(or)g(the)i(Mak)n(e\014les)e(\(./Mak)n (e\014le,)140 5486 y(libsrc/Mak)n(e\014le,)30 b(lokisrc/Mak)n (e\014le\).)46 b(Otherwise,)32 b(to)f(sp)r(ecify)g(a)g(C)h(compiler)e (to)i(use,)g(and)f(\015ags)f(for)h(the)139 5585 y(compiler)26 b(set)h(the)g(en)n(vironmen)n(t)f(v)-5 b(ariables)26 b(CC)h(and)f(CFLA)n(GS)h(b)r(efore)g(calling)f(con\014gure.)35 b(F)-7 b(or)26 b(example,)140 5685 y(to)h(tell)h(con\014gure)f(to)g (use)h(the)g(gcc)f(compiler)g(with)h(optimization)f(use)1851 5962 y(2)p eop end %%Page: 3 3 TeXDict begin 3 2 bop 140 231 a Fk(CC=gcc)41 b(CFLAGS='-O3)e(-g')j (./configure)140 445 y Fl(If)33 b(the)g(gcc)f(compiler)g(is)g(used)h (then,)h(b)n(y)f(default,)h(optimization)e(is)h(turned)f(on.)52 b(If)33 b(another)f(compiler)f(is)140 545 y(used)d(then)h(CFLA)n(GS)f (should)g(b)r(e)h(set)f(with)h(the)f(appropriate)f(\015ags)g(to)h(turn) g(on)g(optimization)g(with)h(y)n(our)138 645 y(compiler)c(\(normally)g (-O\).)g(It)h(is)g(highly)f(recommended)g(that)h(some)f(form)h(of)f (optimization)h(is)f(used)h(as)f(the)137 744 y(calculations)d(p)r (erformed)h(b)n(y)h(Loki)f(are)f(v)n(ery)h(computationally)g(in)n (tensiv)n(e.)35 b(After)24 b(successful)f(compilation,)140 844 y Fk(make)42 b(install)29 b Fl(can)i(b)r(e)h(run)g(to)f(mo)n(v)n(e) g(the)h(programs)d(to)j(a)f(bin)h(directory)-7 b(.)48 b(By)32 b(default,)h(programs)c(are)140 944 y(installed)39 b(to)g(the)h(bin)g(sub)r(directory)e(of)h(the)h(the)g(loki/.)71 b(This)39 b(b)r(eha)n(viour)f(can)h(b)r(e)h(altered)e(b)n(y)h(giving) 140 1043 y(the)31 b({pre\014x)f(option)g(to)h(con\014gure.)44 b(F)-7 b(or)30 b(example,)h(to)g(install)g(the)g(programs)d(in)j (/usr/lo)r(cal/bin,)e(in)n(v)n(ok)n(e)140 1143 y(con\014gure)d(as:)37 b Fk(./configure)i(--prefix=/usr/l)o(oca)o(l)136 1292 y Fl(If)24 b Fk(make)42 b(tests)22 b Fl(fails)h(then)h(this)g(ma)n(y)f (or)f(ma)n(y)h(not)g(b)r(e)h(serious)e(b)r(ecause)h(di\013erences)h (can)f(b)r(e)h(caused)e(due)i(to)138 1392 y(di\013erences)h(in)h (\015oating)e(p)r(oin)n(t)i(implemen)n(tations)f(b)r(et)n(w)n(een)g (mac)n(hines.)36 b(As)25 b(far)g(as)g(p)r(ossible)g(this)g(has)g(b)r (een)140 1491 y(a)n(v)n(oided,)31 b(but)h(some)e(problems)h(still)h (remain.)47 b(In)31 b(particular,)g(certain)g(mac)n(hine)g(arc)n (hitectures)f(\(suc)n(h)h(as)136 1591 y(In)n(tel)22 b(or)g(Alpha\))h (compute)g(\015oating)e(p)r(oin)n(t)i(with)g(to)r(o)g(m)n(uc)n(h)f (accuracy)-7 b(,)22 b(i.e.,)i(more)e(accurate)f(than)i(sp)r(eci\014ed) 140 1691 y(b)n(y)28 b(the)g(IEEE)e(standards.)37 b(T)-7 b(o)28 b(a)n(v)n(oid)e(this,)i(b)n(y)g(default,)h(when)f(loki)f(is)h (compiled)g(with)g(gcc,)g(the)g(compiler)140 1790 y(\015ag)h (-\017oat-store)f(is)j(used)f(whic)n(h)g(instructs)g(the)g(compiler)g (to)g(not)g(use)g(the)h(extra)e(precision.)44 b(If)30 b(y)n(ou)g(use)140 1890 y(a)g(non-gcc)e(compiler,)i(then)h(it)f(ma)n(y) g(b)r(e)g(p)r(ossible)g(to)g(\014nd)g(an)g(equiv)-5 b(alen)n(t)30 b(switc)n(h)g(for)f(y)n(our)g(compiler.)43 b(Of)136 1990 y(course,)23 b(if)h(y)n(ou)f(are)f(not)h(in)n(terested)g(in)h (comparing)e(runs)h(on)g(di\013eren)n(t)g(mac)n(hines)g(then)h(this)f (will)h(not)f(apply)-7 b(.)137 2089 y(Note)25 b(that)g(if)g(y)n(ou)f (regularly)e(use)j(mac)n(hines)e(with)i(di\013eren)n(t)g(arc)n (hitectures,)f(and)g(in)n(tend)h(to)g(start)f(analyses)139 2189 y(with)j(one)f(mac)n(hine)g(and)g(con)n(tin)n(ue)g(with)h(a)f (di\013eren)n(t)h(mac)n(hine,)f(it)h(is)f(imp)r(erativ)n(e)g(that)h (the)f(t)n(w)n(o)g(mac)n(hines)140 2288 y(giv)n(e)h(the)h(same)f(answ)n (ers)f(as)g(the)i(test)g(set)g(\(more)f(ab)r(out)h(this)f(later\).)137 2438 y(If)e(the)g(test)g(fails,)g(try)f(running)g(the)h(tests)g(b)n(y)f (hand)g(\(cd)h(in)n(to)f(the)h(test)g(directory)e(and)i(read)e(the)i (README)133 2538 y(\014le)19 b(there\))h(to)f(see)g(if)h(the)g(tests)f (ran)g(but)h(ga)n(v)n(e)e(di\013eren)n(t)h(output)h(\(p)r(ossibly)g (due)f(to)h(\015oating)e(p)r(oin)n(t)i(di\013erences)140 2637 y(b)r(et)n(w)n(een)38 b(mac)n(hines\),)i(or)d(if)h(they)g(failed)g (to)g(run)g(at)f(all.)68 b(In)38 b(either)g(case,)h(please)e(send)h(me) g(an)n(y)f(error)140 2737 y(outputs)h(y)n(ou)f(receiv)n(e.)65 b(I)38 b(w)n(ould)f(lik)n(e)g(to)h(hear)e(ab)r(out)i(an)n(y)f(problems) f(that)i(y)n(ou)f(ha)n(v)n(e)f(compiling)i(and)140 2836 y(running)32 b(the)h(programs)e(on)h(UNIX)h(mac)n(hines.)51 b(The)33 b(only)f(extensiv)n(e)g(testing)h(has)f(b)r(een)h(on)f (Solaris)f(5.8)140 2936 y(and)d(F)-7 b(reeBSD)29 b(4.1,)f(but)h(the)f (programs)f(ha)n(v)n(e)g(b)r(een)i(compiled)f(and)g(run)h(on)f(a)g (range)f(on)h(di\013eren)n(t)g(UNIX)138 3036 y(b)r(o)n(xes)d(including) h(OSF1)f(V4.0,)g(Irix)h(6.5,)f(Op)r(enBSD)h(2.7-3.2)d(and)j(Lin)n(ux)f (2.0.30/2.2.6/2.3.6)20 b(\(see)26 b(the)g(\014le)140 3135 y Fk(README.known_sys)o(tem)o(s)21 b Fl(for)27 b(an)h(up)f(to)h (date)f(list\).)38 b(My)27 b(abilit)n(y)h(to)f(help)h(with)g(mac)n (hine)f(t)n(yp)r(es)h(I)f(do)g(not)140 3235 y(ha)n(v)n(e)32 b(access)f(to)i(is)f(ob)n(viously)f(limited.)53 b(If)33 b(p)r(eople)g(ha)n(v)n(e)e(tried)i(to)g(get)f(Loki)g(compiled)h(and)f (running)h(on)137 3335 y(other)24 b(mac)n(hines,)h(I)f(w)n(ould)g(b)r (e)h(v)n(ery)e(in)n(terested)h(to)h(hear)e(ab)r(out)i(an)n(y)e (problems)h(and,)h(of)f(course,)g(successes!)140 3484 y(There)35 b(are)f(t)n(w)n(o)g(stages)g(to)h(running)f(an)h(analysis:) 51 b(\014rst)35 b Fk(prep)e Fl(is)i(run)g(on)g(the)g(original)f (data\014les.)58 b(The)136 3584 y(appropriate)21 b(information)h(is)h (read)f(from)h(the)g(data\014les)g(and)g(enco)r(ded)g(in)g(a)f(form)h (suitable)g(for)f(the)i(analysis)140 3683 y(program,)29 b Fk(loki)p Fl(.)45 b(A)31 b(con)n(trol)e(\014le)h(is)h(required)f(for) g Fk(prep)p Fl(,)f(and)i(a)f(parameter)f(\014le)i(for)f Fk(loki)p Fl(.)44 b(Information)140 3783 y(on)27 b(ho)n(w)g(to)h(write) f(these)h(\014les)f(is)h(giv)n(en)f(in)g(the)h(follo)n(wing)f (sections.)140 3932 y(If)g(con)n(trol)f(and)i(parameter)d(\014les)j (for)e(an)h(analysis)f(ha)n(v)n(e)g(b)r(een)i(set)f(up)h(then)g (running)f(the)g(analysis)f(can)h(b)r(e)140 4032 y(accomplished)g(b)n (y)g(t)n(yping:)140 4246 y Fk(prep)42 b(control_file)140 4346 y(loki)g(param_file)140 4560 y Fl(Output)32 b(from)e(the)h(run)g (is)g(written)g(to)g(the)g(\014le)g Fk(loki.out)p Fl(;)f(in)n (terpretation)f(of)i(this)h(output)f(is)g(discussed)140 4659 y(in)d(the)g(section)f(`Analysis)g(of)h(output'.)140 4983 y Fo(3)135 b(Data)46 b(preparation:)61 b Fi(prep)140 5215 y Fl(Data)30 b(preparation)f(is)h(p)r(erformed)g(b)n(y)h Fk(prep)p Fl(,)f(whic)n(h)g(tak)n(es)f(as)h(input)h(a)f(con)n(trol)f (\014le)i(sp)r(ecifying)f(the)h(data)140 5315 y(\014les)i(required)g (and)g(their)g(format)g(\(Section)g(5.)54 b Fk(prep)32 b Fl(reads)g(in)i(the)f(appropriate)f(data)h(\014les,)h(sorts)f(and)140 5414 y(reco)r(des)38 b(the)i(data)e(where)h(required,)i(and)e(then)h (outputs)f(the)h(data)e(as)h(a)g(series)f(of)h(\014les)g(in)g(a)g (format)140 5514 y(suitable)28 b(for)f Fk(loki)p Fl(.)35 b(Note)28 b(that)g(if)g(di\013eren)n(t)g(mac)n(hine)f(t)n(yp)r(es)g (are)g(in)h(use,)g(the)g(data)f(\014les)g(output)h(b)n(y)h Fk(prep)140 5613 y Fl(can)k(b)r(e)g(freely)f(exc)n(hanged)g(b)r(et)n(w) n(een)h(mac)n(hines.)52 b(It)33 b(is,)h(for)f(example,)g(p)r(ossible)g (to)g(run)g Fk(prep)e Fl(on)h(a)h(Sun)140 5713 y(Sparc)h(w)n (orkstation,)h(and)f(then)i(run)e Fk(loki)g Fl(on)g(an)h(In)n(tel)f (based)h(Lin)n(ux)f(w)n(orkstation.)57 b(There)34 b(are)g(some)1851 5962 y(3)p eop end %%Page: 4 4 TeXDict begin 4 3 bop 140 231 a Fl(restrictions)27 b(on)h(this:)39 b(\(1\))29 b(use)f(of)h(a)f(mac)n(hine)g(with)h(non{standard)e (\015oating{p)r(oin)n(t)g(routines)h(\(either)h(to)r(o)140 331 y(inaccurate)d(or)h(to)r(o)g(accurate\);)g(\(2\))g(use)h(of)f(mac)n (hines)g(with)h(di\013eren)n(t)g(sized)f(`longs'.)36 b(This)27 b(last)h(situation,)137 431 y(whic)n(h)c(could)g(arise)g (with)g(a)g(mix)h(of)f(In)n(tel)h(and)f(Alpha)g(based)g(mac)n(hines,)g (will)h(only)f(cause)f(a)h(problem)g(if)h(the)140 530 y(dataset,)h(for)h(reasons)e(of)j(size)e(and)h(complexit)n(y)-7 b(,)27 b(can)g(only)g(b)r(e)g(run)g(on)g(the)h(mac)n(hine)f(with)g (larger)f(longs)g(of)140 630 y(the)32 b(mac)n(hines.)48 b(F)-7 b(or)31 b(example,)h(a)f(complex)g(p)r(edigree)g(ma)n(y)g(run)g (on)h(an)f(Alpha)h(mac)n(hine)f(but)h(not)f(on)h(an)140 729 y(In)n(tel)f(mac)n(hine)f(due)h(to)g(the)g(smaller)e(size)i(of)f (longs)g(on)g(the)h(In)n(tel)g(mac)n(hine.)46 b(Note)31 b(that)g(in)g(general)e(time)140 829 y(and)e(memory)g(requiremen)n(ts)g (prev)n(en)n(t)f(this)i(b)r(ecoming)g(an)f(issue.)140 979 y(Genot)n(yp)r(e)33 b(data)g(are)g(c)n(hec)n(k)n(ed)f(b)n(y)j Fk(prep)c Fl(for)i(consistency)g(-)g(a)g(logical)g(p)r(eeling)g(op)r (eration)f(is)i(p)r(erformed)140 1078 y(on)d(eac)n(h)g(lo)r(cus)h(to)f (determine)h(if)g(the)g(lik)n(eliho)r(o)r(d)f(of)h(the)g(data)f(for)g (that)h(lo)r(cus)g(is)f(zero.)48 b(By)32 b(default,)h(the)137 1178 y(program)22 b(stops)i(if)g(an)g(error)e(is)i(detected;)i(if)e (there)g(is)g(no)g(error)e(message)h(pro)r(duced)h(then)g(the)h(lik)n (eliho)r(o)r(d)f(of)134 1277 y(the)d(data)g(giv)n(en)f(the)h(p)r (edigree)f(structure)h(is)g(p)r(ositiv)n(e,)h(and)e(is)h(therefore)f (consisten)n(t.)34 b(Note)21 b(that)g(this)h(is)e(true)137 1377 y(whether)k(or)g(not)g(the)h(p)r(edigree)e(con)n(tains)h(lo)r (ops.)35 b(If)24 b(an)g(error)f(o)r(ccurs)g(then)i(information)e(ab)r (out)i(the)f(family)140 1477 y(where)32 b(the)h(error)e(w)n(as)g(found) i(is)g(normally)e(displa)n(y)n(ed.)51 b(It)33 b(is)g(p)r(ossible,)g (although)f(rare,)h(for)f(a)g(genot)n(yp)r(e)136 1576 y(inconsistency)23 b(to)h(b)r(e)f(detected)h(only)f(at)h(a)f(late)g (stage)g(in)g(the)h(pro)r(cess.)35 b(In)23 b(this)h(case)f(it)g (unfortunately)h(ma)n(y)137 1676 y(not)h(b)r(e)g(p)r(ossible)g(for)f (the)h(program)e(to)h(pinp)r(oin)n(t)i(where)e(the)h(error)e(o)r (ccurs.)35 b(This)24 b(situation)h(can,)g(ho)n(w)n(ev)n(er,)140 1776 y(only)i(arise)g(in)h(complex)g(\(lo)r(op)r(ed\))g(p)r(edigrees.) 37 b(It)28 b(is)g(also)e(p)r(ossible)i(to)g(tell)g Fk(prep)e Fl(to)i(try)f(and)h(iden)n(tify)h(and)139 1875 y(delete)f(genot)n(yp)r (es)e(whic)n(h)h(app)r(ear)f(to)h(b)r(e)g(wrong,)f(rather)g(than)h (stopping)f(at)h(the)h(\014rst)e(inconsistency)-7 b(.)37 b(F)-7 b(or)140 1975 y(more)27 b(details)g(on)g(this,)h(see)g(the)g Fk(correct_errors)22 b Fl(\015ag.)139 2124 y(When)27 b(the)g(problem)e(can)h(b)r(e)h(lo)r(calized)f(to)g(a)g(family)-7 b(,)27 b Fk(prep)e Fl(prin)n(ts)g(out)i(the)g(mem)n(b)r(ers)f(of)g(the) h(family)f(with)140 2224 y(their)h(observ)n(ed)f(genot)n(yp)r(es)h(and) g(inferences)g(made)g(b)n(y)i Fk(prep)d Fl(ab)r(out)h(unobserv)n(ed)f (genot)n(yp)r(es)h(in)h(previous)140 2323 y(stages)34 b(of)i(the)g(pro)r(cess.)59 b(This)36 b(normally)e(mak)n(es)h(it)h (straigh)n(tforw)n(ard)c(to)j(sp)r(ot)h(what)g(genot)n(yp)r(es\(s\))e (are)140 2423 y(causing)26 b(the)i(problem.)36 b(An)28 b(example)e(error)g(message)f(migh)n(t)j(lo)r(ok)e(lik)n(e)h(this)h (\(note)f(that)g(`*')g(is)h(shorthand)140 2523 y(for)f(an)n(y)g (allele\):)140 2723 y Fk(DoFamily\(\):)39 b(Inconsistent)g(family)i (data)h(for)g(locus)g(D1GS32)140 2823 y(Father:)f(220)h([*,*])140 2922 y(\(*,*\))140 3022 y(Mother:)f(218)h([*,*])140 3122 y(\(7,*\))g(\(*,7\))184 3221 y(->)g(114)h([7,7])314 3321 y(\(7,7\))184 3421 y(->)f(330)h([7,7])314 3520 y(\(7,7\))184 3620 y(->)f(378)h([7,8])314 3719 y(\(8,7\))f(\(7,8\))184 3819 y(->)g(1854)g([1,10])314 3919 y(\(10,1\))f(\(1,10\))184 4018 y(->)h(1988)g([7,10])314 4118 y(\(10,7\))f(\(7,10\))140 4318 y Fl(The)32 b(paren)n(ts)f(ha)n(v)n(e)g(no)g(genot)n(yp)r(e)g (information,)i(but)f(from)g(an)f(earlier)g(op)r(eration)f(it)j(is)e (kno)n(wn)h(1)f(of)h(the)138 4418 y(mother's)25 b(alleles)g(has)g(to)h (b)r(e)g(a)f(`7'.)36 b(The)26 b(\014v)n(e)f(o\013spring)g(then)h(follo) n(w,)f(with)h(their)g(observ)n(ed)e(genot)n(yp)r(es)h(\(in)140 4518 y(square)h(brac)n(k)n(ets\),)h(and)g(their)h(inferred)f(ordered)f (genot)n(yp)r(es)h(\(in)h(round)f(brac)n(k)n(ets\).)140 4667 y(V)-7 b(ery)29 b(complex)f(p)r(edigrees)h(\(with)g(man)n(y)g(in)n (terlo)r(c)n(king)f(lo)r(ops\))g(ma)n(y)h(cause)f(the)h(program)e(to)i (tak)n(e)g(so)f(long)140 4767 y(that)35 b(it)g(app)r(ears)e(to)i(ha)n (v)n(e)e(`h)n(ung',)j(or)e(to)g(terminate)h(with)g(an)f(error)e (message.)57 b(Although)34 b(the)h(p)r(eeling)140 4866 y(calculations)f(could)g(in)h(theory)f(b)r(e)i(b)n(ypassed)d(at)i(this) g(stage,)h(they)f(are)e(required)h(for)h(the)g(op)r(eration)e(of)138 4966 y Fk(loki)p Fl(,)24 b(so)g(a)g(p)r(edigree)h(to)r(o)f(large)g(to)h (b)r(e)g(pro)r(cessed)f(b)n(y)i Fk(prep)d Fl(is)i(to)r(o)g(large)e(to)i (b)r(e)g(analyzed)f(with)i Fk(loki)p Fl(,)e(and)140 5065 y(m)n(ust)k(b)r(e)g(split)g(up.)135 5215 y(Data\014les)22 b(in)g(a)g(wide)h(v)-5 b(ariet)n(y)21 b(of)h(formats)f(can)h(b)r(e)h (read)e(in,)j(the)e(main)g(requiremen)n(t)g(b)r(eing)g(that)g(\014les)g (should)140 5315 y(con)n(tain)28 b(nothing)g(apart)g(from)g(data)g Fj(i.e.)p Fl(,)j(data\014les)d(should)g(not)h(also)e(con)n(tain)h (commands.)39 b(The)29 b(data\014le)139 5414 y(should)d(con)n(tain)f(a) h(n)n(um)n(b)r(er)g(of)g Fj(r)l(e)l(c)l(or)l(ds)33 b Fl(with)27 b(the)f(format)g(of)g(a)g(record,)f(and)h(the)g(splitting)h (of)f(the)h(\014le)f(in)n(to)139 5514 y(records,)e(b)r(eing)i (determined)h(b)n(y)e(the)i(con)n(trol)e(\014le)h(\(describ)r(ed)g(b)r (elo)n(w\).)36 b(Multiple)27 b(input)g(\014les)f(can)f(b)r(e)i(used)138 5613 y(\()p Fj(i.e.)p Fl(,)h(separate)23 b(p)r(edigree,)i(phenot)n(yp)r (e)h(data,)f(and)g(genot)n(yp)r(e)f(data)h(\014les\),)h(with)g(the)f (one)g(restriction)f(b)r(eing)140 5713 y(that)k(eac)n(h)f(record)f(m)n (ust)i(con)n(tain)e(an)i(ID,)g(allo)n(wing)e(records)g(to)h(b)r(e)h (link)n(ed)g(across)d(\014les.)1851 5962 y(4)p eop end %%Page: 5 5 TeXDict begin 5 4 bop 138 231 a Fl(Reco)r(ding)26 b(of)f(the)i (data\014les)e(is)g Fj(not)34 b Fl(necessary)-7 b(,)24 b Fk(prep)h Fl(can)g(handle)h(alpha-n)n(umeric)e(co)r(des)h(of)h (\(almost\))g(an)n(y)135 331 y(length)21 b(for)g(p)r(edigree)g(IDs,)j (allele)d(co)r(des,)h(and)g(discrete)f(en)n(vironmen)n(tal)f(factors.) 34 b(This)21 b(has)g(2)h(main)f(b)r(ene\014ts)140 431 y(-)30 b(it)g(simpli\014es)g(the)g(use)g(of)37 b Fk(prep)p Fl(,)29 b(and)g(allo)n(ws)g(errors)f(to)h(b)r(e)i(rep)r(orted)e(using)h (the)g(original)e(co)r(des,)i(whic)n(h)140 530 y(mak)n(es)d(trac)n (king)f(do)n(wn)h(of,)g(for)g(example,)h(genot)n(yp)r(e)e(errors,)g(m)n (uc)n(h)h(simpler.)140 680 y(The)i(n)n(um)n(b)r(er)f(of)g(input)h (records,)e(p)r(edigree)h(size)g(etc.)40 b(are)27 b(determined)i(b)n(y) g Fk(prep)e Fl(and)h(do)h(not)f(need)h(to)f(b)r(e)140 779 y(sp)r(eci\014ed.)38 b(Limits)28 b(for)g(the)g(p)r(edigree)f(size,) h(no.)37 b(of)28 b(mark)n(ers)e(etc.)i(are)f(determined)h(b)n(y)f(a)n (v)-5 b(ailable)27 b(memory)-7 b(,)139 879 y(the)26 b(one)g(exception)g (to)g(this)h(b)r(eing)f(the)h(maxim)n(um)f(n)n(um)n(b)r(er)g(of)g (alleles)g(p)r(er)g(mark)n(er)e(segregating)g(within)j(a)139 979 y(comp)r(onen)n(t,)f(whic)n(h)g(is)g(limited)h(b)n(y)f(the)g(n)n (um)n(b)r(er)g(of)g(bits)h(in)f(a)g(long)f(in)n(t)h(\(t)n(ypically)g (32\).)36 b(In)26 b(man)n(y)g(mo)r(dern)140 1078 y(systems)36 b(this)g(can)g(often)g(b)r(e)h(extended)f(to)g(64,)h(but)g(with)g(a)f (p)r(ossible)f(p)r(erformance)g(\(and)i(p)r(ortabilit)n(y\))140 1178 y(p)r(enalt)n(y)-7 b(.)140 1327 y Fk(prep)30 b Fl(can)i(handle)g (p)r(edigrees)f(con)n(taining)g(lo)r(ops,)i(as)e(long)h(as)f(the)h(p)r (edigree)g(is)g(not)g(to)r(o)f(complex)h(\(what)140 1427 y(constitutes)43 b(to)r(o)g(complex)f(dep)r(ends)i(on)e(the)i(size)e (of)h(computer)g(and)g(the)g(amoun)n(t)f(of)h(patience)g(y)n(ou)140 1526 y(ha)n(v)n(e\).)70 b(The)39 b(user)f(do)r(es)h(not)g(ha)n(v)n(e)f (to)h(do)f(an)n(ything)h(to)f(tell)i Fk(prep)d Fl(ab)r(out)i(lo)r(ops,) i(it)f(will)f(attempt)g(to)138 1626 y(deal)25 b(with)g(them)h(itself.) 37 b(The)25 b(sampling)g(algorithms)e(used)i(in)h Fk(prep)d Fl(required)i(that)g(a)g(single)g(lo)r(cus)f(p)r(eeling)136 1726 y(\(lik)n(eliho)r(o)r(d\))g(calculation)e(is)h(carried)f(out)i(at) f(eac)n(h)f(lo)r(cus)h(\(mark)n(er)f(+)h(trait\).)36 b(Multiple)24 b(lo)r(ci)f(are)f(not)i(p)r(eeled)139 1825 y(sim)n(ultaneously)-7 b(,)26 b(so)g Fk(prep)f Fl(is)i(not)f (a\013ected)h(b)n(y)f(the)h(n)n(um)n(b)r(er)g(of)f(lo)r(ci)h(in)g(the)g (w)n(a)n(y)e(that)i(traditional)f(link)-5 b(age)140 1925 y(pac)n(k)g(ages)26 b(are.)140 2074 y(Sometimes)37 b(a)g(p)r(edigree)g (is)g(to)r(o)g(large)e(to)i(b)r(e)h(pro)r(cessed)e(b)n(y)i Fk(prep)p Fl(,)g(not)f(b)r(ecause)g(of)g(time)h(or)e(memory)140 2174 y(constrain)n(ts,)29 b(but)h(b)r(ecause)g(the)g(indexing)f(system) h(used)f(b)n(y)i Fk(prep)d Fl(to)i(k)n(eep)f(trac)n(k)f(of)i(p)r (ossible)f(genot)n(yp)r(es)140 2274 y(has)f(to)h(\014t)g(in)n(to)g(a)f (long)g(in)n(t.)41 b(A)29 b(p)r(edigree)f(with)i(a)e(small)g(lo)r(ops)h (can)f(cause)g(prep)h(to)f(fail)h(if)g(a)g(mark)n(er)e(with)140 2373 y(man)n(y)35 b(segregating)e(alleles)h(is)h(analyzed.)59 b(It)36 b(is)f(p)r(ossible)g(to)g(a)n(v)n(oid)f(this,)k(in)d(the)h (same)f(w)n(a)n(y)f(as)g(for)h(the)140 2473 y(restriction)28 b(on)i(maxim)n(um)f(n)n(um)n(b)r(er)g(of)g(segregating)f(alleles)g(p)r (er)i(comp)r(onen)n(t,)f(b)n(y)g(increasing)f(the)i(size)f(of)140 2573 y(index.)53 b(Sev)n(eral)32 b(compilers)g(\(including)h(gcc\))g (supp)r(ort)f(long)h(long)f(in)n(t)h(v)-5 b(ariables,)33 b(whic)n(h)g(are)f(commonly)140 2672 y(64)h(bit.)57 b(Compiling)33 b(Loki)h(with)g(the)g(\015ag)g Fk(-DUSE_LONGLONG)28 b Fl(will)34 b(do)g(this.)56 b(Note)34 b(that)g(this)h(can)e(cause)137 2772 y(p)r(ortabilit)n(y)24 b(problems)g(with)h(the)g(output)g(\014les) f(from)g Fk(loki)f Fl(and)i Fk(prep)p Fl(.)34 b(It)25 b(can)f(also)f(ha)n(v)n(e)g(a)h(sp)r(eed)h(p)r(enalt)n(y)-7 b(,)140 2871 y(so)27 b(only)g(use)h(if)g(strictly)f(necessary)-7 b(.)140 3196 y Fo(4)135 b(Mark)l(o)l(v)45 b(c)l(hain)g(Mon)l(te)h (Carlo)f(analysis:)62 b Fi(loki)138 3427 y Fl(The)25 b(actual)g(analysis)e(is)i(p)r(erformed)g(b)n(y)h Fk(loki)p Fl(,)e(using)h(the)g(output)h(\014les)f(from)g Fk(prep)p Fl(.)34 b(An)26 b(MCMC)f(analysis)140 3527 y(consists)33 b(of)g(a)h(\(normally)e(large\))h(n)n(um)n(b)r(er)g(of)h Fj(sampling)i(iter)l(ations)7 b Fl(;)37 b(eac)n(h)c(iteration)g(in)n(v) n(olv)n(es)f(up)r(dating)140 3627 y(\(or)f(trying)f(to)h(up)r(date\))h (ev)n(ery)e(parameter)f(in)j(the)f(mo)r(del.)48 b(In)31 b(the)h(con)n(text)f(of)g(the)g(analyses)f(p)r(erformed)140 3726 y(b)n(y)35 b Fk(loki)p Fl(,)g(parameters)d(are)i(the)g(ordered)f (genot)n(yp)r(es)h(\(of)g(mark)n(ers)e(and)j(trait)f(lo)r(ci\),)i (allele)e(frequencies,)140 3826 y(trait)c(lo)r(ci)g(p)r(ositions)f(and) h(e\013ects,)h(n)n(um)n(b)r(er)f(of)g(trait)g(lo)r(ci,)g(co)n(v)-5 b(ariate)28 b(e\013ects,)j(and)f(v)-5 b(ariance)29 b(parameters.)135 3926 y(Inference)21 b(ab)r(out)h(an)n(y)f(or)g(all)g(of)h(these)g (parameters)e(is)i(p)r(ossible,)g(but)h(Loki)e(is)h(in)n(tended)g(for)f (use)h(as)f(a)g(link)-5 b(age)140 4025 y(analysis)26 b(pac)n(k)-5 b(age)26 b(so)h(atten)n(tion)h(is)f(fo)r(cused)h(on)f (inferring)g(the)h(p)r(osition)f(and)h(size)f(of)h(trait)f(lo)r(ci.)140 4175 y(The)35 b(output)f(\014les)h(from)f Fk(prep)p Fl(,)h(whic)n(h)f (are)f(used)i(b)n(y)g Fk(loki)p Fl(,)g(are)e(a)h(series)f(of)i (\(mostly\))g(text)f(\014les)h(called)139 4274 y Fk(loki.opt)p Fl(,)24 b Fk(loki.dat)p Fl(,)g Fk(loki.gen)g Fl(and)i Fk(loki.nrm)p Fl(,)e(the)j(last)g(only)f(if)i(a)e(p)r(olygenic)g (e\013ect)i(is)e(b)r(eing)h(\014tted.)140 4374 y(These)33 b(\014les)h(con)n(tain)e(information)h(on)g(basic)g(program)f(options)g (\()p Fk(loki.opt)p Fl(\);)i(phenot)n(yp)r(e)g(data,)g(mo)r(del)140 4474 y(information,)e(and)g(factor)f(reco)r(ding)g(data)g(\()p Fk(loki.dat)p Fl(\);)h(genot)n(yp)r(e)f(data,)i(allele)e(reco)r(ding)g (information,)140 4573 y(p)r(eeling)g(sequences)f(\()p Fk(loki.gen)p Fl(\);)g(non-zero)f(elemen)n(ts)i(of)f(the)i(in)n(v)n (erse)d(of)i(the)g(Numerator)f(Relationship)135 4673 y(Matrix)22 b(\(NRM\).)i(Note)f(that)f(if)h(the)g(FIL)-7 b(TER)23 b(command)f(is)g(used)h(in)f(the)h(con)n(trol)e(\014le)i(for)f Fk(prep)p Fl(,)g Fk(loki.dat)p Fl(,)140 4772 y Fk(loki.gen)36 b Fl(and)j Fk(loki.nrm)d Fl(will)j(ha)n(v)n(e)g(b)r(een)g(passed)g (through)f(the)i(\014lter)f(\(normally)f(for)h(compression)140 4872 y(purp)r(oses\).)k(There)29 b(is)g(additional)g(information)g (that)h Fk(loki)e Fl(needs)i(to)f(p)r(erform)h(its)f(analysis)g(suc)n (h)g(as)g(the)137 4972 y(map)24 b(p)r(ositions)g(of)g(mark)n(ers,)f(ho) n(w)g(long)h(to)g(run)g(the)h(analysis)d(for)i(etc.,)h(and)f(that)h (information)e(is)h(pro)n(vided)140 5071 y(b)n(y)33 b(a)f(parameter)g (\014le.)53 b(In)33 b(fact)h Fj(only)41 b Fl(the)33 b(mark)n(er)e(p)r (ositions)i(needs)g(to)g(b)r(e)g(pro)n(vided)f(in)h(the)h(parameter)140 5171 y(\014le,)e(but)g(if)g(further)f(information)f(ab)r(out,)i(for)f (example,)h(allele)e(frequencies)h(is)g(a)n(v)-5 b(ailable,)31 b(then)g(this)h(can)139 5271 y(b)r(e)26 b(giv)n(en)g(as)f(w)n(ell.)37 b(The)26 b(format)g(of)g(the)h(parameter)d(\014le)j(for)e Fk(loki)g Fl(is)h(giv)n(en)g(in)g(Section)g(6,)h(and)f(analysis)f(of) 140 5370 y(the)j(output)g(\014les)g(generated)e(b)n(y)j Fk(loki)d Fl(is)h(discussed)g(in)h(Section)g(7)1851 5962 y(5)p eop end %%Page: 6 6 TeXDict begin 6 5 bop 140 231 a Fo(5)135 b(Con)l(trol)46 b(\014le)f(for)g Fi(prep)140 463 y Fl(The)39 b(order)f(of)h(commands)f (in)h(the)h(con)n(trol)d(\014le)i(and)g(the)h(case)e(of)h(the)g (commands)f(are)g(not)h(normally)140 563 y(imp)r(ortan)n(t.)46 b(New)30 b(lines)h(are)f(mostly)g(ignored,)g(so)g(long)g(commands)g (can)g(b)r(e)h(split)g(o)n(v)n(er)e(sev)n(eral)g(lines.)46 b(It)140 662 y(should)30 b(b)r(e)h(noted)g(that)g(the)g(en)n(tire)f (con)n(trol)g(\014le)g(is)h(read)f(in)h(and)f(pro)r(cessed)g Fj(b)l(efor)l(e)38 b Fl(an)n(y)29 b(of)i(the)g(data\014les)138 762 y(are)23 b(read.)36 b(Commands)24 b(a\013ecting)h(ho)n(w)f(\014les) h(are)f(read)g(in)h(can)f(therefore)g(ha)n(v)n(e)g(an)h(e\013ect)g(no)g (matter)f(where)140 862 y(they)33 b(o)r(ccur)f(in)h(the)g(con)n(trol)f (\014le.)53 b(Commen)n(ts)32 b(can)h(b)r(e)g(included)g(an)n(ywhere)f (in)h(a)f(con)n(trol)g(\014le.)52 b(If)34 b(a)e(`#')138 961 y(o)r(ccurs)23 b(\(outside)i(of)g(quotes\))g(then)g(the)g(rest)g (of)f(the)i(line)f(is)f(ignored.)35 b(In)25 b(addition,)h(C)e(st)n(yle) h(commen)n(ts)f(can)140 1061 y(b)r(e)k(used)g(for)f(m)n(ultiline)h (commen)n(ting,)f(for)g(example:)140 1266 y Fk(/*)184 1366 y(*)43 b(Control)d(file)i(for)h(Dataset)d(Ch1z)i(-)i(November)c (1997)184 1465 y(*)184 1565 y(*/)140 1764 y(File)i("phenotypes",id,)o (sx)o(,ag)o(e,)o(y)c(#)43 b(read)f(in)g(phenotype)e(data)140 2044 y Fh(5.1)112 b(FILE)38 b(command)140 2247 y Fl(F)-7 b(rom)41 b(eac)n(h)f(input)i(\014le,)i Fk(prep)c Fl(reads)f(in)j(all)e (the)i(records)d(it)i(can)g(\014nd,)k(eac)n(h)40 b(record)g(consisting) g(of)h(a)137 2347 y(\(p)r(ossibly)24 b(v)-5 b(ariable\))23 b(n)n(um)n(b)r(er)h(of)g(\014elds.)35 b(T)-7 b(o)24 b(b)r(e)h(able)e (to)h(do)g(this,)h(the)f(con)n(trol)f(\014le)h(m)n(ust)g(ha)n(v)n(e)f (information)140 2447 y(on)33 b(\(a\))h(where)f(to)h(\014nd)g(the)g (\014les,)h(\(b\))g(ho)n(w)e(to)g(split)h(the)g(\014les)g(in)n(to)f (records,)h(and)f(\(c\))h(ho)n(w)f(to)h(split)g(the)140 2546 y(records)i(in)n(to)h(\014elds.)66 b(This)38 b(information)f(is)g (supplied)h(b)n(y)f(the)h(FILE)f(command)g(\(although)g(it)h(can)f(b)r (e)140 2646 y(mo)r(di\014ed)h(b)n(y)f(other)g(commands\).)66 b(The)38 b(format)f(of)g(the)h(FILE)f(command)h(is)f(FILE)g([optional)g (format)136 2746 y(clause])23 b("\014lename",v)-5 b(ar)921 2758 y Fg(1)957 2746 y Fl(,v)g(ar)1094 2758 y Fg(2)1130 2746 y Fl(,.)14 b(.)g(.)g(,v)-5 b(ar)1401 2758 y Ff(n)1445 2746 y Fl(.)36 b(If)24 b(w)n(e)f(ignore)f(the)i(format)f(clause)g(for)g (the)h(momen)n(t,)g(the)g(n)n(um)n(b)r(er)140 2845 y(of)29 b(v)-5 b(ariables)28 b(follo)n(wing)g(the)i(\014lename)f(determine)g (ho)n(w)g(man)n(y)g(\014elds)g Fk(prep)e Fl(exp)r(ects)j(to)f(\014nd)g (in)h(a)f(record.)139 2945 y(If)f(our)e(data\014le)g(w)n(as)g(a)g (triplet)h(\014le)g(with)h(p)r(edigree)e(information)g(\()p Fj(i.e.)p Fl(,)j(individual,)e(father,)g(mother\))g(as)f(in)1467 3201 y(Figure)h(1:)37 b(T)-7 b(est)28 b(dataset)140 3383 y Fk(1)43 b(0)g(0)140 3483 y(2)g(0)g(0)140 3583 y(3)g(1)g(2)140 3682 y(4)g(1)g(2)140 3938 y Fl(Example)27 b(1.)36 b(then)28 b(a)g(FILE)f(statemen)n(t)g(for)g(this)h(\014le)g(w)n(ould)f(b)r(e:)140 4144 y Fk(FILE)42 b("filename",id,fa)o(th)o(er,)o(mo)o(the)o(r)140 4349 y Fj(i.e.)p Fl(,)31 b(eac)n(h)d(record)g(has)g(3)h(data)f(items)i (\(id,)f(father,)h(mother\).)41 b(If)29 b(the)g(\014le)h(con)n(tains)e (un)n(w)n(an)n(ted)g(\014elds)h(then)140 4449 y(these)37 b(can)g(b)r(e)h(skipp)r(ed)f(b)n(y)g(either)g(sp)r(ecifying)g(dumm)n(y) h(v)-5 b(ariable)36 b(names)h(in)g(the)h(FILE)f(statemen)n(t,)i(or)140 4549 y(simply)30 b(b)n(y)g(missing)f(out)h(1)g(or)f(more)g(v)-5 b(ariable)29 b(names)h(corresp)r(onding)e(to)i(the)g(un)n(w)n(an)n(ted) f(p)r(ositions.)44 b(F)-7 b(or)140 4648 y(example,)27 b(the)h(statemen)n(t:)140 4854 y Fk(FILE)42 b("filename",id,fa)o(th)o (er,)o(,m)o(oth)o(er)140 5059 y Fl(w)n(ould)27 b(read)g(\014elds)h (1,2,)e(and)i(4)f(in)n(to)g(id,)h(father,)g(and)f(mother)g(resp)r (ectiv)n(ely)-7 b(,)27 b(with)h(\014eld)g(3)f(b)r(eing)h(skipp)r(ed.) 140 5209 y(By)g(default,)h Fk(prep)d Fl(assumes)i(that)g(there)g(is)g (1)g(record)f(p)r(er)h(line.)39 b(If)28 b(there)g(are)f(extra)h (\014elds)g(on)g(a)f(line)i(then)140 5308 y(they)k(are)f(ignored,)h(if) h(there)e(are)g(to)r(o)h(few)g(\014elds)g(then)g(the)h(v)-5 b(ariables)31 b(whic)n(h)i(could)g(not)g(b)r(e)g(read)f(in)h(are)140 5408 y(mark)n(ed)d(as)h(missing)g(for)g(that)g(record.)47 b(This)32 b(b)r(eha)n(viour)e(ma)n(y)g(b)r(e)i(c)n(hanged)f(b)n(y)g (setting)g(the)h(RS)g(\(record)140 5508 y(separator\))26 b(v)-5 b(ariable)26 b(as)h(in)h(the)g(follo)n(wing)e(3)i(examples:)140 5713 y Fk(RS)43 b(=)g("\\n")1851 5962 y Fl(6)p eop end %%Page: 7 7 TeXDict begin 7 6 bop 1467 289 a Fl(Figure)27 b(2:)37 b(T)-7 b(est)28 b(dataset)140 472 y Fk(1,181/183,223/22)o(3)140 571 y(2,181/183,200/21)o(0)140 671 y(3,,205/210)140 771 y(4,185/187,)140 1114 y(RS)43 b(=)g(":")140 1214 y(FILE)f([RS)g(=)h (""])g("filename",id,fa)o(th)o(er,)o(mo)o(th)o(er)136 1430 y Fl(The)22 b(\014rst)h(example)f(sets)g(RS)h(to)g(b)r(e)g(equal)f (to)g(the)h(newline)g(c)n(haracter;)f(this)h(is)g(actually)f(the)h (default)g(setting)139 1529 y(for)j(RS.)h(The)f(second)g(example)g(is)g (for)g(the)h(case)f(where)g(the)h(input)g(\014le)f(has)g(records)f (separated)g(b)n(y)h(colons.)140 1629 y(The)k(last)g(example)g(has)g (RS)h(within)g(the)g(format)f(clause)f(for)h(a)g(FILE)g(statemen)n(t;)i (this)e(sets)h(RS)f(for)g(that)135 1729 y(FILE)21 b(statemen)n(t)h(to)f (b)r(e)h(equal)f(to)h(the)g(n)n(ull)g(string,)g(whic)n(h)g(causes)e Fk(prep)g Fl(to)i(ignore)e(newlines)i(when)g(reading)140 1828 y(in)29 b(the)g(data.)40 b(Note)28 b(that)h(the)g(\014rst)g(2)f (examples)g(c)n(hange)g(the)h(default)g(v)-5 b(alue)28 b(of)h(RS)g(for)f(all)h(\014les,)g(whereas)140 1928 y(the)f(last)f (example)g(only)h(a\013ects)f(the)h(particular)e(FILE)i(statemen)n(t)f (the)h(RS)g(command)f(o)r(ccurs)g(in.)137 2077 y(There)c(is)h(an)f (analogous)f(v)-5 b(ariable,)24 b(FS,)g(for)f(con)n(trolling)g(ho)n(w)h Fk(prep)e Fl(splits)i(records)e(in)n(to)i(\014elds.)36 b(By)23 b(default)138 2177 y Fk(prep)h Fl(in)n(terprets)h(whitespace)h (\(space,)f(tab,)i(and)e(newline)h(c)n(haracters\))e(as)h(\014eld)h (separators.)34 b(As)25 b(with)i(RS,)140 2276 y(setting)34 b(FS)g(to)g(a)g(single)f(c)n(haracter)f(allo)n(ws)g(the)j(use)e(of)h (that)h(c)n(haracter)c(as)j(a)f(\014eld)h(separator)e(\(a)i(single)139 2376 y(space)25 b(has)h(a)g(sp)r(ecial)g(meaning)g(-)g(it)h(giv)n(es)e (the)i(default)g(b)r(eha)n(viour)e(of)h(using)g(whitespace)g(as)g(a)f (separator\).)139 2476 y(If)i(FS)g(is)f(set)g(to)h(a)f(longer)f(string) g(then)i(this)g(is)f(in)n(terpreted)g(as)g(a)g(regular)e(expression.)35 b(Note)27 b(that)g(supp)r(ort)140 2575 y(for)k(regular)e(expressions)h (is)h(not)g(curren)n(tly)f(a)n(v)-5 b(ailable)30 b(on)h(all)g (platforms.)47 b(Note)31 b(that)h(for)e(tab)i(separated)140 2675 y(\014elds)c(use)f Fk(FS="\\t")p Fl(.)140 2824 y(Another)41 b(\014eld)g(separator)e(v)-5 b(ariable,)43 b(GS,)f(is)f(used)f(for)h (con)n(trolling)e(ho)n(w)i(genot)n(yp)r(es)f(are)g(in)n(terpreted.)139 2924 y(Normally)-7 b(,)25 b(individuals)h(alleles)g(are)f(lo)r(cated)h (in)g(separate)f(\014elds,)h(and)g(so)g(this)g(v)-5 b(ariable)25 b(is)h(not)g(used.)37 b(This)139 3024 y(is)26 b(not)g(alw)n(a)n(ys)f (the)h(case,)g(ho)n(w)n(ev)n(er,)f(and)h(sometimes)g(the)g(t)n(w)n(o)g (alleles)g(o)r(ccur)f(in)i(the)g(same)e(\014eld)i(separated)140 3123 y(b)n(y)j(a)f(space)h(or)f(a)g(slash,)h Fj(i.e.)p Fl(,)j(183/185.)40 b(In)31 b(this)f(case,)g(GS)g(should)g(b)r(e)g(set)g (in)h(a)e(similar)h(w)n(a)n(y)e(to)i(RS)h(and)140 3223 y(FS)d(to)f(`/'.)139 3372 y(T)-7 b(o)26 b(read)g(in)h(the)g(comma)f (separated)g(data)g(\014le)h(in)g(Figure)f(2)g(where)g(alleles)g(are)g (separated)f(b)n(y)h(a)h(slash,)f(the)140 3472 y(follo)n(wing)h(\014le) g(command)h(w)n(ould)f(b)r(e)h(used:)37 b Fk(FILE)k([FS=",",GS="/"])d (id,mark1,mark2)140 3738 y Fe(5.1.1)94 b(Fixed)31 b(format)140 3941 y Fl(Occasionally)d(data)h(\014les)h(come)f(in)h(a)f(form)h(where) f(the)h(starting)f(and)g(ending)h(columns)g(of)f(eac)n(h)g(\014eld)h (are)140 4040 y(kno)n(wn,)h(but)h(there)e(migh)n(t)h(not)g(b)r(e)h(an)n (y)e(separator)f(b)r(et)n(w)n(een)h(\014elds.)47 b(F)-7 b(or)31 b(this)g(t)n(yp)r(e)g(of)g(data)g(the)g(format)140 4140 y(of)e(the)g(data\014le)g(m)n(ust)g(b)r(e)g(sp)r(eci\014ed)g(more) f(precisely)-7 b(.)40 b(F)-7 b(or)29 b(example,)g(consider)e(the)j (data\014le)e(in)h(Figure)g(3.)138 4240 y(This)c(data\014le)g(has)g(10) f(\014elds,)i(individual,)g(father,)g(mother,)f(sx,)h(age,)f(and)g(5)g (quan)n(titativ)n(e)f(measuremen)n(ts.)139 4339 y(The)i(last)g(5)g (\014elds)h(ha)n(v)n(e)e(no)h(in)n(terv)n(ening)f(spaces,)h(so)f(they)i (ha)n(v)n(e)e(to)h(b)r(e)h(read)e(in)i(\014xed)f(format.)36 b(This)27 b(could)140 4439 y(b)r(e)h(done)f(with)h(the)g(statemen)n(t:) 140 4655 y Fk(FILE)42 b([3\(5\),1x,1,3,5\(6)o(\)])37 b("filename",)140 4754 y(id,father,mother)o(,sx)o(,a)o(ge)o(,q1)o(,q)o (2,q)o(3,)o(q4,)o(q5)140 4970 y Fl(Note)e(that)g(long)f(commands)g(can) h(b)r(e)g(split)g(-)f(newlines)h(are)f(\(mostly\))h(ignored)f(b)n(y)h Fk(prep)p Fl(.)57 b(The)35 b(format)140 5070 y(clause)d(tells)i Fk(prep)d Fl(to)i(read)f(in)i(3)e(\014elds)i(of)f(5)f(c)n(haracters)f (eac)n(h,)j(skip)f(1)g(c)n(haracter,)f(read)g(in)i(1)e(\014eld)i(of)f (1)140 5169 y(c)n(haracter,)g(1)f(of)i(3)e(c)n(haracters,)h(and)g(5)f (of)i(6)e(c)n(haracters)f(eac)n(h.)53 b(An)34 b(empt)n(y)f(\014eld)g (is)h(treated)e(as)h(missing)140 5269 y(data.)1851 5962 y(7)p eop end %%Page: 8 8 TeXDict begin 8 7 bop 1467 289 a Fl(Figure)27 b(3:)37 b(T)-7 b(est)28 b(dataset)314 472 y Fk(1)174 b(0)g(0)43 b(1)h(80)314 571 y(2)174 b(0)g(0)43 b(2)h(77)314 671 y(3)174 b(0)g(0)43 b(1)h(64)314 771 y(4)174 b(0)g(0)43 b(2)h(63)314 870 y(6)174 b(0)g(0)43 b(1)h(67)314 970 y(8)174 b(0)g(0)43 b(1)h(56)227 1069 y(461)173 b(1)h(2)43 b(1)h(80)227 1169 y(462)173 b(1)h(2)43 b(2)h(80)227 1269 y(463)173 b(3)h(4)43 b(1)h(72)227 1368 y(464)173 b(3)h(4)43 b(2)h(63)227 1468 y(678)173 b(8)87 b(462)42 b(2)i(64)e(26.23)g (75.79143.66)d(42.77267.60)227 1568 y(679)173 b(6)87 b(464)42 b(1)i(53)227 1667 y(680)173 b(6)87 b(464)42 b(2)i(64)e(40.67)g(97.68157.29)d(45.94304.39)227 1767 y(681)173 b(6)87 b(464)42 b(1)i(58)e(31.98)g(77.29115.52)d(42.60197.15) 140 2099 y Fe(5.1.2)94 b(Skipping)31 b(lines)140 2302 y Fl(Normally)-7 b(,)38 b Fk(prep)d Fl(will)i(read)f(in)h(ev)n(ery)f (non-blank)g(line)h(in)g(the)g(data)f(\014le.)65 b(Sometimes,)39 b(ho)n(w)n(ev)n(er,)e(it)g(is)140 2402 y(desirable)f(that)h(some)f (lines)h(are)f(skipp)r(ed)h(at)f(the)i(top)e(of)h(the)g(data)g(\014le)g (\(for)f(example,)j(if)e(a)g(header)e(is)140 2501 y(presen)n(t\).)i (This)27 b(can)g(b)r(e)h(easily)f(done)g(using)h(the)g(FILE)f(command:) 140 2717 y Fk(FILE)42 b([skip=1])e("filename",id,fat)o(he)o(r,m)o(ot)o (he)o(r,s)o(x,)o(q1,)o(q2)140 2983 y Fe(5.1.3)94 b(F)-8 b(urther)32 b(pro)s(cessing)140 3186 y Fl(T)-7 b(o)31 b(facilitate)g(further)f(pro)r(cessing)g(of)h(the)g(data\014le)f(b)r (efore)h(it)g(is)g(read)f(in)n(to)h Fk(prep)p Fl(,)f(it)i(is)e(p)r (ossible)h(to)g(pip)r(e)140 3285 y(the)e(data\014le)f(through)g (external)f(programs)g(\(suc)n(h)h(as)g(sed,)g(a)n(wk,)g(or)g(p)r (erl\).)40 b(The)28 b(follo)n(wing)g(example)g(uses)140 3385 y(zcat)f(to)h(uncompress)e(the)i(data\014le)f(`on)h(the)g(\015y':) 140 3601 y Fk(FILE)42 b(SHELL\("zcat)d(filename.gz"\),x1)o(,x2)o(,x)o (3,)o(x4)140 3866 y Fe(5.1.4)94 b(Reading)31 b(in)g(genot)m(yp)s(e)g (data)140 4069 y Fl(.)43 b(Only)29 b(co)r(dominan)n(t)g(mark)n(ers)f (are)g(supp)r(orted)i(b)n(y)g Fk(prep)p Fl(.)42 b(Genot)n(yp)r(e)29 b(data)g(for)g(an)h(individual)f(normally)138 4169 y(consists)24 b(of)i(a)e(\014eld)i(for)f(eac)n(h)f(allele)h(\()p Fj(i.e.)p Fl(,)j(2)c(p)r(er)i(mark)n(er\),)e(ho)n(w)n(ev)n(er)f Fk(prep)h Fl(can)g(also)h(read)f(in)i(data)e(formats)137 4269 y(where)f(b)r(oth)i(alleles)e(are)g(in)h(a)g(single)f(\014eld.)36 b(In)24 b(a)g(giv)n(en)f(record,)g(1)h(or)f(b)r(oth)h(alleles)f(ma)n(y) h(b)r(e)g(missing.)35 b(Allele)137 4368 y(co)r(des,)24 b(as)f(with)i(all)e(iden)n(ti\014ers)h(in)g(Loki,)g(are)f(alpha-n)n (umeric)f(and)i(can)f(b)r(e)i(an)n(y)e(length.)36 b(Data)23 b(for)h(di\013eren)n(t)140 4468 y(mark)n(ers)k(\(and)i(ev)n(en)f(for)g (the)i(2)e(alleles)g(at)h(a)f(single)g(mark)n(er\))g(ma)n(y)g(b)r(e)h (in)g(separate)f(data\014les.)42 b(Genot)n(yp)r(e)140 4568 y(data)27 b(for)g(an)h(individual)f(can)g(b)r(e)h(duplicated;)g (suc)n(h)g(duplicated)g(records)d(are)i(c)n(hec)n(k)n(ed)f(for)i (consistency)-7 b(.)140 4850 y Fh(5.2)112 b(PEDIGREE)35 b(command)140 5053 y Fl(The)28 b(PEDIGREE)e(command)h(is)h(used)f(to)h (sp)r(ecify)f(whic)n(h)h(v)-5 b(ariables)26 b(con)n(tain)h(the)h(p)r (edigree)f(information.)139 5153 y(There)g(are)f(t)n(w)n(o)g(forms)g (for)h(the)g(command,)g(dep)r(ending)g(on)g(whether)g(id)g(co)r(des)f (are)g(unique)h(or)f(if)i(di\013eren)n(t)140 5252 y(families)f(ma)n(y)g (use)h(the)g(same)f(id)g(co)r(des)h(\()p Fj(i.e.)p Fl(,)h(the)f(format) f(used)h(b)n(y)f(the)h(LINKA)n(GE)f(pac)n(k)-5 b(age\).)35 b(Example)140 5352 y(PEDIGREE)26 b(commands)h(are)g(giv)n(en)g(b)r(elo) n(w:)140 5568 y Fk(PEDIGREE)40 b(id,father,mother)140 5667 y(PEDIGREE)g(family,id,father,)o(mo)o(the)o(r)1851 5962 y Fl(8)p eop end %%Page: 9 9 TeXDict begin 9 8 bop 140 231 a Fl(There)30 b Fj(must)37 b Fl(b)r(e)31 b(exactly)e(1)h(PEDIGREE)f(command)h(in)h(a)f(con)n(trol) f(\014le,)i(and)f(a)g(PEDIGREE)f(command)140 331 y Fj(must)39 b Fl(ha)n(v)n(e)31 b(3)g(or)g(4)h(v)-5 b(ariables)30 b(as)h(argumen)n(ts.)49 b(A)32 b(data)g(record)e(ma)n(y)h(ha)n(v)n(e)g (missing)g(father)h(and)g(mother)140 431 y(v)-5 b(alues,)30 b(but)g(m)n(ust)g(ha)n(v)n(e)f(a)g(v)-5 b(alid)30 b(id)g(record)e (\(and)i(a)f(family)h(record)e(if)j(used\).)43 b(An)30 b(individual's)g(p)r(edigree)140 530 y(record)d(ma)n(y)g(o)r(ccur)h(m)n (ultiple)g(times;)h(as)f(with)g(genot)n(yp)r(e)g(data,)g(if)g(this)h (happ)r(ens)f(the)h(duplicated)f(records)134 630 y(are)20 b(c)n(hec)n(k)n(ed)g(for)h(consistency)-7 b(.)34 b(When)22 b(a)e(family)i(record)d(is)i(presen)n(t,)h(whenev)n(er)e(the)i (original)d(ids)i(are)g(output)140 729 y(from)33 b Fk(prep)f Fl(or)g Fk(loki)p Fl(,)i(the)g(family)f(name)g(is)h(also)e(giv)n(en.)54 b(Ho)n(w)33 b(this)g(is)h(done)f(di\013ers)g(dep)r(ending)h(on)f(the) 140 829 y(con)n(text.)j(F)-7 b(or)27 b(example,)h(consider)e(the)i (follo)n(wing)f(p)r(edigree)g(\014le.)140 1037 y Fk(1)43 b(1)g(0)h(0)140 1137 y(1)f(2)g(0)h(0)140 1237 y(1)f(3)g(1)h(2)140 1336 y(1)f(4)g(1)h(2)140 1436 y(2)f(1)g(0)h(0)140 1536 y(2)f(2)g(0)h(0)140 1635 y(2)f(3)g(0)h(0)140 1735 y(2)f(4)g(2)h(3)140 1834 y(2)f(5)g(2)h(1)140 2043 y Fl(If)31 b(there)f(is)g(an)g(o)r (ccasion)f(to)i(output)f(an)h(isolated)e(id)i(\()p Fj(i.e.)p Fl(,)i(there)d(is)g(a)g(data)g(record)f(error)f(for)i(individual)140 2142 y(3)d(in)g(family)h(2\),)f(it)h(will)f(b)r(e)h(output)g(as)f Fk([2]:3)e Fl(with)j(the)g(family)f(name)g(in)h(square)e(brac)n(k)n (ets)g(b)r(efore)h(the)g(id)140 2242 y(co)r(de.)50 b(If,)34 b(ho)n(w)n(ev)n(er,)d(triplet)h(information)g(is)f(output)i(then)g (this)f(will)g(b)r(e)h(b)r(e)f(as)f(4)h(columns)g(-)g(family)-7 b(,)33 b(id,)140 2342 y(father,)27 b(mother.)140 2622 y Fh(5.3)112 b(SEX)37 b(command)140 2825 y Fl(The)i(SEX)g(command)f(is) h(used)f(to)h(sp)r(ecify)g(a)f(v)-5 b(ariable)38 b(that)h(indicates)g (the)g(sex)f(of)h(individuals.)70 b(The)132 2925 y(command)18 b(is)g(optional,)i(but)f(if)g(included)g(allo)n(ws)e(for)h(more)g (extensiv)n(e)g(p)r(edigree)g(c)n(hec)n(king.)32 b(If)19 b(this)g(command)138 3025 y(is)26 b(used)g(then)g(information)f(on)g (sex)g(m)n(ust)h(b)r(e)g(a)n(v)-5 b(ailable)25 b(for)g(all)g(p)r (edigree)h(mem)n(b)r(ers)f(\(note)h(that)g(the)g(sex)f(of)140 3124 y(paren)n(ts)i(can)g(b)r(e)h(inferred)f(from)g(the)h(p)r (edigree\).)37 b(Examples)26 b(of)i(this)g(command)f(app)r(ear)g(b)r (elo)n(w:)140 3333 y Fk(SEX)42 b(sx)h(1,2)140 3432 y(SEX)f(sx)h (``M'',''F'')140 3641 y Fl(The)29 b(last)g(t)n(w)n(o)g(en)n(tries)g(on) g(the)g(line)h(giv)n(e)e(the)i(factor)f(v)-5 b(alues)29 b(for)f(males)h(and)g(females)g(resp)r(ectiv)n(ely)-7 b(.)42 b(Only)140 3740 y(1)27 b(SEX)h(command)f(can)g(app)r(ear)g(in)h (a)f(con)n(trol)f(\014le.)140 4021 y Fh(5.4)112 b(GR)m(OUP)37 b(command)140 4224 y Fl(The)f(GR)n(OUP)e(command)i(is)f(used)g(to)h(sp) r(ecify)g(a)f(v)-5 b(ariable)34 b(that)i(indicates)f(whic)n(h)h (genetic)f(group)f(eac)n(h)140 4324 y(founder)40 b(b)r(elongs)f(to,)k (see)d(also)f(Section)h(6.11.)73 b(Di\013eren)n(t)41 b(genetic)e(groups)g(can)h(ha)n(v)n(e)f(di\013eren)n(t)h(allele)140 4423 y(frequencies.)58 b(This)34 b(is)h(therefore)f(in)n(tended)h(for)f (situations)g(where)g(it)h(is)g(kno)n(wn)f(that)h(certain)f(founders) 140 4523 y(come)k(from)g(di\013eren)n(t)h(p)r(opulations.)69 b(If)39 b(this)g(option)f(is)g(sp)r(eci\014ed)h(then)g(ev)n(ery)f (founder)g(m)n(ust)g(ha)n(v)n(e)g(a)140 4622 y(record)28 b(for)h(the)h(group)e(factor.)42 b(If)29 b(non-founders)g(are)f(giv)n (en)h(a)g(group)f(designation)h(then)g(this)h(is)f(ignored.)140 4722 y(Only)e(1)g(GR)n(OUP)g(command)h(can)f(app)r(ear)g(in)g(a)h(con)n (trol)e(\014le.)37 b(The)28 b(format)f(of)g(the)h(command)f(is)h (simply:)140 4930 y Fk(GROUP)42 b(gen_group)140 5211 y Fh(5.5)112 b(MISSING)38 b(command)140 5414 y Fl(In)33 b(the)h(example)f(data\014les)f(ab)r(o)n(v)n(e,)h(`0')g(has)g(b)r(een)g (used)h(\(as)e(is)h(common\))g(to)g(mean)g(a)g(missing)g(ID)g(\()p Fj(i.e.)p Fl(,)140 5514 y(founder)h(individuals)f(ha)n(v)n(e)g(no)g (paren)n(ts)g(in)h(the)g(data\014le,)h(so)e(their)h(paren)n(ts)f(IDs)h (are)e(giv)n(en)h(as)g(0.)55 b(This)139 5613 y(ma)n(y)26 b(not)g(alw)n(a)n(ys)f(b)r(e)i(true,)g(or)e(di\013eren)n(t)i(missing)f (co)r(des)g(ma)n(y)g(b)r(e)h(used)f(for)g(di\013eren)n(t)h(v)-5 b(ariables.)35 b(Previous)137 5713 y(v)n(ersions)23 b(of)31 b Fk(prep)23 b Fl(used)h(no)g(default)h(missing)f(co)r(de,)h(and)f (only)g(treated)g(blank)h(\014elds)f(as)g(missing.)35 b(V)-7 b(ersions)1851 5962 y(9)p eop end %%Page: 10 10 TeXDict begin 10 9 bop 140 231 a Fl(after)34 b(2.4.5)f(ha)n(v)n(e)g(a)h (default)h(where)f(`0')g(is)g(the)h(missing)e(co)r(de)i(for)e(all)h (categorical)f(v)-5 b(ariables)33 b(\(p)r(edigree,)136 331 y(genot)n(yp)r(e)21 b(and)i(other)f(discrete)g(v)-5 b(ariables\).)34 b(This)23 b(will)g(b)r(e)g(o)n(v)n(erridden)e(if)i(an) n(y)f(Missing)g(command)g(is)g(found.)140 431 y(T)-7 b(o)27 b(rev)n(ert)g(to)g(the)h(previous)e(b)r(eha)n(viour)h(with)h(no) f(default)h(Missing)f(co)r(des,)h(see)f(5.20.)140 580 y(Examples)g(of)g(v)-5 b(alid)28 b(Missing)f(commands)g(are)f(sho)n(wn) h(b)r(elo)n(w:)140 777 y Fk(MISSING)41 b("0")140 877 y(MISSING)g("*",x,y)140 976 y(MISSING)g(["PG"])g("0")140 1076 y(MISSING)g(["R"])g(-99)140 1273 y Fl(The)29 b(\014rst)f(example)g (tells)h Fk(prep)e Fl(that)h(`0')h(should)f(b)r(e)h(treated)f(as)g(a)g (missing)g(v)-5 b(alue)29 b(for)f(all)g(v)-5 b(ariables.)38 b(The)140 1373 y(second)28 b(example)f(states)h(that,)h(in)f(addition,) h(`*')e(should)h(b)r(e)h(treated)f(as)f(a)h(missing)g(v)-5 b(alue)28 b(for)g(v)-5 b(ariables)26 b(x)140 1472 y(and)32 b(y)-7 b(.)50 b(If)32 b(the)h(missing)e(v)-5 b(alue)32 b(is)g(not)g(in)g(quotes)f(then)i(a)e(n)n(umeric)h(comparison)e(will)i (b)r(e)h(made)e(b)r(et)n(w)n(een)138 1572 y(the)25 b(missing)f(v)-5 b(alue)25 b(and)f(the)i(input)f(data,)g(otherwise)f(a)h(string)f (comparison)f(will)i(b)r(e)g(made.)36 b(An)25 b(exception)138 1672 y(to)g(this)h(is)f(that)h(a)f(n)n(umeric)g(comparison)e(will)j (alw)n(a)n(ys)d(b)r(e)j(used)f(for)g(v)-5 b(ariables)24 b(whic)n(h)h(ha)n(v)n(e)f(b)r(een)i(explicitly)139 1771 y(declared)f(to)h(b)r(e)h(n)n(umeric)f(\(using)g(the)h(INTEGER)f(or)f (REAL)h(commands\).)37 b(Note)26 b(that)g(when)h(comparing)140 1871 y(t)n(w)n(o)37 b(real)h(v)-5 b(alued)38 b(v)-5 b(ariables,)39 b(a)f(matc)n(h)g(is)g(declared)f(if)i(the)g(absolute)e(di\013erence)h (is)g(<1.0e-12,)h(to)f(a)n(v)n(oid)140 1971 y(rounding)27 b(problems.)137 2120 y(The)e(third)g(and)f(fourth)h(examples)f(state)h (that)g(`0')f(should)g(b)r(e)i(used)e(as)g(a)g(missing)h(v)-5 b(alues)24 b(for)g(p)r(edigree)g(and)138 2220 y(genot)n(yp)r(e)h(v)-5 b(ariables,)24 b(and)h(`-99')g(should)g(b)r(e)h(used)f(for)g(real)f(v) -5 b(alued)26 b(v)-5 b(ariables.)35 b(F)-7 b(or)24 b(this)i(later)f (forms)g(of)g(the)140 2319 y(missing)i(commands,)g(the)h(p)r(ossible)f (letter)h(co)r(des)f(are:)265 2516 y Fd(\017)41 b Fl(P)27 b(-)g(P)n(edigree)f(v)-5 b(ariables)265 2673 y Fd(\017)41 b Fl(G)27 b(-)h(Genot)n(yp)r(e)f(v)-5 b(ariables)265 2830 y Fd(\017)41 b Fl(F)27 b(-)h(F)-7 b(actors)26 b(\(discrete)i(v)-5 b(ariables)26 b(-)h(includes)h(P)f(and)h(G\))265 2986 y Fd(\017)41 b Fl(R)27 b(-)h(Real)f(v)-5 b(ariables)265 3143 y Fd(\017)41 b Fl(C)27 b(-)h(Con)n(tinous)e(v)-5 b(ariables)27 b(\(same)g(as)g(R\))265 3300 y Fd(\017)41 b Fl(I)27 b(-)h(In)n(teger)e(v)-5 b(ariables)137 3497 y(Eac)n(h)23 b(letter)h(co)r(de)f(can)h(b)r(e)g(preceded)g(b)n(y)g(a)f (`!')36 b(c)n(haracter)22 b(to)i(indicate)g(a)g(negation)f(\()p Fj(i.e.)p Fl(,)k("!P")22 b(w)n(ould)i(mean)140 3596 y(ev)n(erything)30 b Fj(ap)l(art)k(fr)l(om)k Fl(p)r(edigree)30 b(v)-5 b(ariables\).)47 b(The)31 b(default)h(Missing)e(rule)h(\(whic)n(h)h(will)f(not)g(b)r(e)h (used)f(if)140 3696 y(an)n(y)c(explicit)h(Missing)f(rule)g(is)h (found\))g(is:)140 3893 y Fk(MISSING)41 b(["F"])g("0")140 4090 y Fl(Note)28 b(that)g(m)n(ultiple)g(Missing)f(commands)g(can)g(b)r (e)h(giv)n(en,)f(in)h(whic)n(h)f(case)g(the)h(results)f(are)g(cum)n (ulativ)n(e.)140 4369 y Fh(5.6)112 b(MARKER)36 b(LOCUS)i(command)138 4572 y Fl(If)25 b(the)h(t)n(w)n(o)e(alleles)h(for)f(a)h(mark)n(er)f(o)r (ccur)g(in)h(separate)f(\014elds)h(\(as)g(is)g(the)h(defaults\))f(then) h(eac)n(h)e(mark)n(er)g(lo)r(cus)140 4671 y(needs)29 b(to)g(b)r(e)h(link)n(ed)f(with)h(the)f(2)g(v)-5 b(ariables)28 b(con)n(taining)g(the)i(allele)f(information)f(for)h(that)h(lo)r(cus.) 41 b(This)29 b(is)140 4771 y(done)e(using)h(the)g(MARKER)f(LOCUS)g (command,)h(as)f(in)g(the)h(examples)f(b)r(elo)n(w:)140 4968 y Fk(MARKER)41 b(LOCUS)h(D1G1[all_1a,all)o(_1b)o(])140 5068 y(MARKER)f(LOCUS)h(D1G2[all_2a,all)o(_2b)o(],)37 b(D1G3[all_3a,all_)o(3b)o(])140 5265 y Fl(A)32 b(giv)n(en)e(mark)n(er)g (can)h(not)g(o)r(ccur)g(m)n(ultiple)h(times)g(in)f(MARKER)g(LOCUS)h (statemen)n(ts;)h(in)e(addition,)i(a)140 5364 y(giv)n(en)27 b(allele)g(v)-5 b(ariable)27 b(can)g(only)g(b)r(e)h(used)f(once.)139 5514 y(If)f(b)r(oth)h(alleles)e(o)r(ccur)h(in)g(a)g(single)g(data)f (\014eld)i(then)g(this)f(linking)g(to)g(the)h(allele)e(v)-5 b(ariables)25 b(is)h(not)h(required,)140 5613 y(but)37 b(it)f(is)g(still)g(necessary)e(to)i(use)g(the)g(Mark)n(er)e(Lo)r(cus)h (command)h(to)g(iden)n(tify)g(the)g(v)-5 b(ariables)35 b(as)g(b)r(eing)140 5713 y(mark)n(ers:)1831 5962 y(10)p eop end %%Page: 11 11 TeXDict begin 11 10 bop 140 231 a Fk(MARKER)41 b(LOCUS)h(D1G1)140 331 y(MARKER)f(LOCUS)h(D1G2,D1G3)140 613 y Fh(5.7)112 b(LINK)37 b(command)140 816 y Fl(This)29 b(command)g(describ)r(es)f (the)h(grouping)f(of)h(mark)n(ers)e(in)n(to)h(link)-5 b(age)29 b(groups.)39 b(A)30 b(mark)n(er)d Fj(must)36 b Fl(o)r(ccur)28 b(in)139 916 y(a)e(LINK)h(statemen)n(t)f(to)h(b)r(e)g (included)g(in)g(the)g(analysis.)35 b(Con)n(v)n(ersely)-7 b(,)25 b(selectiv)n(ely)h(commen)n(ting)g(out)g(LINK)140 1015 y(statemen)n(ts)34 b(is)f(an)h(e\013ectiv)n(e)g(w)n(a)n(y)e(of)i (selecting)f(whic)n(h)h(mark)n(ers)e(to)i(run)f(in)h(an)g(analysis.)54 b(Eac)n(h)33 b(link)-5 b(age)140 1115 y(group)26 b(m)n(ust)h(b)r(e)g (giv)n(en)g(a)g(unique)g(name)g(whic)n(h)g(allo)n(ws)f(it)h(to)g(b)r(e) h(iden)n(ti\014ed.)37 b(A)28 b(mark)n(er)d(can)i(not)g(o)r(ccur)f(in) 140 1215 y(m)n(ultiple)i(link)-5 b(age)27 b(groups.)36 b(An)28 b(example)f(LINK)g(command)h(is)f(giv)n(en)g(b)r(elo)n(w:)140 1431 y Fk(LINK)42 b("chromosome)d(1",D1G1,D1G2,D1G)o(3,D)o(1G)o(4,)o (D1G)o(5)140 1713 y Fh(5.8)112 b(TRAIT)37 b(LOCUS)h(command)140 1916 y Fl(This)e(command)g(is)g(used)h(to)f(assign)f(a)h(name)g(to)g (the)g(trait)g(lo)r(cus)g(so)g(that)h(it)f(can)g(b)r(e)h(sp)r (eci\014ed)f(in)h(the)139 2016 y(MODEL)25 b(command.)36 b(Note)26 b(that)h(y)n(ou)e(only)h(should)f(sp)r(ecify)i(1)e(trait)h (lo)r(cus;)g(the)h(n)n(um)n(b)r(er)f(of)g(trait)f(lo)r(ci)h(\(or)140 2115 y(the)34 b(range)e(of)i(n)n(um)n(b)r(ers)f(of)g(trait)h(lo)r(ci\)) g(is)f(sp)r(eci\014ed)h(in)g(the)g(con)n(trol)e(\014le)i(for)f Fk(loki)p Fl(.)53 b(The)34 b(command)f(for)140 2215 y(declaring)26 b(a)i(trait)f(lo)r(cus)g(called)g(QTL)h(w)n(ould)f(b)r(e:)140 2431 y Fk(TRAIT)42 b(LOCUS)f(QTL)140 2713 y Fh(5.9)112 b(MODEL)38 b(command)140 2916 y Fl(This)28 b(is)g(where)g(the)h(trait)f (mo)r(del)g(is)g(sp)r(eci\014ed)h(\(note)f(a)g(linear)g(regression)d (mo)r(del)k(is)f(assumed,)g(and)g(traits)140 3016 y(ha)n(v)n(e)e(to)i (b)r(e)g(con)n(tin)n(uous\).)36 b(Examples)27 b(of)g(MODEL)g(commands)g (follo)n(w:)140 3231 y Fk(MODEL)42 b(y=QTL)140 3331 y(MODEL)g (y=age+sx+QTL)140 3431 y(MODEL)g(q=sx+QTL)140 3646 y Fl(In)33 b(these)h(examples,)g(QTL)e(refers)h(to)g(a)g(trait)g(lo)r (cus)f(and)i(is)f(declared)f(as)h(suc)n(h)f(elsewhere)h(in)g(a)g(TRAIT) 140 3746 y(LOCUS)28 b(statemen)n(t.)36 b(It)28 b(is)g(not)f(necessary)f (to)i(include)g(a)f(trait)g(lo)r(cus)h(in)f(the)h(mo)r(del.)140 4012 y Fe(5.9.1)94 b(Fitting)31 b(genetic)g(co)m(v)-5 b(ariates/candidate)33 b(lo)s(ci)140 4215 y Fl(It)g(is)f(p)r(ossible)g (to)h(\014t)f(individual)h(mark)n(er)e(lo)r(ci)h(as)g(genetic)g(co)n(v) -5 b(ariates.)49 b(In)33 b(this)g(case,)g(an)f(e\013ect)h(of)f(eac)n(h) 140 4314 y(genot)n(yp)r(e)37 b(at)g(the)h(mark)n(er)e(lo)r(cus)i(is)f (estimated.)67 b(F)-7 b(or)37 b(this)h(reason)e(this)i(option)g(is)f (not)h(recommended)140 4414 y(with)33 b(lo)r(ci)f(that)h(ha)n(v)n(e)e (more)g(than)i(3-4)e(alleles.)50 b(Missing)32 b(genot)n(yp)r(e)f(data)h (is)g(sampled)g(as)g(for)g(other)f(lo)r(ci,)140 4514 y(conditional)c(on)g(the)h(p)r(edigree)f(structure,)g(neigh)n(b)r (ouring)g(lo)r(ci,)g(and)h(the)g(trait)f(data.)140 4779 y Fe(5.9.2)94 b(Fitting)31 b(a)h(p)s(olygenic)f(random)h(e\013ect)140 4982 y Fl(A)c(individual)h(animal)e(p)r(olygenic)h(e\013ect)g(can)g(b)n (y)g(\014tted)h(b)n(y)e(including)i(the)f(individual)g(id)h(v)-5 b(ariable)27 b(in)h(the)140 5082 y(mo)r(del.)37 b(F)-7 b(or)27 b(example:)140 5298 y Fk(PEDIGREE)40 b(id,father,mother)140 5397 y(MODEL)i(y=id+age)140 5497 y(MODEL)g(y=id+age+QTL)1831 5962 y Fl(11)p eop end %%Page: 12 12 TeXDict begin 12 11 bop 140 231 a Fl(Note)30 b(that)g(mixed)g (inheritance)f(mo)r(dels)h(with)g(b)r(oth)h(p)r(olygenic)e(and)g(QTL)h (can)f(b)r(e)h(\014tted)h(\(2nd)f(example)140 331 y(ab)r(o)n(v)n(e\).) 65 b(In)37 b(man)n(y)g(cases)f(there)h(is)h(not)f(a)g(lot)g(of)g (information)g(distinguishing)g(a)g(ma)5 b(jor)36 b(gene)h(from)g(a)140 431 y(p)r(olygenic)e(e\013ect,)i(and)e(there)g(can)g(b)r(e)h(strong)e (negativ)n(e)g(correlation)f(b)r(et)n(w)n(een)i(the)h(p)r(olygenic)f (additiv)n(e)137 530 y(genetic)25 b(v)-5 b(ariance)23 b(and)h(the)h(v)-5 b(ariance)24 b(due)h(to)f(a)g(QTL.)g(Using)h(the)g (other)f(p)r(edigree)g(v)-5 b(ariables)23 b(in)i(the)g(mo)r(del)140 630 y(statemen)n(t)j(instead)f(of)h(the)g(id)f(has)g(unde\014ned)i (e\013ects.)140 912 y Fh(5.10)112 b(LOG)38 b(command)139 1115 y Fl(A)28 b(rep)r(ort)e(from)g Fk(prep)f Fl(is)i(written)g(out)g (to)g(the)g(log\014le,)f(if)i(sp)r(eci\014ed)f(in)g(a)f(LOG)h(command,) f(or)g(to)h(standard)140 1215 y(output)33 b(otherwise.)52 b(The)32 b(format)g(for)h(this)g(command)f(is)h(simply)f(LOG)h ("\014lename".)51 b(A)33 b(new)g(log)f(\014le)g(is)137 1314 y(started)24 b(with)h(eac)n(h)f(run)h(of)31 b Fk(prep)p Fl(,)23 b(so)h(if)i(the)e(old)h(log\014le)f(exists)g(it)h(is)f(renamed) g(to)h(the)g(original)e(\014lename)p Fk(+~)p Fl(.)140 1597 y Fh(5.11)112 b(DISCRETE)36 b(command)140 1800 y Fl(This)e(command)g(sp)r(eci\014es)g(that)g(certain)f(v)-5 b(ariables)33 b(are)g(to)h(b)r(e)g(treated)g(as)f(discrete)h(lev)n(els) f(rather)g(than)140 1899 y(con)n(tin)n(uous)27 b(data.)39 b(Note)29 b(that)f(p)r(edigree)g(v)-5 b(ariables)27 b(\(those)i (declared)e(in)i(a)f(PEDIGREE)f(command\))i(and)137 1999 y(mark)n(er)23 b(allele)h(v)-5 b(ariables)23 b(are)h(automatically)f (declared)h(as)g(discrete,)h(as)e(is)i(an)n(y)f(alpha-n)n(umeric)f (data.)35 b(The)140 2099 y(format)27 b(for)g(the)h(command)f(is)h (DISCRETE)f(v)-5 b(ar)1717 2111 y Fg(1)1754 2099 y Fl(,v)g(ar)1891 2111 y Fg(2)1927 2099 y Fl(,.)14 b(.)g(.)g(,v)-5 b(ar)2198 2111 y Ff(n)2242 2099 y Fl(.)140 2381 y Fh(5.12)112 b(REAL)37 b(and)h(INTEGER)e(commands)140 2584 y Fl(Numeric)30 b(data)g(is)g (assumed)f(to)h(b)r(e)g(real)f(unless)h(it)h(is)f(declared)f(in)n (teger)g(with)h(an)g(INTEGER)g(command.)140 2683 y(These)d(commands)g (allo)n(w)h Fk(prep)e Fl(to)h(c)n(hec)n(k)g(the)h(t)n(yp)r(e)g(of)g (the)g(data,)f(and)g(giv)n(e)g(errors)e(if)j(the)g(wrong)f(t)n(yp)r(e)g (of)140 2783 y(data)g(is)h(found.)37 b(The)27 b(format)h(is)f(the)h (same)f(as)g(for)g(the)h(DISCRETE)f(command.)140 3065 y Fh(5.13)112 b(MUL)-9 b(TIPLE)37 b(and)i(CONST)-9 b(ANT)36 b(commands)134 3268 y Fl(P)n(edigree)19 b(v)-5 b(ariables)19 b(and)i(genot)n(yp)r(e)f(data)g(are)g(automatically)f(declared)h(to)h (b)r(e)g(constan)n(t,)g Fj(i.e.)p Fl(,)j(they)d(can)g(not)138 3368 y(c)n(hange)k(for)g(a)g(giv)n(en)g(individual.)36 b(By)25 b(default,)i(all)e(other)g(v)-5 b(ariables)25 b(are)f(also)h(declared)f(constan)n(t,)i(but)g(this)135 3468 y(can)c(b)r(e)h(o)n(v)n(er-ridden)d(for)i(sets)g(of)g(v)-5 b(ariables)21 b(using)h(the)h(MUL)-7 b(TIPLE)21 b(command.)35 b(T)-7 b(o)22 b(set)g(the)h(default)g(for)e(all)140 3567 y(non-p)r(edigree)28 b(and)h(genot)n(yp)r(e)f(data)h(to)g(b)r(e)h(MUL) -7 b(TIPLE,)28 b(set)h(the)h(system)f(v)-5 b(ariable)28 b(m)n(ultiple)p 3217 3567 25 4 v 30 w(records)f(to)139 3667 y(1)f(\(with)h(the)f(command)g(SET)g(m)n(ultiple)p 1436 3667 V 30 w(records)f(1)h(5.20\).)35 b(In)27 b(this)f(case,)g(the) h(default)f(can)g(b)r(e)h(o)n(v)n(er-ridden)140 3766 y(using)35 b(the)g(CONST)-7 b(ANT)35 b(command.)59 b(The)35 b(format)f(for)g(b)r(oth)i(command)e(are)g(as)g(for)g(the)i(DISCRETE) 140 3866 y(command.)140 4016 y(If)49 b(m)n(ultiple)g(records)e(are)g (presen)n(t)h(for)g(an)g(individual,)54 b(then)48 b(constan)n(t)g(v)-5 b(ariables)47 b(are)h(c)n(hec)n(k)n(ed)f(for)135 4115 y(consistency)22 b(across)e(records.)33 b(More)22 b(imp)r(ortan)n(tly) -7 b(,)23 b(if)f(there)g(are)g(m)n(ultiple)g(observ)-5 b(ations)21 b(on)h(an)g(individual,)137 4215 y(a)i(co)n(v)-5 b(ariate)22 b(declared)i(constan)n(t)f(will)i(apply)e(to)i(all)f (observ)-5 b(ations)22 b(on)i(that)h(individual,)g(without)f(ha)n(ving) g(to)137 4314 y(app)r(ear)g(in)h(ev)n(ery)e(record.)35 b(This)24 b(allo)n(ws)g(a)g(logical)f(record)g(on)i(an)f(individual)h (to)f(b)r(e)h(created)f(from)g(m)n(ultiple)140 4414 y(ph)n(ysical)j (records)f(in)h(di\013eren)n(t)h(\014les.)138 4563 y(F)-7 b(or)24 b(v)-5 b(ariables)23 b(declared)h(as)g(m)n(ultiple,)j(ho)n(w)n (ev)n(er,)c(v)-5 b(ariables)23 b(ha)n(v)n(e)h(to)h(o)r(ccur)f(in)h(the) g(same)g(input)g(line)g(in)g(the)136 4663 y(same)e(data\014le)f(to)i(b) r(e)f(regarded)e(as)i(o)r(ccurring)f(in)h(the)h(same)e(logical)g (record.)34 b(This)23 b(means)g(that)h(if)f(there)g(are)138 4763 y(2)h(data\014les,)h(eac)n(h)f(with)i(a)e(di\013eren)n(t)i (sub-set)e(of)h(v)-5 b(ariables,)24 b(if)i(the)f(v)-5 b(ariables)24 b(are)g(declared)g(as)g(MUL)-7 b(TIPLE)140 4862 y(then)29 b Fj(every)j(r)l(e)l(c)l(or)l(d)f(wil)t(l)h(app)l(e)l (ar)g(to)f(b)l(e)g(inc)l(omplete,)h(and)f(may)h(b)l(e)e(disc)l(ar)l(de) l(d)j(by)e(L)l(oki)p Fl(.)41 b(The)29 b(MUL)-7 b(TIPLE)140 4962 y(command)27 b(should)h(therefore)e(b)r(e)i(used)g(with)g(care.) 140 5111 y(\(n.b.,)j(the)e(default)h(b)r(eha)n(viour)e(of)i(Loki)e (prior)h(to)g(v)n(ersion)f(2.4.2)p 2232 5111 V 28 w(3)h(w)n(as)g(that)g (all)g(non-p)r(edigree)g(and)g(non-)135 5211 y(genot)n(yp)r(e)22 b(data)f(w)n(as)g(declared)h(MUL)-7 b(TIPLE.)21 b(This)h(led)h(to)f (some)f(confusion)h(so)g(the)g(default)h(w)n(as)e(c)n(hanged\).)1831 5962 y(12)p eop end %%Page: 13 13 TeXDict begin 13 12 bop 140 231 a Fh(5.14)112 b(FIL)-9 b(TER)37 b(command)140 434 y Fl(A)f(n)n(um)n(b)r(er)f(of)g(\014les)g (are)f(created)g(b)n(y)i Fk(prep)e Fl(for)h Fk(loki)e Fl(to)i(read)g(in.)60 b(Some)35 b(of)g(these)g(\014les)g(can)g(b)r(e)h (large,)140 534 y(particularly)28 b(when)h(man)n(y)f(mark)n(er)g(lo)r (ci)h(are)f(b)r(eing)h(analyzed.)41 b(It)29 b(is)g(p)r(ossible)g(to)g (instruct)g Fk(prep)e Fl(to)i(\014lter)139 634 y(the)f(\014les)f (through)f(an)h(external)f(command)h(b)r(efore)f(sa)n(ving)g(them.)37 b(The)27 b(main)g(\(only?\))37 b(use)27 b(of)g(this)g(w)n(ould)140 733 y(b)r(e)j(to)f(\014lter)g(the)h(\014les)f(through)f(a)h (compression)f(program)f(suc)n(h)i(as)f Fk(gzip)g Fl(or)g Fk(compress)p Fl(.)39 b(An)30 b(example)e(of)140 833 y(this)g(is)f(giv)n(en)g(b)r(elo)n(w:)140 1049 y Fk(FILTER)41 b("gzip")140 1265 y Fl(Use)28 b(of)f(this)h(command)f(with)h(programs)e (other)h(than)g Fk(gzip)p Fl(,)f Fk(compress)f Fl(or)i Fk(bzip2)e Fl(is)j(not)f(supp)r(orted.)140 1547 y Fh(5.15)112 b(USE)38 b(WHERE)d(command)140 1750 y Fl(This)d(command)g(allo)n(ws)f (for)h(the)h(selection)e(of)i(a)f(subset)g(of)g(data)g(where)g(a)g (particular)f(condition)h(holds.)140 1850 y(Tw)n(o)27 b(examples)g(are)f(giv)n(en)h(b)r(elo)n(w:)140 2065 y Fk(USE)42 b(all_1a,all_1b)d(WHERE\(y\);)140 2165 y(USE)j(all_1a,all_1b) d(WHERE\(y<40)g(and)j(sex="M")f(and)h(\(\(x-y\)>20)e(or)j (\(z-y\)<0\)\);)140 2381 y Fl(The)36 b(\014rst)g(example)g(restricts)f (all)p 1254 2381 25 4 v 30 w(1a)g(and)h(all)p 1661 2381 V 30 w(1b)g(to)g(where)f(y)h(is)h(not)f(missing.)62 b(The)36 b(second)g(example)140 2480 y(sho)n(ws)j(that)h(more)g(complex)f (expressions)g(are)g(p)r(ossible.)74 b(Note)40 b(that)g(a)g(sub)r (expression)f(con)n(taining)g(a)138 2580 y(missing)25 b(v)-5 b(ariable)25 b(ev)-5 b(aluates)25 b(to)g(false.)36 b(Multiple)27 b(USE)e(WHERE)h(commands)f(can)g(o)r(ccur,)g(with)h(eac)n (h)f(new)140 2680 y(command)i(acting)g(on)h(the)g(subset)f(of)h(data)f (left)h(after)f(the)h(previous)f(command.)140 2962 y Fh(5.16)112 b(CENSORED)36 b(command)140 3165 y Fl(Loki)f(curren)n(tly)g (has)h(limited)h(supp)r(ort)e(for)h(analysis)e(of)i(censored)f(data)h (\(suc)n(h)g(as)f(age)g(of)h(onset)f(data\).)138 3265 y(The)25 b(format)g(is)g(similar)f(to)h(the)h(USE)f(WHERE)g(command,)g (with)h(the)f(WHERE)g(expression)f(determining)140 3364 y(when)k(a)f(v)-5 b(ariable)27 b(has)g(b)r(een)h(censored.)35 b(F)-7 b(or)27 b(example:)140 3580 y Fk(CENSORED)40 b(age)j(WHERE)e (\(affected="1"\))140 3796 y Fl(w)n(ould)32 b(mark)f(age)g(as)h(a)g (censored)f(v)-5 b(ariable)31 b(when)h(the)h(a\013ected)f(co)r(de)h(w)n (as)e(equal)g(to)i("1".)49 b(Note)32 b(that)h(if)138 3896 y(a\013ected)25 b(has)f(b)r(een)h(declared)f(as)g(a)h(n)n(umeric)f (t)n(yp)r(e)h(\(INTEGER)g(or)f(REAL\),)h(then)g(the)g(quotes)g(around)e (the)140 3995 y(1)k(should)h(b)r(e)g(omitted.)140 4277 y Fh(5.17)112 b(AFFECTED)37 b(command)140 4481 y Fl(Loki)c(also)f(has)g (limited)i(supp)r(ort)f(for)g(a\013ected)g(only)g(analysis)f(using)h (an)f(IBD)i(sharing)e(approac)n(h.)51 b(This)137 4580 y(required)24 b(iden)n(ti\014cation)g(of)g(a\013ected)h(individuals,)g (whic)n(h)f(is)g(done)g(in)h(a)f(similar)g(w)n(a)n(y)f(to)h(the)h (CENSORED)140 4680 y(command,)i(for)g(example:)140 4896 y Fk(AFFECTED)40 b(WHERE)i(\(affected="1"\))132 5111 y Fl(Note)19 b(that)g(curren)n(tly)f(this)h(only)g(has)f(an)h(a\013ect) g(with)g(IBD)g(sharing)f(analyses,)h(not)g(the)g(parametric)f (analyses.)140 5394 y Fh(5.18)112 b(RANDOM)37 b(command)140 5597 y Fl(Loki)p 306 5597 V 29 w(2.4)28 b(has)f(supp)r(ort)h(for)g (\014tting)h(uncorrelated)e(random)g(e\013ects)h(to)g(the)h(mo)r(del.) 39 b(The)28 b(e\013ect)h(should)f(b)r(e)140 5696 y(a)f(discrete)g (factor,)g(and)h(is)f(declared)g(using)g(the)h(RANDOM)g(command:)1831 5962 y(13)p eop end %%Page: 14 14 TeXDict begin 14 13 bop 140 231 a Fk(RANDOM)41 b(litter)140 331 y(MODEL)h(y=litter+age)140 541 y Fl(It)28 b(is)g(not)g(necessary)e (to)i(apply)g(the)g(DISCRETE)g(command)g(to)f(tell)i(Loki)e(the)i (e\013ect)f(is)g(discrete)f(-)h(this)g(is)140 641 y(done)f (automatically)-7 b(.)35 b(This)28 b(command)e(should)h Fj(not)35 b Fl(b)r(e)28 b(used)f(for)g(p)r(olygenic)f(random)h (e\013ects.)37 b(These)27 b(are)140 741 y(\014tted)h(simply)g(b)n(y)f (adding)h(the)f(id)h(v)-5 b(ariable)27 b(to)g(the)h(mo)r(del)g (statemen)n(t)g(\(Section)g(5.9.2\).)140 1022 y Fh(5.19)112 b(OUTPUT)38 b(command)134 1225 y Fk(prep)19 b Fl(has)h(the)i(option)e (of)h(outputting)g(the)g(\014nal)g(p)r(edigree)f(it)i(is)e(w)n(orking)f (with)j(after)e(pruning)h(and)f(reco)r(ding.)137 1324 y(This)k(can)g(o)r(ccasionally)e(b)r(e)j(useful,)g(though)f(the)h (output)f(\014le)h(is)f(not)g(directly)g(used)g(b)n(y)h Fk(loki)p Fl(.)34 b(This)25 b(is)f(done)140 1424 y(b)n(y)-7 b(,)27 b(for)h(example:)140 1634 y Fk(OUTPUT)41 b("output.dat")139 1844 y Fl(The)26 b(format)f(of)h(the)h(output)f(\014le)h(is)f(curren)n (tly:)35 b(col)25 b(1:)36 b(Comp)r(onen)n(t)26 b(n)n(um)n(b)r(er)g(col) f(2,3,4:)35 b(original)25 b(id)h(co)r(des)137 1944 y(for)e(individual,) h(father,)g(mother)e(col)h(5:)35 b(sex)24 b(col)f(7,8,9:)34 b(in)n(ternal)24 b(id)g(co)r(des)g(for)g(individual,)h(father,)g (mother)140 2044 y(col)30 b(10:)41 b(a\013ected)30 b(status)g(\(if)h (AFFECTED)f(command)f(used\).)45 b(Note)30 b(that)h(this)f(is)g(sub)5 b(ject)30 b(to)g(c)n(hange)f(in)140 2143 y(later)e(v)n(ersions.)140 2424 y Fh(5.20)112 b(SET)37 b(command)140 2627 y Fl(There)32 b(are)f(a)h(n)n(um)n(b)r(er)f(of)i(options)e(for)h Fk(prep)e Fl(whic)n(h)j(can)e(b)r(e)i(set)f(in)h(the)f(con)n(trol)f(\014le)h (whic)n(h)g(mo)r(dify)h(the)140 2727 y(w)n(a)n(y)28 b(in)i(whic)n(h)g (it)g(op)r(erates.)42 b(In)30 b(man)n(y)f(cases,)h(the)g(default)g(v)-5 b(alues)29 b(are)g(sensible)g(and)h(can)f(can)g(b)r(e)i(left)f(as)140 2827 y(they)e(are.)36 b(Eac)n(h)26 b(option)h(is)h(set)f(as)g(in)h(the) g(follo)n(wing)f(examples:)140 3037 y Fk(SET)42 b(peel_trace)e(1)140 3137 y(SET)i(prune_option)d(0)140 3347 y Fl(Note)33 b(that)g(most)f(of) g(these)h(options)f(are)g(for)g(debugging)f(purp)r(oses)h(only)-7 b(,)34 b(the)f(notable)f(exception)g(b)r(eing)140 3447 y(correct)p 396 3447 25 4 v 28 w(errors.)j(The)28 b(v)-5 b(arious)26 b(p)r(ossible)h(options)g(are:)265 3657 y Fd(\017)41 b Fl(correct)p 604 3657 V 28 w(errors)348 3756 y(On)25 b(encoun)n(tering)f(a)h(genot)n(yp)r(e)f(error,)g Fk(prep)g Fl(will)i(normally)e(prin)n(t)h(a)g(message)f(and)h(stop.)36 b(Ho)n(w)n(ev)n(er,)348 3856 y(b)n(y)45 b(setting)g(this)h(option)g(to) f(1,)50 b Fk(prep)44 b Fl(will)i(attempt)g(to)f(iden)n(tify)h(and)g (remo)n(v)n(e)e(the)h(o\013ending)348 3956 y(genot)n(yp)r(es.)74 b(The)40 b(w)n(a)n(y)f(this)i(is)f(done)g(is)g(e\013ectiv)n(e,)k(but)d (without)g(an)n(y)e(statistical)h(justi\014cation.)348 4055 y(It)j(is)g(v)n(ery)f(useful)i(with)f(large)f(datasets,)47 b(but)c(the)h(results)f(should)g(b)r(e)g(treated)g(with)h(caution.)348 4155 y(The)i(pro)r(cedure)f(do)r(es,)50 b(ho)n(w)n(ev)n(er,)f(giv)n(e)c (information)g(on)h(whic)n(h)g(genot)n(yp)r(es)f(w)n(ere)g(deleted)i (for)348 4255 y(eac)n(h)37 b(mark)n(er,)i(whic)n(h)e(pro)n(vides)g(v)-5 b(aluable)38 b(information)f(on)h(bad)f(mark)n(ers)f(or)h(p)r(ossible)h (p)r(edigree)348 4354 y(errors.)55 b(The)35 b(pro)r(cedure)f(op)r (erates)f(b)n(y)i(\014rst)f(iden)n(tifying)h(families)g(where)f (inconsistencies)g(o)r(ccur,)348 4454 y(and)e(deleting)g(genot)n(yp)r (es)g(for)f(all)h(family)h(mem)n(b)r(ers.)51 b(After)32 b(all)g(inconsisten)n(t)g(families)h(ha)n(v)n(e)e(b)r(een)348 4554 y(deleted,)h(they)g(are)f(then)h(re{examined)e(in)h(the)h(rev)n (erse)e(order)g(to)h(whic)n(h)h(they)f(w)n(ere)g(deleted,)i(and)348 4653 y(genot)n(yp)r(es)j(of)i(family)f(mem)n(b)r(ers)h(are)e(returned)h (to)h(the)g(analysis)e(where)h(they)h(do)f(not)h(cause)f(an)348 4753 y(inconsistency)-7 b(.)50 b(This)32 b(is)g(a)g(reasonably)e(quic)n (k)i(w)n(a)n(y)f(of)h(iden)n(tifying)h(a)f(small)g(\(but)h(not)f (necessarily)348 4852 y(the)k(smallest\))f(subset)h(of)g(genot)n(yp)r (es)f(whic)n(h,)i(if)g(remo)n(v)n(ed,)f(w)n(ould)f(result)h(in)g(no)f (inconsistencies.)348 4952 y(After)28 b(pro)r(cessing)f(a)h(mark)n(er,) f Fk(prep)g Fl(will)h(write)g(out)h(a)f(\014le)g(named)g([mark)n(er)p 2820 4952 V 28 w(name].err,)g(whic)n(h)g(will)348 5052 y(ha)n(v)n(e)e(a)h(line)g(for)g(eac)n(h)g(delete)g(genot)n(yp)r(e)g (sho)n(wing)f(the)i(individual)g(id,)f(and)h(the)f(father)h(and)f (mother)348 5151 y(of)f(the)g(n)n(uclear)f(family)h(in)g(whic)n(h)g (the)h(problem)e(arose.)35 b(If)e Fk(prep)24 b Fl(is)i(re{run)f(with)h (the)h(same)e(mark)n(er,)348 5251 y(it)32 b(will)g(read)g(in)g(this)g (\014le)h(if)f(it)h(exists,)f(and)g(try)g(this)h(\014rst.)50 b(This)32 b(\014le)g(there)g(pro)n(vides)e(a)i(w)n(a)n(y)f(b)r(oth)348 5351 y(of)g(seeing)g(whic)n(h)h(genot)n(yp)r(es)f(are)g(causing)f (problems,)j(and)e(to)h(imp)r(ose)f(a)h(list)g(of)g(genot)n(yp)r(es)e (to)i(b)r(e)348 5450 y(deleted)c(on)f Fk(prep)f Fl(if)i(this)g(is)f (desired.)37 b(Note)27 b(that)h(the)g(original)e(data)h(\014les)h(are)e (not)i(c)n(hanged.)265 5613 y Fd(\017)41 b Fl(prune)p 561 5613 V 29 w(option)348 5713 y(By)19 b(default,)i(p)r(edigrees)e (are)f(pruned)h(b)r(efore)h(analysis)e(to)h(remo)n(v)n(e)f(p)r(edigree) g(sections)h(that)h(con)n(tribute)1831 5962 y(14)p eop end %%Page: 15 15 TeXDict begin 15 14 bop 348 231 a Fl(no)19 b(information.)34 b(This)19 b(option)h(determine)g(ho)n(w)f(m)n(uc)n(h)g(p)r(edigree)h (pruning)f(is)h(p)r(erformed.)33 b(Allo)n(w)n(able)348 331 y(v)-5 b(alues)27 b(are:)441 497 y Fe({)41 b Fl(0)27 b(-)h(no)f(pruning)g(at)h(all.)441 630 y Fe({)41 b Fl(1)i(-)f(prune)h (p)r(edigree)f(based)h(on)f(data)h(on)f(all)h(mark)n(ers)d(and)j(trait) g(information)f(\()p Fj(i.e.)p Fl(,)49 b(an)530 729 y(individual)30 b(is)f(considered)f(observ)n(ed)f(if)j(they)f(ha)n(v)n(e)f(data)h(on)g (an)n(y)f(mark)n(er)g(or)g(an)n(y)g(phenot)n(yp)r(e)530 829 y(data.)441 962 y Fe({)41 b Fl(2)27 b(\(default\))i(-)e(prune)h(p)r (edigree)f(individually)g(for)h(eac)n(h)e(trait)i(mark)n(er)d(and)j (trait)f(lo)r(cus.)265 1128 y Fd(\017)41 b Fl(reco)r(de)p 587 1128 25 4 v 29 w(option)348 1228 y(Alleles)26 b(are)g(normally)f (reco)r(ded)h(b)r(oth)h(within)g(p)r(edigree)f(comp)r(onen)n(ts)h(and)f (within)h(families)g(\(`fuzzy)348 1327 y(reco)r(ding'\).)34 b(This)22 b(can)g(b)r(e)h(con)n(trolled)d(using)i(this)h(option.)35 b(Note)22 b(that)g(this)h(should)f(only)f(b)r(e)i(done)f(for)348 1427 y(testing)30 b(purp)r(oses)h(-)f(the)h(default)h(reco)r(ding)e (lev)n(el)g(whic)n(h)h(uses)f(fuzzy)h(reco)r(ding)f(is)h(generally)f(m) n(uc)n(h)348 1526 y(faster)d(than)g(the)h(other)f(lev)n(els.)36 b(Allo)n(w)n(able)27 b(v)-5 b(alues)27 b(are:)441 1693 y Fe({)41 b Fl(0)27 b(-)h(no)f(reco)r(ding)g(of)g(alleles.)441 1825 y Fe({)41 b Fl(1)27 b(-)h(reco)r(de)f(alleles)f(within)j(p)r (edigree)e(comp)r(onen)n(ts.)441 1958 y Fe({)41 b Fl(2)27 b(\(default\))i(-)e(reco)r(de)g(alleles)g(within)h(families)g(\(fuzzy)g (reco)r(ding\).)265 2124 y Fd(\017)41 b Fl(no)p 441 2124 V 29 w(extra)p 658 2124 V 29 w(allele)348 2224 y(Normally)-7 b(,)22 b Fk(prep)e Fl(allo)n(ws)h(for)g(the)i(presence)e(of)h(a)f (non{observ)n(ed)f(allele)h(when)i(setting)f(up)g(the)g(p)r(eeling)348 2323 y(calculations.)36 b(This)28 b(is)g(generally)e(correct,)h(ho)n(w) n(ev)n(er)f(if)i(it)h(is)f(kno)n(wn)f(that)h(all)g(p)r(ossible)f (alleles)h(ha)n(v)n(e)348 2423 y(b)r(een)f(observ)n(ed,)f(memory)g(and) h(computational)g(requiremen)n(ts)f(can)h Fj(sometimes)34 b Fl(b)r(e)28 b(reduced)f(using)348 2523 y(this)g(option.)441 2689 y Fe({)41 b Fl(0)27 b(\(default\))i(-)e(allo)n(w)g(extra)g (allele.)441 2822 y Fe({)41 b Fl(1)27 b(-)h(no)f(extra)g(allele)g(allo) n(w)n(ed.)265 2988 y Fd(\017)41 b Fl(p)r(eel)p 498 2988 V 30 w(option)d(Loki)h(distinguished)g(b)r(et)n(w)n(een)g(three)f (classes)g(of)h(p)r(eeling)g(op)r(erations:)58 b(\(1\))39 b(n)n(uclear)348 3087 y(family)j(based,)k(p)r(eeling)c(on)n(to)g(a)g (single)g(individual;)50 b(\(2\))42 b(n)n(uclear)g(family)g(based,)k(p) r(eeling)c(on)n(to)348 3187 y(t)n(w)n(o)34 b(individuals;)39 b(\(3\))d(non-n)n(uclear)e(family)h(based)g(\(p)r(eeling)h(some)f (sub{set)g(of)g(individuals)g(on)n(to)348 3287 y(another)e(sub{set)h (of)g(individuals\).)58 b(The)34 b(last)g(class)g(could)g(b)r(e)h(used) f(for)g(all)g(p)r(eeling)h(op)r(erations.)348 3386 y(Ho)n(w)n(ev)n(er,) 26 b(op)r(erations)h(in)i(the)g(other)e(classes,)h(when)g(p)r(ossible,) g(are)g(m)n(uc)n(h)g(faster.)39 b(F)-7 b(or)27 b(this)i(reason,)348 3486 y(b)n(y)k(default)i(all)e(p)r(ossible)h(class)f(1)h(op)r(erations) e(are)h(p)r(erformed,)j(then)e(all)g(class)f(2,)i(and)f(then)g(class) 348 3585 y(3.)57 b(F)-7 b(or)34 b(debugging)g(purp)r(oses)g(it)h(is)f (p)r(ossible)g(to)h(turn)g(o\013)f(the)h(family)g(based)f(p)r(eeling)h (using)f(this)348 3685 y(option.)39 b(V)-7 b(alues)29 b(for)f(the)h(option)f(are)f(determined)i(b)n(y)g(setting)f(the)h (appropriate)e(bits,)i(if)g(y)n(ou)f(don't)348 3785 y(understand)f (this)h(then)g(y)n(ou)f(shouldn't)g(b)r(e)h(trying)f(to)h(debug)f(an)n (ything.)14 b(.)f(.)441 3951 y Fe({)41 b Fl(bit)28 b(0)g(-)f(T)-7 b(urn)27 b(o\013)h(class)f(1)g(and)g(class)g(2)g(p)r(eeling)h(for)f (mark)n(er)f(lo)r(ci)441 4084 y Fe({)41 b Fl(bit)28 b(1)g(-)f(T)-7 b(urn)27 b(o\013)h(class)f(1)g(and)g(class)g(2)g(p)r(eeling)h(for)f (trait)g(lo)r(ci)441 4216 y Fe({)41 b Fl(bit)28 b(2)g(-)f(T)-7 b(urn)27 b(o\013)h(class)f(2)g(p)r(eeling)g(only)h(for)f(all)g(lo)r(ci) 265 4382 y Fd(\017)41 b Fl(trace)p 534 4382 V 29 w(restrict,)47 b(trace)p 1074 4382 V 29 w(censored,)g(trace)p 1665 4382 V 29 w(a\013ected,)i(trace)p 2226 4382 V 29 w(p)r(eel)44 b(These)g(option)g(turn)g(on)g(di\013eren)n(t)348 4482 y(lev)n(els)h(of)i(debugging)e(information)h(ab)r(out)g(the)h(restrict) f(\(WHERE,USE\),)h(CENSORED)f(and)348 4582 y(AFFECTED)34 b(commands,)h(and)f(the)h(p)r(eeling)f(op)r(erations.)56 b(Di\013eren)n(t)34 b(lev)n(els)g(of)g(information)f(are)348 4681 y(turned)27 b(on)g(b)n(y)f(setting)h(di\013eren)n(t)h(bits)f(-)g (the)g(higher)g(n)n(um)n(b)r(ered)f(bits)i(giv)n(e)e(more)g (information.)36 b(The)348 4781 y(lev)n(els)23 b(are)h(not)g(precisely) g(de\014ned)h(as)e(these)i(options)f(are)f(mainly)h(for)g(m)n(y)h(b)r (ene\014t,)h(and)e(ma)n(y)g(c)n(hange)348 4881 y(without)k(w)n(arning.) 265 5047 y Fd(\017)41 b Fl(no)p 441 5047 V 29 w(default)p 721 5047 V 30 w(missing)26 b(T)-7 b(urn)27 b(o\013)f(the)h(default)g (missing)f(co)r(de)h(\()p Fj(i.e.)p Fl(,)h(rev)n(ert)d(to)i(the)g(b)r (eha)n(viour)e(of)33 b Fk(prep)348 5146 y Fl(prior)26 b(to)h(v)n(ersion)f(2.4.5\).)441 5312 y Fe({)41 b Fl(0)27 b(\(default\))i(-)e(use)h(default)g(missing)f(co)r(de.)441 5445 y Fe({)41 b Fl(1)27 b(-)h(no)f(default)h(missing)f(co)r(de.)1831 5962 y(15)p eop end %%Page: 16 16 TeXDict begin 16 15 bop 140 231 a Fh(5.21)112 b(T)-9 b(emp)s(orary)38 b(v)-6 b(ariables)140 434 y Fl(As)37 b(w)n(ell)f(as)g(v)-5 b(ariables)35 b(whic)n(h)i(are)f(read)f(in)i (from)f(data\014les,)j Fk(prep)c Fl(also)g(allo)n(ws)h(the)h(use)f(of)h (temp)r(orary)139 534 y(v)-5 b(ariables)26 b(whic)n(h)g(exist)h(only)f (while)h(the)h(con)n(trol)d(\014le)i(is)g(b)r(eing)f(scanned.)36 b(Unlik)n(e)27 b(standard)f(v)-5 b(ariables,)26 b(the)136 634 y(v)-5 b(alues)22 b(of)h(temp)r(orary)e(v)-5 b(ariables)22 b(are)f(set)i(as)f Fk(prep)f Fl(pro)r(cesses)g(the)i(con)n(trol)f (\014le,)i(so)e(the)h(order)e(of)i(statemen)n(ts)140 733 y(using)k(suc)n(h)h(v)-5 b(ariables)26 b(is)h(imp)r(ortan)n(t.)37 b(One)27 b(use)h(for)f(temp)r(orary)f(v)-5 b(ariables)26 b(is)i(giv)n(en)f(b)r(elo)n(w:)140 945 y Fk(Directory="../..)o(/da)o (ta)o(/")140 1045 y(FILE)42 b(Directory+"pheno)o(ty)o(pes)o(",)o(x,y)o (,z)140 1144 y(FILE)g(Directory+"genot)o(yp)o(es")o(,x)o(,a1)o(,a)o (2,a)o(3,)o(a4)o(,a5)o(,a)o(6)137 1356 y Fl(Note)23 b(ho)n(w)g(strings) g(can)h(b)r(e)g(concatenated)e(using)i(the)g(`+')f(op)r(erator.)34 b(T)-7 b(emp)r(orary)23 b(v)-5 b(ariables)22 b(can)h(also)g(hold)140 1456 y(n)n(umeric)k(v)-5 b(alues)27 b(and)h(can)f(b)r(e)h(assigned)e(v) -5 b(alues)28 b(using)f(complex)g(expressions,)f(for)h(example:)140 1668 y Fk(n_markers=45)140 1767 y(s=4*\(n_markers-5)o(\)+n)o(_m)o(ar)o (ker)o(s/)o(2.3)140 2049 y Fh(5.22)112 b(Arra)m(ys)140 2252 y Fl(Multip)r(oin)n(t)32 b(analysis)e(can)g(in)n(v)n(olv)n(e)g(h)n (undreds)h(of)g(mark)n(ers,)f(and)h(sp)r(ecifying)g(eac)n(h)f(of)h (these)g(individually)140 2351 y(in)e(the)g(con)n(trol)e(\014le)i(can)f (b)r(ecome)g(tedious.)39 b(T)-7 b(o)29 b(reduce)f(this)g(a)h(little,)g (arra)n(ys)d(can)i(b)r(e)h(used.)40 b(Arra)n(ys)26 b(m)n(ust)140 2451 y(b)r(e)i(declared)f(b)r(efore)g(they)h(are)e(used)i(using)f(the)h (ARRA)-7 b(Y)29 b(command:)140 2663 y Fk(ARRAY)42 b (id\(3\),q\(4\),alle)o(le)o(_a\()o(30)o(\),a)o(ll)o(ele)o(_b)o(\(3)o (0\))136 2874 y Fl(The)24 b Fc(i)p Fl(th)g(arra)n(y)d(elemen)n(ts)j(is) f(referenced)g(as)g(id\()p Fc(i)p Fl(\).)36 b(If)24 b(the)g(arra)n(y)e (name)h(alone)g(is)h(giv)n(en)f(then)h(this)g(is)f(treated)135 2974 y(as)e(a)h(list)g(of)g(v)-5 b(ariables)20 b(of)i(length)g(the)h (size)e(of)h(the)g(arra)n(y)-7 b(.)33 b(This)22 b(means)g(that,)h(giv)n (en)e(the)h(ARRA)-7 b(Y)23 b(statemen)n(t)140 3074 y(ab)r(o)n(v)n(e,)j (the)i(2)f(examples)g(b)r(elo)n(w)h(are)e(equiv)-5 b(alen)n(t.)140 3286 y Fk(FILE)42 b("filename",id\(1\))o(,i)o(d\(2)o(\),)o(id\()o(3\))o (,q\()o(1\))o(,q)o(\(2\))o(,q)o(\(3\))o(,q)o(\(4)o(\))140 3385 y(FILE)g("filename",id,q)140 3597 y Fl(Reference)27 b(to)h(a)f(range)f(of)i(arra)n(y)d(elemen)n(ts)i(is)h(also)e(allo)n(w)n (ed)h(\(sp)r(ot)h(the)g(F)n(OR)-7 b(TRAN)27 b(in\015uence\):)140 3809 y Fk(FILE)42 b("filename",id,\(q)o(\(i)o(\),i)o(=1)o(,3\))140 3908 y(FILE)g("filename",id\(1\))o(,\()o(all)o(el)o(e_a)o(\(i)o(\),a)o (ll)o(el)o(e_b)o(\(i)o(\),i)o(=1)o(,3)o(0\))137 4120 y Fl(The)24 b(\014rst)g(example)g(reads)f(the)i(\014rst)f(3)f(\014elds) i(in)n(to)f(id)g(and)g(the)h(next)f(3)g(in)n(to)g(the)h(\014rst)f(3)f (elemen)n(ts)i(of)f(q.)35 b(The)140 4220 y(second)29 b(example)g(is)g(a)g(little)h(more)e(complicated,)i(it)f(reads)g(in)g (a)g(single)g(id)h(v)-5 b(ariable)28 b(in)n(to)h(q\(1\),)h(and)f(then) 140 4319 y(30)g(pairs)f(of)i(allele)p 745 4319 25 4 v 30 w(a\(i\),allele)p 1112 4319 V 29 w(b\(i\);)i(this)e(last)f(form)g (can)h(b)r(e)g(v)n(ery)e(useful)i(for)f(reading)g(in)h(genot)n(yp)r(e)f (data.)140 4419 y(Multidimensional)f(arra)n(ys)d(are)h(not)i(supp)r (orted)f(at)h(presen)n(t.)140 4700 y Fh(5.23)112 b(DO)38 b(WHILE)e(commands)132 4903 y Fl(V)-7 b(ery)19 b(limited)g(lo)r(oping)g (capabilit)n(y)f(is)g(pro)n(vided;)j(this)e(is)g(in)n(tended)h(to)e (help)i(handle)e(large)g(arra)n(ys)e(of)j(genot)n(yp)r(e)140 5003 y(data.)57 b(After)34 b(reading)g(in)g(genot)n(yp)r(e)g(data)g(on) g(large)f(n)n(um)n(b)r(ers)h(of)g(mak)n(ers,)h(it)f(is)h(necessary)d (to)i(link)h(the)138 5103 y(allele)26 b(v)-5 b(ariables)24 b(to)i(the)g(appropriate)e(mark)n(ers)g(using)i(the)g(MARKER)f(LOCUS)h (command,)g(as)f(describ)r(ed)140 5202 y(earlier.)35 b(This)28 b(can)f(b)r(e)h(done)g(as)e(follo)n(ws:)140 5414 y Fk(ARRAY)42 b(id\(3\),allele_a\()o(30)o(\),a)o(ll)o(ele)o(_b)o (\(30)o(\),)o(D1)o(G\(3)o(0\))140 5514 y(FILE)g("filename",id\(1\))o (,\()o(all)o(el)o(e_a)o(\(i)o(\),a)o(ll)o(el)o(e_b)o(\(i)o(\),i)o(=1)o (,3)o(0\))140 5613 y(i=1)140 5713 y(DO)1831 5962 y Fl(16)p eop end %%Page: 17 17 TeXDict begin 17 16 bop 227 231 a Fk(MARKER)41 b(LOCUS)h (D1G\(i\)[allele_a\()o(i\))o(,al)o(le)o(le)o(_b\()o(i\))o(])227 331 y(i=i+1)140 431 y(WHILE\(i<=30\))140 641 y Fl(This)35 b(example)f(reads)f(in)i(30)e(pairs)h(of)g(allele)h(data)f(in)n(to)g (allele)p 2207 641 25 4 v 29 w(a)g(and)h(allele)p 2666 641 V 29 w(b,)i(and)d(then)h(assigns)e(eac)n(h)137 741 y(pair)24 b(to)h(the)g(corresp)r(onding)d(mark)n(er)h(in)i(D1G.)g(Note) g(that)f(the)h(inden)n(tation)g(for)f(the)h(commands)f(is)g(totally)140 840 y(arbitrary)-7 b(.)140 1121 y Fh(5.24)112 b(En)m(vironmen)m(t)38 b(v)-6 b(ariables)140 1324 y Fl(It)33 b(is)g(p)r(ossible)f(to)h(use)f (en)n(vironmen)n(t)g(v)-5 b(ariables)31 b(within)j(a)e(con)n(trol)f (\014le.)53 b(The)33 b(follo)n(wing)e(example)h(sho)n(ws)140 1424 y(ho)n(w)27 b(this)h(could)f(b)r(e)h(used:)140 1634 y Fk(DataDir="$HOME"+)o("/d)o(at)o(a/)o(gaw)o(9/)o(")140 1845 y Fl(This)k(is)f(in)n(tended)h(to)g(simplify)g(ha)n(ving)e(m)n (ultiple)i(loki)g(runs)f(con)n(trolled)f(b)n(y)h(a)h(shell)f(script.)49 b(If)32 b(this)g(do)r(es)140 1944 y(not)c(mak)n(e)e(an)n(y)h(sense)g (to)h(y)n(ou,)f(don't)g(w)n(orry)f(-)h(y)n(ou)g(probably)g(w)n(on't)g (miss)g(it.)140 2225 y Fh(5.25)112 b(IBD)37 b(sharing)i(analyses)140 2428 y Fl(T)-7 b(o)33 b(p)r(erform)g(and)h(IBD)g(sharing)e(analysis)g (or)h(to)h(estimate)f(kinship)h(co)r(e\016cien)n(t)f(matrices,)i(as)e (discussed)133 2528 y(earlier,)21 b(follo)n(w)e(the)i(instructions)f (for)g Fk(prep)f Fl(as)g(for)h(a)g(parametric)f(analysis,)h(except)h (that)f(it)h(is)f(not)h(necessary)140 2628 y(to)31 b(sp)r(ecify)h(a)e (mo)r(del.)48 b(F)-7 b(or)31 b(the)g(IBD)h(sharing)e(analysis,)h(it)g (will)h(b)r(e)f(necessary)f(to)h(use)g(the)g(AFFECTED)140 2727 y(command)e(to)g(indicate)g(whic)n(h)g(individuals)g(are)f (a\013ected.)41 b(In)29 b(the)h(parameter)d(\014le)i(for)g Fk(loki)p Fl(,)f(it)h(will)g(also)139 2827 y(b)r(e)d(necessary)e(to)i (use)g(the)g(ESTIMA)-7 b(TE)26 b(IBD)g(command)g(\(Section)g(6.13\),)f (or)g(the)i(ANAL)-7 b(YSIS)27 b(command)140 2926 y(\(Section)h(6.14\))e (to)i(instruct)g Fk(loki)e Fl(whic)n(h)h(analysis)f(to)i(p)r(erform.) 140 3207 y Fh(5.26)112 b(F)-9 b(ull)38 b(example)140 3411 y Fl(T)-7 b(o)32 b(\014nish)i(this)f(section,)h(here)e(is)h(a)f (somewhat)g(complex)h(con)n(trol)e(\014le)i(I)g(uses)g(to)f(read)g(in)h (the)h(sim)n(ulated)134 3510 y(data\014les)21 b(pro)r(duced)f(for)h (the)g(GA)-9 b(W9)21 b(w)n(orkshop.)33 b(The)21 b(data\014les)g(are)f (the)h(originals,)g(except)g(that)g(they)g(ha)n(v)n(e)139 3610 y(b)r(een)27 b(compressed)f(to)h(sa)n(v)n(e)e(disk)h(space.)36 b(F)-7 b(or)26 b(this)h(example,)g(FILE)f(statemen)n(ts)h(for)f(all)h (of)f(the)i(haplot)n(yp)r(e)140 3709 y(data)h(\014les)h(are)e (included,)j(but)f(the)g(LINK)f(statemen)n(ts)h(are)e(commen)n(ted)i (out)f(for)h(all)f(c)n(hromosome)e(apart)140 3809 y(from)32 b(c)n(hromosome)d(1.)50 b(This)32 b(has)f(the)h(e\013ect)h(that)f(only) f(mark)n(ers)f(on)i(c)n(hromosome)d(1)j(will)g(b)r(e)g(analyzed)136 3909 y(and,)25 b(therefore,)e(only)g(the)h(\014les)f(whic)n(h)h(con)n (tain)f(genot)n(yp)r(e)f(data)h(for)g(c)n(hromosome)f(1)h(mark)n(ers)e (will)j(b)r(e)g(read)140 4008 y(in.)140 4219 y Fk(/***************)o (***)o(**)o(**)o(***)o(**)o(***)o(**)o(***)o(**)o(**)o(***)o(**)o(***)o (**)o(**)o(***)o(**)o(***)o(**)o(***)o(**)184 4318 y(*)2789 b(*)184 4418 y(*)697 b(Control)40 b(file)i(for)h(the)f(GAW9)g(dataset) 651 b(*)184 4518 y(*)2789 b(*)184 4617 y(***************)o(***)o(**)o (**)o(***)o(**)o(***)o(**)o(***)o(**)o(**)o(***)o(**)o(***)o(**)o(**)o (***)o(**)o(***)o(**)o(***)o(**)184 4717 y(*)184 4816 y(*)184 4916 y(*)43 b(Define)e(arrays)g(for)h(haplotypes,)d(markers,)i (traits)g(and)h(ids)184 5016 y(*)184 5115 y(*)h(Each)f(file)g(has)g (15x2)g(columns)f(of)h(allele)f(data)184 5215 y(*)i(and)f(there)g(are)g (30)h(markers/chromoso)o(me)184 5315 y(*)184 5414 y(*/)140 5613 y(Array)f(hap1_left\(30\),)37 b(hap1_right\(30\),)h (hap2_left\(30\),)f(hap2_right\(30\),)402 5713 y(hap3_left\(30\),)g (hap3_right\(30\),)h(hap4_left\(30\),)f(hap4_right\(30\),)1831 5962 y Fl(17)p eop end %%Page: 18 18 TeXDict begin 18 17 bop 402 231 a Fk(hap5_left\(30\),)37 b(hap5_right\(30\),)h(hap6_left\(30\),)f(hap6_right\(30\),)402 331 y(D1G\(30\),)j(D2G\(30\),)g(D3G\(30\),)g(D4G\(30\),)h(D5G\(30\),)f (D6G\(30\),)402 431 y(q\(4\),)h(id\(3\))140 630 y(Filter)g("gzip")521 b(#)43 b(Compress)d(binary)h(output)g(files)140 729 y(DataDir)g(=)i ("../data/gaw9")38 b(#)43 b(Where)e(the)i(data)f(files)f(are)h(located) 140 829 y(Missing)f("0",id)477 b(#)43 b(Define)e("0")h(as)h(a)g (missing)e(value)g(for)i(id)140 1028 y(/*)g(Phenotype)d(datafiles)f(*/) 140 1128 y(file)j([5x,3\(5\),15x,2,3)o(,6)o(x,6)o(,4)o(\(7\))o(])271 1228 y(shell\("zcat)d("+DataDir+"/phen)o(ot)o(yp.)o(gz)o("\))o(,id)o (,s)o(x,a)o(ge)o(,e)o(f,q)140 1427 y(/*)k(Genotype)d(data)i(files)f(*/) 140 1526 y(file)h([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j ("+DataDir+"/d1a)o(1-)o(15.)o(gz)o("\),)271 1626 y(id\(1\),\(hap1_left) o(\(i)o(\),)o(hap)o(1_)o(rig)o(ht)o(\(i\))o(,i)o(=1)o(,15)o(\))140 1726 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j ("+DataDir+"/d1a)o(16)o(-30)o(.g)o(z"\))o(,)271 1825 y(id\(1\),\(hap1_left)o(\(i)o(\),)o(hap)o(1_)o(rig)o(ht)o(\(i\))o(,i)o (=1)o(6,3)o(0\))140 2025 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d2a)o(1-)o(15.)o(gz)o("\),)271 2124 y(id\(1\),\(hap2_left)o(\(i)o(\),)o(hap)o(2_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(,15)o(\))140 2224 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d2a)o(16)o(-30)o(.g)o(z"\))o(,)271 2323 y(id\(1\),\(hap2_left)o(\(i)o(\),)o(hap)o(2_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(6,3)o(0\))140 2523 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d3a)o(1-)o(15.)o(gz)o("\),)271 2622 y(id\(1\),\(hap3_left)o(\(i)o(\),)o(hap)o(3_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(,15)o(\))140 2722 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d3a)o(16)o(-30)o(.g)o(z"\))o(,)271 2822 y(id\(1\),\(hap3_left)o(\(i)o(\),)o(hap)o(3_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(6,3)o(0\))140 3021 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d4a)o(1-)o(15.)o(gz)o("\),)271 3121 y(id\(1\),\(hap4_left)o(\(i)o(\),)o(hap)o(4_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(,15)o(\))140 3220 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d4a)o(16)o(-30)o(.g)o(z"\))o(,)271 3320 y(id\(1\),\(hap4_left)o(\(i)o(\),)o(hap)o(4_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(6,3)o(0\))140 3519 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d5a)o(1-)o(15.)o(gz)o("\),)271 3619 y(id\(1\),\(hap5_left)o(\(i)o(\),)o(hap)o(5_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(,15)o(\))140 3718 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d5a)o(16)o(-30)o(.g)o(z"\))o(,)271 3818 y(id\(1\),\(hap5_left)o(\(i)o(\),)o(hap)o(5_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(6,3)o(0\))140 4017 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d6a)o(1-)o(15.)o(gz)o("\),)271 4117 y(id\(1\),\(hap6_left)o(\(i)o(\),)o(hap)o(6_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(,15)o(\))140 4216 y(file)i([5x,5,15\(1x,1,1\))o(])37 b(shell\("zcat)j("+DataDir+"/d6a)o(16)o(-30)o(.g)o(z"\))o(,)271 4316 y(id\(1\),\(hap6_left)o(\(i)o(\),)o(hap)o(6_)o(rig)o(ht)o(\(i\))o (,i)o(=1)o(6,3)o(0\))140 4515 y(/*)j(Link)f(haplotypes)d(to)k(the)f (appropriate)d(markers)i(*/)140 4615 y(i=1)140 4715 y(do)227 4814 y(Marker)g(Locus)314 4914 y(D1G\(i\))g([)j(hap1_left\(i\),)38 b(hap1_right\(i\))g(],)314 5013 y(D2G\(i\))j([)j(hap2_left\(i\),)38 b(hap2_right\(i\))g(],)314 5113 y(D3G\(i\))j([)j(hap3_left\(i\),)38 b(hap3_right\(i\))g(],)314 5213 y(D4G\(i\))j([)j(hap4_left\(i\),)38 b(hap4_right\(i\))g(],)314 5312 y(D5G\(i\))j([)j(hap5_left\(i\),)38 b(hap5_right\(i\))g(],)314 5412 y(D6G\(i\))j([)j(hap6_left\(i\),)38 b(hap6_right\(i\))g(])227 5512 y(i=i+1)140 5611 y(while\(i<=30\))1831 5962 y Fl(18)p eop end %%Page: 19 19 TeXDict begin 19 18 bop 140 231 a Fk(/*)43 b(Only)f(genotype)e(data)i (only)g(where)f(phenotype)f(data)i(is)h(available)d(*/)140 331 y(use)227 431 y(hap1_left,hap1_ri)o(gh)o(t,)o(hap)o(2_)o(lef)o(t,)o (hap)o(2_)o(ri)o(ght)o(,h)o(ap3)o(_l)o(ef)o(t,h)o(ap)o(3_r)o(ig)o(ht,) 227 530 y(hap4_left,hap4_ri)o(gh)o(t,)o(hap)o(5_)o(lef)o(t,)o(hap)o(5_) o(ri)o(ght)o(,h)o(ap6)o(_l)o(ef)o(t,h)o(ap)o(6_r)o(ig)o(ht)140 630 y(where)i(\(q\(1\)\))140 829 y(Trait)g(Locus)f(QTL)217 b(#)43 b(Define)e(QTL)h(as)h(1)g(or)g(more)f(trait)f(loci)140 929 y(pedigree)f(id)392 b(#)43 b(Declare)e(pedigree)f(variables)140 1028 y(log)i("gaw9.log")258 b(#)43 b(Name)f(for)g(log)h(file)140 1128 y(sex)f(sx)h(1,2)435 b(#)43 b(sx)g(determine)d(sex:)h(1=Male,)g (2=Female)140 1327 y(/*)i(Set)f(up)h(model)e(*/)140 1427 y(model)h(q\(1\)=age+ef+sx+)o(QT)o(L)140 1626 y(/*)h(Define)e(linkage)g (groups)g(-)i(just)f(analyze)e(chromosome)g(1)j(this)f(time)g(*/)140 1726 y(Link)g("Chromosome)d(1",D1G)140 1925 y(/*)140 2025 y(Link)j("Chromosome)d(2",D2G)140 2124 y(Link)j("Chromosome)d (3",D3G)140 2224 y(Link)j("Chromosome)d(4",D4G)140 2323 y(Link)j("Chromosome)d(5",D5G)140 2423 y(Link)j("Chromosome)d(6",D6G) 140 2523 y(*/)140 2847 y Fo(6)135 b(P)l(arameter)46 b(\014le)g(for)f Fi(loki)138 3078 y Fl(The)25 b(parameter)e(\014le)i(for)g Fk(loki)e Fl(has)i(man)n(y)f(similarities)g(to)h(the)h(con)n(trol)d (\014le)i(for)g Fk(prep)e Fl(in)i(that)h(the)f(order)f(of)137 3178 y(commands)g(is)h(generally)e(arbitrary)-7 b(,)23 b(and)h(the)h(case)f(of)h(commands)f(is)g(ignored.)35 b(Commen)n(ts)24 b(can)g(b)r(e)h(added)140 3278 y(in)j(the)g(same)f(w)n (a)n(y)f(as)h(for)g(the)h(con)n(trol)e(\014le.)140 3559 y Fh(6.1)112 b(Con)m(trolling)38 b(the)f(sampling)j(run)140 3762 y Fl(The)27 b(commands)f(describ)r(ed)h(here)f(con)n(trol)g(ho)n (w)h(man)n(y)f(iterations)g(to)h(run,)g(ho)n(w)g(often)g(to)g(output)g (data)g(to)139 3862 y(standard)e(output)i(\(normally)e(the)i(screen\))f (and)g(the)h(output)f(\014le)h(\(whic)n(h)f(is)g(normally)g(the)g (\014le)h Fk(loki.out)p Fl(,)140 3962 y(unless)34 b(altered)g(with)g (OUTPUT)g(FILE\),)h(and)f(when)g(to)g(start)g(pro)r(ducing)f(the)i (output.)57 b(The)35 b(example)140 4061 y(b)r(elo)n(w)e(sets)h(the)g(n) n(um)n(b)r(er)g(of)g(iterations)f(to)g(10000,)g(with)i(output)f (starting)f(at)h(iteration)f(50,)i(and)e(b)r(egin)140 4161 y(pro)r(duced)27 b(at)h(ev)n(ery)e(iteration)h(after)g(that,)h (and)g(sets)f(the)h(output)g(\014le)g(name)f(to)h Fk(loki.out1)p Fl(.)140 4375 y Fk(ITERATIONS)39 b(10000)140 4474 y(START)j(OUTPUT)f (50)140 4574 y(OUTPUT)g(FREQUENCY)f(1)140 4673 y(OUTPUT)h(FILE)h ("loki.out1")140 4887 y Fl(Separate)30 b(starting)f(times)i(and)g (output)g(frequencies)f(can)g(b)r(e)i(set)e(for)g(standard)g(output)h (and)g(the)g(output)140 4987 y(\014le)d(b)n(y)f(sp)r(ecifying)h(a)f (second)g(argumen)n(t)f(to)i(the)g(relev)-5 b(an)n(t)27 b(commands)g(as)g(in)g(the)h(follo)n(wing)f(example:)140 5200 y Fk(ITERATIONS)39 b(10000)140 5300 y(START)j(OUTPUT)f(50,1)140 5400 y(OUTPUT)g(FREQUENCY)f(2,1)140 5613 y Fl(In)35 b(this)h(example,)g (output)g(to)f(\014le)g(starts)g(at)g(iteration)f(50)g(and)h(con)n(tin) n(ues)g(at)g(ev)n(ery)e(second)i(iteration.)134 5713 y(Prin)n(ting)21 b(to)g(standard)f(output,)k(ho)n(w)n(ev)n(er,)c (starts)h(at)g(the)h(\014rst)f(iteration)f(and)i(carries)d(on)i(at)h (ev)n(ery)e(iteration)1831 5962 y(19)p eop end %%Page: 20 20 TeXDict begin 20 19 bop 140 231 a Fl(after)30 b(that.)44 b(Sp)r(ecifying)30 b(a)f(0)h(for)f(an)h(output)g(frequency)g(turns)g (o\013)f(the)i(resp)r(ectiv)n(e)e(output)h(stream.)43 b(The)136 331 y(default)23 b(b)r(eha)n(viour)f(is)g(to)h(carry)e(on)i (forev)n(er,)f(prin)n(ting)g(output)i(at)e(ev)n(ery)g(iteration)g (starting)g(from)g(iteration)140 431 y(1.)140 580 y(The)35 b(OUTPUT)g(command)f(can)h(also)f(b)r(e)h(used)g(to)g(determine)g(whic) n(h)g(mo)r(del)g(e\013ects)g(are)f(written)h(out.)140 680 y(By)g(default)g(only)f(the)i(o)n(v)n(erall)c(mean)j(and)g(the)g (trait)g(lo)r(ci)f(e\013ects)h(are)f(output.)59 b(If)36 b(the)f(e\013ects)g(of)g(other)140 779 y(co)n(v)-5 b(ariates)26 b(or)g(candidate)h(lo)r(ci)h(are)f(required,)f(then)i(this)g(can)f(b)r (e)h(done)g(b)n(y:)140 990 y Fk(OUTPUT)41 b(sx,age)140 1089 y(OUTPUT)g(D1G2)140 1299 y Fl(In)n(terpretation)36 b(of)i(whic)n(h)f(column)h(of)f(output)h(refers)f(to)g(whic)n(h)h(co)n (v)-5 b(ariate)36 b(e\013ect)i(is)f(explained)g(in)h(the)140 1399 y(Analysis)28 b(of)g(Output)h(section.)39 b(The)28 b(format)g(for)g(the)g(output)h(\014le)g(has)f(c)n(hanged)f(from)h(v)n (ersion)f(to)h(v)n(ersion)140 1499 y(of)33 b(Loki.)54 b(It)34 b(is)f(understo)r(o)r(d)g(that)h(these)g(c)n(hanges)e(can)h (cause)f(di\016culties)i(for)f(users)g(of)g(earlier)f(v)n(ersions)138 1598 y(who)26 b(ha)n(v)n(e)f(written)h(to)r(ols)f(to)h(in)n(terpret)f (the)h(output.)37 b(F)-7 b(or)25 b(this)h(reason,)f(it)h(is)g(p)r (ossible)f(to)h(instruct)g(Loki)f(to)140 1698 y(use)i(the)h(output)h (format)e(of)g(previous)g(v)n(ersions,)f(as)g(in)i(the)g(follo)n(wing)f (example:)140 1908 y Fk(OUTPUT)41 b(TYPE)h(1)136 2119 y Fl(Output)24 b(t)n(yp)r(e)g(0)f(giv)n(es)f(the)i(original)e(output)i (format,)g(as)f(describ)r(ed)g(in)h(the)g(\014rst)f(v)n(ersion)f(of)h (this)h(do)r(cumen)n(t)140 2218 y(for)37 b(Loki)g(v)n(ersion)g(2.0.)66 b(Output)39 b(t)n(yp)r(e)f(1)f(giv)n(es)g(the)h(default)g(output)g(for) g(v)n(ersion)e(2.1,)j(output)g(t)n(yp)r(e)f(2)140 2318 y(giv)n(es)33 b(the)i(default)f(output)h(for)f(v)n(ersion)f(2.2,)i(and) f(t)n(yp)r(e)g(3)g(giv)n(es)f(the)i(output)f(for)g(v)n(ersion)f (2.3/2.4)f(\(this)140 2417 y(is)j(the)h(system)f(default\).)61 b(Note)36 b(that)g(the)f(curren)n(t)g(corresp)r(ondence)e(b)r(et)n(w)n (een)j(v)n(ersion)e(minor)h(n)n(um)n(b)r(er)140 2517 y(and)d(output)g(t)n(yp)r(e)h(ma)n(y)e(not)h(con)n(tin)n(ue.)50 b(The)32 b(curren)n(tly)f(de\014ned)h(t)n(yp)r(es)g(\(0,1,2,3\))f(ho)n (w)n(ev)n(er,)h(should)f(not)140 2617 y(c)n(hange)h(in)h(future)g(v)n (ersions)e(\(instead)h(a)h(new)g(t)n(yp)r(e)f(4)h(will)g(b)r(e)g (de\014ned\).)53 b(This)32 b(should)h(mak)n(e)f(switc)n(hing)140 2716 y(b)r(et)n(w)n(een)f(v)n(ersions)e(easier.)46 b(Note)31 b(that)g(use)g(of)g(the)g(older)g(output)g(t)n(yp)r(es)g(is)g (deprecated.)47 b(E\013orts)30 b(should)139 2816 y(b)r(e)e(made)e(to)h (mo)n(v)n(e)f(to)g(the)i(new)n(er)e(output)h(t)n(yp)r(es)g(whic)n(h)f (con)n(tain)h(more)f(information)g(and)g(are,)g(generally)-7 b(,)140 2916 y(more)29 b(compact.)43 b(The)30 b(scripts)f(distributed)h (with)h(Loki)e(will)h(read)f(all)g(output)h(t)n(yp)r(es,)h(though)e (they)h(can't)138 3015 y(comp)r(ensate)24 b(for)g(information)g (missing)h(in)g(the)g(earlier)e(formats.)35 b(It)26 b(is)e(lik)n(ely)h (that)g(the)g(output)g(format)f(for)140 3115 y(Loki)j(will)i(con)n(tin) n(ue)e(to)h(c)n(hange)f(in)i(the)f(future)h(as)e(new)h(features)g(are)f (added.)38 b(It)29 b(is)f(suggested,)f(therefore,)140 3214 y(that)j(use)g(is)g(made)f(of)h(the)g(supplied)h(scripts)e(whic)n (h)h(will)g(b)r(e)g(k)n(ept)g(up)g(to)g(date.)44 b(More)29 b(details)g(ab)r(out)h(the)140 3314 y(scripts)d(is)h(giv)n(en)e(in)i (Section)g(8.)140 3595 y Fh(6.2)112 b(Dumping)39 b(and)f(restarting)140 3798 y Fl(When)45 b Fk(loki)e Fl(exits)i(from)f(a)h(non{error)d (condition)i(\()p Fj(i.e.)p Fl(,)51 b(it)45 b(has)f(\014nished)h(the)g (required)f(n)n(um)n(b)r(er)g(of)140 3898 y(op)r(erations,)37 b(or)f(is)g(in)n(terrupted)h(with)g(CTRL-C\),)f(it)h(tries)f(to)g(dump) h(it's)g(in)n(ternal)f(state)g(to)h(a)f(\014le)g(\(b)n(y)138 3997 y(default)25 b(called)g Fk(loki.dump)p Fl(\).)32 b(It)26 b(can)e(then)i(b)r(e)f(restarted)f(at)h(a)g(later)f(date)h(b)n (y)g(passing)f(the)h(-r)f(\015ag)g(to)h Fk(loki)140 4097 y Fj(i.e.)p Fl(,)39 b Fk(loki)j(-r)h(parameter_file)p Fl(.)54 b Fk(loki)33 b Fl(can)i(also)f(b)r(e)i(set)f(to)g(p)r(erio)r (dically)g(dump)h(its)f(in)n(ternal)f(state;)140 4197 y(this)d(is)g(v)n(ery)e(useful)i(if)h(there)e(is)h(a)f(p)r(ossibilit)n (y)g(of)h(the)g(mac)n(hine)g(crashing)e(or)h(b)r(eing)g(switc)n(hed)h (o\013)g(during)140 4296 y(a)k(run,)i(or)e(for)f(debugging)h(purp)r (oses)f(if)43 b Fk(loki)33 b Fl(is)j(crashing)d(part)n(w)n(a)n(y)h (though)h(a)g(long)f(run.)60 b(The)36 b(dump)136 4396 y(frequency)23 b(and)f(dump)i(\014le)f(are)f(set)h(as)g(in)g(the)g (follo)n(wing)f(example,)i(whic)n(h)f(sets)g Fk(loki)e Fl(to)i(dump)h(state)f(ev)n(ery)140 4495 y(50)k(iterations)f(to)i(the)g (\014le)g Fk(loki.dump)p Fl(.)33 b(frequency)27 b(to)g(50)140 4706 y Fk(DUMP)42 b(FREQUENCY)e(50)140 4805 y(DUMP)i(FILE)g ("loki.dump1")140 5016 y Fl(If)i(bac)n(kups)f(ha)n(v)n(e)f(b)r(een)i (enabled)f(then)i(b)r(efore)e(writing)g(a)g(dump\014le,)48 b Fk(loki)42 b Fl(c)n(hec)n(ks)h(to)g(see)g(whether)140 5115 y(one)i(already)f(exists.)89 b(If)46 b(so,)j(it)d(renames)e(the)i (old)f(\014le)h(according)d(to)i(the)h(bac)n(kup)f(sc)n(hedule.)89 b(See)140 5215 y Fj(Backup)42 b(sche)l(dules)47 b Fl(\(Section)40 b(6.6\))f(for)f(details.)73 b(T)-7 b(o)39 b(restart)f(an)h(old)g(run,)j (either)e(the)g(-r)e(\015ag)h(can)g(b)r(e)140 5315 y(used,)f(as)e (describ)r(ed)f(b)r(efore,)j(or)d(the)i(-d)f(\014lename)g(option,)i (whic)n(h)e(allo)n(ws)e(an)i(alternativ)n(e)f(dump\014le)h(to)140 5414 y(b)r(e)44 b(sp)r(eci\014ed.)86 b(By)43 b(default,)49 b(the)44 b(restarted)f(run)g(will)h(create)f(a)h(new)g(output)g (\014le.)86 b(T)-7 b(o)43 b(mak)n(e)g Fk(loki)140 5514 y Fl(app)r(end)g(to)f(an)h(existing)f(output)h(\014le,)k(pass)41 b(the)i(-a)f(\015ag)g(to)g Fk(loki)p Fl(.)81 b(F)-7 b(or)42 b(example,)k(to)c(get)g Fk(loki)f Fl(to)140 5613 y(restart)j(using)h (the)g(dump\014le)h Fk(loki.dump1)p Fl(,)f(and)g(to)g(app)r(end)g (output)h(to)f(the)g(existing)g(out\014le,)50 b(use)140 5713 y Fk(loki)42 b(-adloki.dump1)c(param_file)p Fl(.)1831 5962 y(20)p eop end %%Page: 21 21 TeXDict begin 21 20 bop 140 231 a Fl(T)-7 b(o)41 b(restart)f(a)h(run,)k (it)c(is)h(necessary)d(to)i(ha)n(v)n(e)f(the)i(\014les)f Fk(loki.opt)p Fl(,)h Fk(loki.gen)c Fl(and)j Fk(loki.dat)d Fl(\(and)140 331 y Fk(loki.nrm)29 b Fl(if)k(a)g(p)r(olygenic)f (e\013ect)h(is)f(b)r(eing)h(\014tted\))h(in)f(addition)f(to)g(the)h (dump\014le.)53 b(It)33 b(is)g(not)f(necessary)140 431 y(to)f(k)n(eep)f(the)i(seed\014le,)f(as)g(the)g(seed)g(state)f(is)h (stored)f(in)h(the)h(dump\014le.)47 b(Normally)30 b(all)h(of)g(these)g (\014les)g(can)138 530 y(b)r(e)c(exc)n(hanged)d(b)r(et)n(w)n(een)i(mac) n(hines)f(of)h(di\013eren)n(t)g(t)n(yp)r(es,)g(so)g(a)f(run)h(started)f (on)h(a)f(Sun)i(Sparc)e(mac)n(hine)g(can)140 630 y(b)r(e)k(restarted)e (on)h(an)g(Lin)n(ux)g(In)n(tel)h(based)f(mac)n(hine,)g(with)h(the)g (same)e(results)h(as)g(if)h(it)f(had)h(b)r(een)f(restarted)140 729 y(on)g(the)h(same)f(mac)n(hine.)39 b(If)29 b(this)g(feature)f(is)g (to)g(b)r(e)h(used,)g(it)g(should)f(b)r(e)h(c)n(hec)n(k)n(ed)e(as)h (certain)g(mac)n(hines)g(do)140 829 y(not)i(follo)n(w)e(the)i (established)g(standards)e(for)h(\015oating)g(p)r(oin)n(t)g (arithmetic.)43 b(This)30 b(b)r(eha)n(viour)e(can)h(often)h(b)r(e)140 929 y(c)n(hanged)d(using)g(appropriate)f(compiler)h(\015ags)f(-)i(c)n (hec)n(k)e(y)n(our)h(compiler)f(man)n(ual.)140 1209 y Fh(6.3)112 b(Con)m(trolling)38 b(the)f(n)m(um)m(b)s(er)i(of)e(trait)g (lo)s(ci)137 1412 y Fl(By)23 b(default,)i(the)f(prior)f(on)h(the)g(the) g(n)n(um)n(b)r(er)g(of)f(trait)h(lo)r(ci)g(is)f(uniform)h(b)r(et)n(w)n (een)g(0)f(and)h(16,)g(with)g(a)g(starting)135 1512 y(v)-5 b(alue)23 b(of)f(0.)35 b(The)22 b(starting)g(n)n(um)n(b)r(er)g(of)h(lo) r(ci)f(and)g(the)h(prior)e(can)h(b)r(e)h(set)g(with)g(the)g(TRAIT)f (LOCI)g(command)140 1611 y(as)27 b(b)r(elo)n(w:)140 1818 y Fk(TRAIT)42 b(LOCI)f(0,10)140 1918 y(TRAIT)h(LOCI)f(MEAN)h(2)140 2018 y(START)g(TRAIT)f(LOCI)h(3)136 2225 y Fl(This)24 b(example)f(sets)g(the)h(range)f(for)g(trait)g(lo)r(ci)h(to)f(b)r(e)h (b)r(et)n(w)n(een)f(0)h(and)f(10,)h(\014ts)f(a)h(\(truncated\))g(P)n (oisson)d(prior)140 2324 y(with)30 b(mean)g(2)f(\(rather)g(than)h(a)g (uniform)g(prior\),)f(and)h(sets)f(the)i(starting)e(n)n(um)n(b)r(er)g (for)g(trait)h(lo)r(ci)g(to)f(b)r(e)i(3.)140 2424 y(These)c(n)n(um)n(b) r(ers)g(are)g(c)n(hec)n(k)n(ed)f(b)n(y)j Fk(loki)d Fl(for)h (consistency)-7 b(.)140 2704 y Fh(6.4)112 b(Setting)38 b(the)f(seed\014le)140 2907 y Fl(Initialisation)28 b(of)g(the)h(random) e(n)n(um)n(b)r(er)h(generator)e(used)j(b)n(y)g Fk(loki)e Fl(requires)g(a)g(seed\014le.)39 b(By)28 b(default)h(this)140 3007 y(is)j(called)g Fk(seedfile)p Fl(,)e(if)i(this)h(is)f(not)g(found) g(then)h(the)g(generator)d(is)i(initialized)g(using)g(a)f(\014xed)i(v) -5 b(alue.)50 b(If)140 3106 y(the)31 b(program)e(\014nishes)h(or)g(is)g (in)n(terrupted)h(then)g(the)g(curren)n(t)f(state)g(of)h(the)g (generator)d(is)j(written)g(out)f(to)140 3206 y(the)h(seed\014le)f(\(a) g(bac)n(kup)g(of)g(the)g(old)g(seed\014le)g(is)h(made)f(\014rst\).)45 b(If)37 b Fk(loki)28 b Fl(crashes)h(with)i(an)f(error)e(then)j(the)140 3306 y(seed\014le)f(is)g(not)f(up)r(dated,)j(allo)n(wing)c(the)i(run)g (to)g(b)r(e)g(rep)r(eated)g(\(and)g(hop)r(efully)g(determine)g(what)g (caused)140 3405 y(the)j(crash\).)51 b(This)33 b(default)g(b)r(eha)n (viour)e(can)h(b)r(e)h(c)n(hanged)f(using)g(the)h(SEEDFILE)f(command,)h (as)f(in)h(the)140 3505 y(examples)27 b(b)r(elo)n(w:)140 3712 y Fk(SEEDFILE)40 b("test.seedfile")140 3812 y(SEEDFILE)g ("my_seedfile",1)140 4019 y Fl(The)28 b(second)f(argumen)n(t)g(of)h(1)f (to)h(the)g(SEEDFILE)f(command)g(in)h(the)h(last)e(example)g(prev)n(en) n(t)g(the)i(seed\014le)140 4118 y(from)h(b)r(eing)h(o)n(v)n(erwritten)d (when)j Fk(loki)e Fl(\014nishes.)45 b(Using)30 b(this)h(form)f(of)g (the)h(command)f(allo)n(ws)f(a)h(series)f(of)140 4218 y(runs)e(to)h(b)r(e)g(rep)r(eated)f(with)h(the)g(same)f(seed\014le.)140 4498 y Fh(6.5)112 b(Setting)38 b(the)f(random)i(n)m(um)m(b)s(er)f (generator)134 4701 y Fl(If)21 b(m)n(ultiple)g(runs)f(of)27 b Fk(loki)19 b Fl(are)h(executed)h(in)g(parallel)e(\(on)i(m)n(ultiple)g (mac)n(hines)f(for)g(example,)i(of)e(on)h(di\013eren)n(t)140 4801 y(pro)r(cessors)35 b(on)i(the)h(same)f(mac)n(hine\),)j(it)e(is)f (generally)f(desirable)h(to)g(use)g(non-o)n(v)n(erlapping)e(streams)h (of)140 4901 y(random)h(n)n(um)n(b)r(ers)f(for)h(the)h(di\013eren)n(t)g (jobs.)66 b(This)38 b(is)f(di\016cult)h(to)g(ac)n(hiev)n(e)e(when)h (using)g(the)h(standard)140 5000 y(random)d(n)n(um)n(b)r(er)g (generator.)59 b(It)36 b(is)f(therefore)g(p)r(ossible)g(to)g(select)h (from)f(a)g(n)n(um)n(b)r(er)h(\(curren)n(tly)e(60\))h(of)140 5100 y(indep)r(enden)n(t)28 b(random)f(n)n(um)n(b)r(er)g(generators)f (using)h(the)h(SET)f(RNG)h(command,)g(for)f(example:)140 5307 y Fk(SET)42 b(RNG)h(0)g(#)g(The)f(default)f(setting)140 5406 y(SET)h(RNG)h(2)g(#)g(Switch)e(to)i(a)g(different)d(RNG)140 5613 y Fl(If)d(t)n(w)n(o)e(di\013eren)n(t)h Fk(loki)f Fl(runs)g(use)h(di\013eren)n(t)g(v)-5 b(alues)36 b(for)g(the)g(SET)g (RNG)h(command)e(then)i(the)f(random)138 5713 y(n)n(um)n(b)r(er)25 b(streams)f(supplied)i(to)f(the)g(runs)g(should)g(b)r(e)h(non-o)n(v)n (erlapping.)33 b(The)25 b(RNG)h(used)f(is)g(stored)g(in)g(the)1831 5962 y(21)p eop end %%Page: 22 22 TeXDict begin 22 21 bop 140 231 a Fl(seed\014le,)30 b(and)f(in)g(the)h (absence)f(of)g(a)g(SET)g(RNG)h(command,)f Fk(loki)f Fl(will)h(con)n(tin)n(ue)g(to)g(use)g(the)h(RNG)g(that)140 331 y(w)n(as)d(used)g(in)h(during)f(the)h(creation)f(of)g(the)h (seed\014le.)140 613 y Fh(6.6)112 b(Bac)m(kup)38 b(sc)m(hedules)140 816 y Fl(By)32 b(default,)j(b)r(efore)d(writing)g(to)h(a)f(dump\014le)i (or)d(output\014le,)k Fk(loki)c Fl(c)n(hec)n(ks)h(whether)g(a)g(\014le) h(of)g(the)g(same)140 916 y(name)f(exists)g(and,)h(if)f(it)h(do)r(es,)g (renames)e(the)h(old)g(\014le)h(b)n(y)e(adding)h(a)g(`)p Fk(~)p Fl(')g(c)n(haracter)e(on)n(to)h(the)i(end)f(of)g(the)140 1015 y(\014lename.)57 b(This)34 b(b)r(eha)n(viour)f(can)h(b)r(e)h(c)n (hanged)e(using)h(the)h(command)f Fk(SET)42 b(backups)32 b Fc(n)p Fl(,)j(where)f Fc(n)g Fl(is)h(an)140 1115 y(p)r(ositiv)n(e)d (in)n(teger)f(\(for)h(more)f(information)h(ab)r(out)g(the)h(SET)e (command)h(in)h Fk(loki)p Fl(,)e(see)h(Section)g(6.15\).)50 b(If)140 1215 y Fc(n)36 b Fl(=)g(0)g(then)g(bac)n(kups)f(are)f(turned)i (o\013,)i(if)e Fc(n)g Fl(=)h(1)e(then)h(the)g(default)g(b)r(eha)n (viour,)h(describ)r(ed)e(ab)r(o)n(v)n(e,)h(is)140 1314 y(follo)n(w)n(ed,)29 b(and)g(if)h Fc(n)c(>)g Fl(1)j(then)h(n)n(um)n(b)r (ered)f(bac)n(kups)g(are)f(pro)r(duced.)42 b(In)30 b(this)g(case,)f(a)g (series)f(of)i Fc(n)f Fl(bac)n(kup)140 1414 y(\014les)e(are)g(k)n(ept.) 36 b(If)28 b(the)g(original)e(\014le)h(w)n(as)g(called)g Fk(loki.dump)d Fl(and)j Fc(n)c(>)p Fl(=)f(3,)27 b(for)g(example,)g (then)h(the)g(three)138 1514 y(most)d(recen)n(t)g(bac)n(kup)g(v)n (ersions)f(of)h(this)h(\014le)g(w)n(ould)f(b)r(e)h Fk(loki.dump~1~)p Fl(,)21 b Fk(loki.dump~2~)p Fl(,)g Fk(loki.dump~3~)p Fl(,)140 1613 y(with)37 b Fk(loki.dump~1~)32 b Fl(b)r(eing)k(the)h (most)f(recen)n(t.)63 b(Note)37 b(that)f(for)g(the)h(seed\014le,)i(the) e(default)g(b)r(eha)n(viour)140 1713 y(\(when)28 b Fc(n)23 b Fl(=)g(1\))k(is)h(alw)n(a)n(ys)d(follo)n(w)n(ed,)i(irresp)r(ectiv)n (e)f(of)i(an)n(y)f Fk(SET)42 b(backups)25 b Fl(command.)140 1995 y Fh(6.7)112 b(POSITION)37 b(command)140 2198 y Fl(The)28 b(map)h(p)r(osition)f(of)g(mark)n(ers)f(is)h(set)h(using)f (the)g(P)n(osition)f(command.)39 b(The)29 b(format)f(is)g(v)n(ery)f (simple,)i(as)140 2298 y(is)e(sho)n(wn)g(b)n(y)h(the)g(examples)f(b)r (elo)n(w)g(\(map)h(distances)f(are)f(giv)n(en)h(in)h(cM\):)140 2514 y Fk(POSITION)40 b(D1G1)i(21.3)140 2613 y(POSITION)e(D4G\(3\))h (3.3,5.6)140 2829 y Fl(Mark)n(er)27 b(names)i(are)f(the)i(ones)e(used)h (in)h(the)f Fk(prep)f Fl(con)n(trol)g(\014le.)41 b(If)30 b(a)e(mark)n(er)g(sp)r(eci\014ed)h(in)h(a)e(POSITION)139 2929 y(command)d(is)h(not)g(found)h(then)f(the)g(statemen)n(t)h(will)f (b)r(e)g(silen)n(tly)g(ignored.)35 b(If)27 b(t)n(w)n(o)e(p)r(ositions)h (are)f(giv)n(en)g Fj(for)138 3028 y(any)i(marker)35 b Fl(\(as)24 b(in)h(the)g(second)g(example)f(ab)r(o)n(v)n(e\))g(then)h (it)g(is)g(assumed)f(that)i(a)e(sex)g(sp)r(eci\014c)h(map)g(is)g(b)r (eing)140 3128 y(used,)31 b(with)g(the)f(male)g(map)g(p)r(osition)g (coming)g(\014rst.)44 b(F)-7 b(or)30 b(more)f(details,)i(see)e(Section) i(6.16.)43 b(By)30 b(default,)140 3228 y(the)i(input)g(map)f(is)g (assumed)g(to)g(b)r(e)h(a)f(Haldane)f(map.)48 b(Kosam)n(bi)30 b(maps)h(can)g(b)r(e)h(input)g(using)f(the)g(MAP)140 3327 y(command)c(\(Section)h(6.8\))140 3477 y(The)36 b(ST)-7 b(AR)g(T)36 b(k)n(eyw)n(ord)e(can)i(b)r(e)g(added)g(at)g(the)g (b)r(eginning)g(of)f(a)h(KEYW)n(ORD)f(command)h(to)f(indicate)140 3576 y(that)30 b(the)g(p)r(osition)g(should)g(b)r(e)g(tak)n(en)f(as)h (a)f(starting)g(v)-5 b(alue,)31 b(and)e(that)h(Loki)g(should)f(sample)h (the)g(mark)n(er)140 3676 y(p)r(osition)d(at)h(eac)n(h)f(iteration,)g (for)g(example:)140 3892 y Fk(START)42 b(POSITION)e(D1G1)i(21.3)140 3991 y(START)g(POSITION)e(D4G\(3\))h(3.3,5.6)136 4207 y Fl(The)24 b(order)e(of)h(mark)n(ers)f(is)h(assumed)g(to)g(b)r(e)h (\014xed)g(and)f(is)h Fj(not)31 b Fl(sampled.)k(If)24 b(all)f(mark)n(ers)e(in)j(a)f(link)-5 b(age)23 b(group)137 4307 y(ha)n(v)n(e)g(p)r(ositions)h(whic)n(h)g(can)g(v)-5 b(ary)e(,)24 b(then)h(the)f(p)r(osition)g(of)h(the)f(\014rst)g(mark)n (er)f(is)h(arbitrarily)e(\014xed)i(to)h(pro)n(vide)140 4407 y(a)33 b(reference)g(p)r(oin)n(t.)54 b(If)34 b(an)n(y)f(mark)n(er) f(p)r(ositions)h(are)f(sampled,)j(then)f(Loki)f(will)h(generate)e(an)h (additional)140 4506 y(output)g(\014le)g Fk(loki.mpos)d Fl(\(Section)j(7.1.3\))f(whic)n(h)g(con)n(tains)g(the)i(sampled)e(p)r (ositions.)52 b(The)33 b(sc)n(hedule)g(for)140 4606 y(outputting)28 b(to)g(this)f(\014le)h(is)g(the)g(same)f(as)g(for)g Fk(loki.out)d Fl(\(Section)k(6.1\).)140 4888 y Fh(6.8)112 b(MAP)37 b(command)140 5091 y Fl(The)45 b(map)f(length)g(of)h(eac)n(h)e(link)-5 b(age)44 b(group)g(can)g(b)r(e)g(set)h(using)f(the)h(MAP)f(command;)53 b(in)44 b(addition,)140 5191 y(the)d(total)f(genome)f(length)i(can)f (also)f(b)r(e)i(set.)75 b(These)40 b(quan)n(tities)g(are)f(used)h(to)g (determine)h(the)g(prior)140 5290 y(probabilities)31 b(of)i(link)-5 b(age)31 b(to)h(a)g(region,)g(whic)n(h)g(is)g(in)n (tended)h(to)f(b)r(e)h(prop)r(ortional)d(to)i(the)h(length)f(of)g(that) 139 5390 y(region.)j(In)n(terpretation)26 b(of)h(the)g(output)g(from)f Fk(loki)f Fl(dep)r(ends)i(on)g(ho)n(w)f(these)h(are)e(set.)37 b Fe(It)31 b(is,)f(therefore,)140 5490 y(v)m(ery)39 b(imp)s(ortan)m(t)f (that)h(these)e(map)i(lengths)e(are)h(set)g(to)g(biologically)e (realistic)h(v)-5 b(alues)p Fl(.)53 b(F)-7 b(or)138 5589 y(Human)26 b(link)-5 b(age)25 b(analysis,)f(I)i(t)n(ypically)e(use)i(v) -5 b(alues)25 b(for)g(the)g(total)g(map)h(length)f(of)h(around)e (3000-4000)d(cM.)140 5689 y(Examples)27 b(of)g(the)h(use)g(of)f(MAP)h (commands)f(follo)n(w:)1831 5962 y(22)p eop end %%Page: 23 23 TeXDict begin 23 22 bop 140 231 a Fk(MAP)42 b("chromosome)d(1")k (0.0,54.0)140 331 y(MAP)f("chromosome)d(2")k(0.0,76.2)140 431 y(TOTAL)f(MAP)g(3600.0)137 628 y Fl(If)25 b(a)e(MAP)h(command)g (for)g(a)g(link)-5 b(age)23 b(group)g(is)h(not)g(presen)n(t,)h(then)f (the)h(MAP)f(range)f(is)h(set)g(to)g(the)h(range)d(of)140 727 y(mark)n(er)k(p)r(ositions)h(within)h(that)g(group.)35 b(If)28 b(a)f(TOT)-7 b(AL)28 b(MAP)f(command)g(is)h(not)f(presen)n(t)g (\(or)g(is)g(less)g(than)137 827 y(the)e(sum)g(of)g(the)g(map)f (lengths)h(of)f(link)-5 b(age)25 b(groups)e(in)i(the)g(analysis\))e (then)i(the)h(total)e(genome)g(length)g(is)h(set)140 926 y(to)32 b(the)g(sum)g(of)g(the)g(map)f(lengths)h(of)g(analyzed)f (link)-5 b(age)31 b(groups.)48 b(This)32 b(e\013ectiv)n(ely)g(means)f (that)h(in)g(this)140 1026 y(case)e(trait)h(lo)r(ci)g(ha)n(v)n(e)f(to)h (b)r(e)h(lo)r(cated)e(in)i(one)e(of)h(the)h(analyzed)e(link)-5 b(age)31 b(groups,)f(instead)h(of)g(there)g(b)r(eing)137 1126 y(some)25 b(probabilit)n(y)e(\(as)i(is)f(normal\))g(of)h(a)f (trait)h(lo)r(cus)f(b)r(eing)h(unlink)n(ed)g(to)f(an)n(y)g(group.)35 b(If)25 b(sex)f(sp)r(eci\014c)h(maps)140 1225 y(are)i(required)f(then)i (the)g(follo)n(wing)f(syn)n(tax)g(should)g(b)r(e)h(used:)140 1422 y Fk(MALE)42 b(MAP)g("chromosome)d(1")k(0.0,54.0)140 1522 y(FEMALE)e(MAP)h("chromosome)d(1")k(0.0,76.2)140 1622 y(TOTAL)f(MALE)f(MAP)i(360.0)140 1721 y(TOTAL)f(FEMALE)f(MAP)h (500.0)140 1918 y Fl(F)-7 b(or)27 b(more)g(details)g(on)g(sex)h(sp)r (eci\014c)f(maps,)h(see)f(Section)g(6.16.)133 2068 y(The)21 b(MAP)f(command)g(can)g(also)f(b)r(e)i(used)f(to)g(set)h(the)f(input)i (map)e(function)h(to)f(either)g(Haldane)g(or)f(Kosam)n(bi.)137 2167 y(By)24 b(default,)h Fk(loki)e Fl(assumes)g(that)h(the)h(input)g (map)f(uses)f(the)i(Haldane)e(map)i(function.)36 b(In)24 b(either)g(case,)g(the)140 2267 y(output)31 b(map)f(alw)n(a)n(ys)e (uses)i(the)h(Haldane)e(map)i(function.)45 b(Note)30 b(that)h(man)n(y)e(maps)h(whic)n(h)g(are)g(a)n(v)-5 b(ailable)140 2366 y(o)n(v)n(er)26 b(the)h(w)n(eb)h(are)e(Kosam)n(bi)g(maps;)h(a)g (go)r(o)r(d)g(example)g(of)g(this)h(w)n(ould)f(b)r(e)h(the)g (Marsh\014eld)f(genetic)g(maps.)140 2466 y(T)-7 b(o)27 b(use)h(a)f(Kosam)n(bi)f(input)i(map,)g(the)g(follo)n(wing)e(command)i (should)f(b)r(e)h(used:)140 2663 y Fk(MAP)42 b(FUNCTION)f(KOSAMBI)140 2941 y Fh(6.9)112 b(FREQUENCY)36 b(command)140 3144 y Fl(This)f(command)f(allo)n(ws)g(the)h(frequency)f(of)h(mark)n(er)e (alleles)h(to)h(b)r(e)g(set.)59 b(F)-7 b(requencies)34 b(of)g(trait)h(lo)r(ci)g(can)140 3244 y(not)c(b)r(e)g(set.)46 b(A)31 b(Diric)n(hlet\(1)p Fc(;)14 b Fl(1)p Fc(;)g(:)g(:)g(:)f(;)h Fl(1\))30 b(prior)g(\(whic)n(h)h(is)f(`uniform')h(in)g(some)f(sense\))g (is)h(put)g(on)g(the)g(allele)135 3343 y(frequencies)22 b(of)g(alleles)g(with)h(unset)g(frequencies,)f(and)h(the)f(frequencies) g(are)g(in)n(tegrated)f(o)n(v)n(er.)33 b(This)23 b(default)140 3443 y(option)34 b(is)g(often)h(preferable)e(unless)h(v)n(ery)f(go)r(o) r(d)h(frequency)g(information)g(is)g(a)n(v)-5 b(ailable.)56 b(Some)34 b(example)140 3543 y(FREQUENCY)27 b(commands)g(are)g(giv)n (en)g(b)r(elo)n(w:)140 3740 y Fk(FREQUENCY)40 b(D1G1)i(A,0.2)f(B,0.25)g (C,0.4)h(D,0.15)140 3839 y(FREQUENCY)e(MK1)i(113,.6)f(117,.1)g(118,.1)h (119,.1)f(111,.05)f(109,.05)139 4036 y Fl(Note)27 b(that)g(if)g(there)f (are)g(sev)n(eral)f(genetic)h(groups)g(\(Section)g(5.4\))h(then)g(m)n (ultiple)g(frequencies)f(will)h(ha)n(v)n(e)e(to)140 4136 y(b)r(e)34 b(sp)r(eci\014ed)g(for)f(eac)n(h)g(allele.)55 b(T)-7 b(o)33 b(indicate)h(whic)n(h)f(group)g(a)g(particular)g (frequency)g(corresp)r(onds)f(to,)j(a)133 4236 y(GR)n(OUP)19 b(ORDER)h(command)g(\(Section)g(6.11\))f(m)n(ust)h(app)r(ear)e(b)r (efore)i(the)g(\014rst)g(FREQUENCY)g(command.)137 4385 y(Not)j(all)h(alleles)f(ha)n(v)n(e)f(to)i(b)r(e)g(set,)h(in)f(whic)n(h) f(case)g(the)h(frequencies)f(of)h(the)g(remaining)f(alleles)g(are)g(in) n(tegrated)136 4485 y(o)n(v)n(er.)34 b(If)24 b(frequencies)f(are)g(giv) n(en)g(for)g(alleles)g Fj(not)31 b Fl(segregating)21 b(in)j(the)g(dataset)f(b)r(eing)h(analyzed,)g(then)g(these)140 4584 y(alleles)34 b(will)h(b)r(e)h(lump)r(ed)f(together.)58 b(If)35 b(no)g(`extra)f(alleles')g(are)g(sp)r(eci\014ed)h(then)h(it)f (is)g(assumed)f(that)h(the)140 4684 y(only)d(alleles)f(segregating)f (in)i(the)g(p)r(opulation)g(are)f(those)g(found)i(in)f(the)g (data\014le)g(\(but)h(see)e(b)r(elo)n(w\).)50 b(If)33 b(a)140 4784 y(frequency)27 b(is)h(giv)n(en)e(as)h Fk(*)h Fl(then)g(that)g(frequency)f(is)g(regarded)f(as)h(b)r(eing)h(unset.)136 4933 y(Starting)23 b(v)-5 b(alues)24 b(for)f(allele)g(frequencies)g (can)g(b)r(e)h(set)g(using)f(the)h(ST)-7 b(AR)g(T)24 b(FREQUENCY)f(command,)h(with)140 5033 y(the)35 b(same)f(format)f(as)h (the)h(basic)f(FREQUENCY)g(command.)56 b(This)35 b(can)f(b)r(e)h(used)f (to)g(allo)n(w)f(for)h(`extra)140 5132 y(alleles')27 b(in)h(the)g(analysis)e(without)i(ha)n(ving)f(to)g(kno)n(w)g(their)g (frequencies.)140 5410 y Fh(6.10)112 b(Estimating)38 b(mark)m(er)g(allele)h(frequencies)138 5613 y Fl(Normally)25 b(the)h(estimates)f(of)g(mark)n(er)f(allele)h(frequencies)g(are)g(not)g (output.)37 b(Sometimes,)26 b(ho)n(w)n(ev)n(er,)e(it)i(ma)n(y)138 5713 y(b)r(e)f(useful)g(to)g(ha)n(v)n(e)e(this)j(information.)35 b(Loki)24 b(can)h(b)r(e)g(told)g(to)f(output)i(the)f(mark)n(er)e (frequency)h(information)1831 5962 y(23)p eop end %%Page: 24 24 TeXDict begin 24 23 bop 140 231 a Fl(using)27 b(a)g(new)h(form)f(of)h (the)g(OUTPUT)f(FREQUENCY)g(command)h(as)f(sho)n(wn)f(b)r(elo)n(w:)140 447 y Fk(OUTPUT)41 b(FREQUENCY)f("freqfile")140 663 y Fl(This)28 b(will)h(instruct)g(Loki)f(to)g(output)h(all)f(mark)n(er)f (allele)h(frequencies)g(to)g(the)h(\014le)g(freq\014le.)39 b(Estimates)28 b(will)140 763 y(b)r(e)33 b(output)g(using)f(the)g(same) g(sc)n(hedule)g(as)g(for)g(the)h(main)f(Loki)g(output)h(\014le.)51 b(The)32 b(structure)g(of)h(freq\014le,)140 862 y(and)27 b(ho)n(w)g(to)h(pro)r(cess)e(the)i(results)f(is)h(discussed)f(in)h (Section)f(7.1.4)140 1145 y Fh(6.11)112 b(GR)m(OUP)37 b(ORDER)f(command)134 1348 y Fl(If)22 b(the)g(founder)e(individuals)i (come)e(from)h(m)n(ultiple)h(genetic)f(groups,)g(as)g(sp)r(eci\014ed)g (b)n(y)g(a)g(GR)n(OUP)f(command)134 1447 y(in)h(the)g(con)n(trol)f (\014le)h(\(Section)g(5.4\),)h(then)f(separate)f(allele)g(frequencies)h (should)f(b)r(e)i(sp)r(eci\014ed)f(for)f(eac)n(h)g(group.)133 1547 y(This)h(is)f(done)g(b)n(y)g(including)h(m)n(ultiple)g(frequency)f (v)-5 b(alues)20 b(for)f(eac)n(h)h(allele)g(in)g(the)h(FREQUENCY)f (command)138 1646 y(\(see)25 b(ab)r(o)n(v)n(e\).)35 b(Before)24 b(the)i(FREQUENCY)f(command)f(app)r(ears)g(in)i(the)f(parameter)f (\014le)i(it)f(is)g(necessary)f(to)138 1746 y(sp)r(ecify)i(the)g(group) f(order)f(for)i(the)g(frequencies.)35 b(F)-7 b(or)26 b(example,)f(if)i(there)e(are)g(2)g(genetic)h(groups,)e(A)j(and)e(B,) 140 1846 y(then)j(eac)n(h)f(allele)g(should)g(ha)n(v)n(e)g(2)g (frequencies)g(sp)r(eci\014ed)h(for)f(it,)h(and)g(the)g(statemen)n(t:) 140 2062 y Fk(GROUP)42 b(ORDER)f(A,B)137 2277 y Fl(indicates)24 b(that)g(the)h(\014rst)f(frequency)g(is)g(for)f(group)g(A)i(and)f(the)g (second)g(for)f(group)g(B.)i(A)f(GR)n(OUP)g(ORDER)135 2377 y(statemen)n(t)f(will)f(a\013ect)h(all)f(FREQUENCY)g(commands)f (that)i(follo)n(w)e(it)i(\(un)n(til)g(another)f(GR)n(OUP)f(ORDER)140 2477 y(statemen)n(t)28 b(app)r(ears\).)140 2759 y Fh(6.12)112 b(MEAN)37 b(and)h(V)-12 b(ARIANCE)35 b(commands)138 2962 y Fl(It)26 b(is)g(p)r(ossible)f(to)h(\014x)g(the)g(v)-5 b(alues)25 b(of)h(the)g(o)n(v)n(erall)e(mean)h(and)h(residual)e(v)-5 b(ariance,)25 b(or)g(to)h(set)g(starting)e(v)-5 b(alues)140 3062 y(for)27 b(these)h(parameters.)35 b(The)28 b(format)f(of)g(the)h (commands)f(is)h(demonstrated)e(b)r(elo)n(w:)140 3277 y Fk(MEAN)42 b(10.0)140 3377 y(RESIDUAL)e(VARIANCE)h(100.0)140 3593 y Fl(As)29 b(with)g(the)g(FREQUENCY)g(command,)g(these)f(can)h(b)r (e)g(preceeded)f(b)n(y)h(the)g(ST)-7 b(AR)g(T)29 b(k)n(eyw)n(ord)e(to)i (set)g(a)140 3693 y(starting)e(v)-5 b(alue)27 b(for)g(the)h(parameter.) 140 3975 y Fh(6.13)112 b(ESTIMA)-9 b(TE)36 b(IBD)h(command)140 4178 y Fl(If)42 b Fk(loki)35 b Fl(is)g(b)r(eing)h(used)f(to)h (estimated)f(IBD)h(relationships)f(\(realized)g(kinship)g(co)r (e\016cien)n(ts\),)j(then)e(this)140 4277 y(command)e(is)h(used)f(to)h (sp)r(ecify)g(at)f(whic)n(h)h(map)f(p)r(ositions)h(estimation)f(should) g(b)r(e)h(made.)58 b(The)35 b(output)140 4377 y(format)j(and)h(in)n (terpretation)e(is)i(discussed)f(in)h(Section)g(7.3.)69 b(The)39 b(format)f(of)g(the)h(command)g(is)f(giv)n(en)140 4477 y(b)r(elo)n(w:)140 4693 y Fk(ESTIMATE)i(IBD)j(0,10.0,13.2)140 4792 y(ESTIMATE)d(IBD)j(Chrom1,0,10.0,1)o(3.2)140 4892 y(ESTIMATE)d(IBD)j(MARKERS)140 4991 y(ESTIMATE)d(IBD)j(MARKERS)d (Chrom2)140 5091 y(ESTIMATE)g(IBD)j(GRID)f(0,100,1)140 5191 y(ESTIMATE)e(IBD)j(GRID)f(Chrom7)f(0,80,.5)140 5407 y Fl(Note)d(that)g(sp)r(eci\014cation)f(of)g(a)h(link)-5 b(age)37 b(group)f(is)i(required)e(when)i(there)g(are)e(more)h(than)h (one)f(link)-5 b(age)139 5506 y(groups,)25 b(and)h(optional)f (otherwise.)36 b(There)26 b(is)g(no)f(b)r(ene\014t)j(in)e(estimating)g (IBD)g(relationships)f(for)h(m)n(ultiple)140 5606 y(c)n(hromosomes)43 b(sim)n(ultaneously)-7 b(.)91 b(Ho)n(w)n(ev)n(er,)48 b(sp)r(eci\014cation)e(of)f(the)h(link)-5 b(age)46 b(group)e(is)i (recommended)140 5705 y(b)r(ecause)30 b(it)g(pro)n(vides)f(an)h(easy)g (w)n(a)n(y)e(to)j(ha)n(v)n(e)e(link)-5 b(age)29 b(group)g(sp)r (eci\014c)i(p)r(ositions.)44 b(The)30 b(MARKERS)h(and)1831 5962 y(24)p eop end %%Page: 25 25 TeXDict begin 25 24 bop 137 231 a Fl(GRID)25 b(k)n(eyw)n(ords)d(pro)n (vide)h(a)h(shortcut)g(for)g(sp)r(ecifying)g(p)r(ositions)g(either)g (at)g(eac)n(h)g(mark)n(ers)e(p)r(osition,)j(or)e(at)138 331 y(regular)g(grid)h(p)r(ositions.)36 b(F)-7 b(or)24 b(the)i(GRID)f(k)n(eyw)n(ord,)f(it)i(is)f(necessary)e(to)i(supply)g (the)g(start)g(and)f(end)i(p)r(oin)n(ts)138 431 y(of)g(the)g(grid,)f (as)g(w)n(ell)g(as)g(the)h(grid)f(size.)36 b(Note)25 b(-)g(it)h(is)g(strongly)e(recommended)h(that)h(the)g(lm)p 3102 431 25 4 v 30 w(ratio)e(is)i(set)f(to)140 530 y(a)i(high)h(v)-5 b(alue)27 b(when)h(m)n(ultip)r(oin)n(t)g(IBD)g(estimation)f(is)h(b)r (eing)g(p)r(erformed)f(6.15.)140 812 y Fh(6.14)112 b(ANAL)-9 b(YSIS)37 b(command)138 1015 y Fl(The)26 b(ANAL)-7 b(YSIS)27 b(command)e(is)h(used)f(to)h(instruct)f Fk(loki)f Fl(to)i(use)f(a)h (non{standard)d(analysis)i(\(normally)f(an)136 1115 y(IBD)f(sharing)e (analysis\).)34 b(By)23 b(default)g Fk(loki)e Fl(will)i(p)r(erform)f(a) h(quan)n(titativ)n(e)f(trait)g(lo)r(cus)g(analysis)g(unless)g(the)140 1215 y(ANAL)-7 b(YSIS)31 b(or)d(ESTIMA)-7 b(TE)29 b(IBD)g(\(Section)g (6.13\))f(commands)h(are)f(used.)42 b(Curren)n(tly)-7 b(,)29 b(the)g(only)g(usable)140 1314 y(forms)e(for)g(this)h(commands)f (are:)140 1530 y Fk(ANALYZE)41 b(AFFECTED,IBD)140 1630 y(ANALYZE)g(AFFECTED,IBD,NU)o(LL)140 1846 y Fl(Note)30 b(that)g(the)f(order)g(of)g(the)h(parameters)e(is)i(not)f(signi\014can) n(t.)42 b(The)30 b(\014rst)f(example)g(ab)r(o)n(v)n(e)g(will)g (estimate)140 1945 y(IBD)34 b(sharing)f(amongst)g(a\013ecteds)h(\(as)f (determined)h(b)n(y)g(the)g(AFFECTED)g(command)g(,)h(Section)f(5.17\).) 139 2045 y(The)27 b(second)e(example)i(will)f(estimate)h(the)g(n)n(ull) f(distribution)h(of)f(the)h(sharing)e(statistic.)37 b(The)26 b(use)h(of)f(these)140 2145 y(is)h(explained)h(more)f(in)g(Section)h (7.2.)140 2427 y Fh(6.15)112 b(SET)37 b(command)140 2630 y Fl(As)c(with)h Fk(prep)p Fl(,)f Fk(loki)f Fl(has)g(a)h(n)n(um)n(b)r (er)g(of)g(in)n(ternal)g(v)-5 b(ariables)32 b(whic)n(h)h(can)g(b)r(e)g (set)g(to)g(in\015uence)h(the)g(w)n(a)n(y)140 2729 y(it)k(runs.)67 b(Some)37 b(of)h(these)g(v)-5 b(ariables)36 b(are)h(mainly)g(for)g (debugging,)j(but)e(sev)n(eral)e(are)h(for)g(more)g(general)140 2829 y(op)r(erations)26 b(\(for)i(example,)f(see)g(Sections)g(6.6,)g (6.17\).)36 b(The)28 b(more)f(useful)h(options)f(are)f(listed)i(b)r (elo)n(w:)265 3045 y Fd(\017)41 b Fl(bac)n(kups)348 3145 y(Set)28 b(bac)n(kup)f(sc)n(hedule)g(-)g(see)g(Section)h(6.6.)265 3311 y Fd(\017)41 b Fl(tau)p 473 3311 V 29 w(mo)r(de,)28 b(tau)p 869 3311 V 30 w(b)r(eta)348 3410 y(Set)g(prior)e(on)h(trait)h (lo)r(ci)f(e\013ects)h(-)f(see)h(Section)f(6.17.)265 3576 y Fd(\017)41 b Fl(no)p 441 3576 V 29 w(o)n(v)n(erdominan)n(t)26 b(1)375 3676 y(F)-7 b(orces)27 b(the)h(heterozygote)e(e\013ect)i(of)f (all)h(trait)f(lo)r(ci)g(to)h(b)r(e)g(b)r(et)n(w)n(een)f(the)h (homozygote)e(e\013ects.)265 3842 y Fd(\017)41 b Fl(lm)p 445 3842 V 30 w(ratio)348 3942 y(Sets)30 b(the)h(frequency)f(of)g(M)h (steps)f Fj(vs.)46 b Fl(L)30 b(steps)g(for)g(the)h(LM)f(sampler.)44 b(This)31 b(can)f(greatly)f(impro)n(v)n(e)348 4041 y(the)g(mixing)h(of) f(the)h(sampler)e(and)i(the)g(use)f(of)g(high)h(v)-5 b(alues)29 b(of)g(the)h(ratio)e(\()p Fc(>)e(:)p Fl(5\))k(is)f (recommended.)348 4141 y(Note)c(that)h(the)g(L)f(sampler)g(is)g (required)f(to)i(guaran)n(tee)d(irreducibilit)n(y)-7 b(,)26 b(so)e(setting)i(the)g(ratio)e(to)h(high)348 4240 y(can)f(b)r(e)h(coun)n(terpro)r(ductiv)n(e.)34 b(Use)25 b(of)f(this)h(option)g(with)g(the)g(quan)n(titativ)n(e)f(trait)g (analysis)f(will)i(often)348 4340 y(signi\014can)n(tly)35 b(slo)n(w)g(do)n(wn)g(the)h(sampler)f(so)g(it)i(ma)n(y)e(b)r(e)h(b)r (etter)h(to)e(use)h(lo)n(w)f(v)-5 b(alues)36 b(for)f(the)h(ratio)348 4440 y(\()p Fc(<)22 b(:)p Fl(2\))28 b(in)g(this)g(case)265 4606 y Fd(\017)41 b Fl(debug)p 570 4606 V 29 w(lev)n(el,)27 b(p)r(eel)p 956 4606 V 31 w(trace)348 4705 y(Pro)n(vide)g(debugging)h (information)h(on)f(the)i(in)n(ternal)e(w)n(orkings)g(of)35 b Fk(loki)p Fl(.)40 b(The)29 b(higher)g(the)g(setting,)348 4805 y(the)43 b(more)f(information)g(giv)n(en)h(\(upto)g(a)f(p)r(oin)n (t.)14 b(.)g(.)g(\).)84 b(These)42 b(generally)g(ha)n(v)n(e)f(no)i (e\013ect)h(unless)348 4905 y Fk(loki)g Fl(w)n(as)i(compiled)g(with)h (the)g Fk(-DDEBUG)c Fl(and/or)i Fk(-DTRACE_PEEL)c Fl(compiler)46 b(\015ags)f(set.)93 b(See)348 5004 y Fk(include/config.)o(h)22 b Fl(for)27 b(details.)140 5287 y Fh(6.16)112 b(Sex)38 b(sp)s(eci\014c)g(maps)140 5490 y Fl(If)32 b(the)g(SEX)f(command)h (\(Section)f(5.3\))g(w)n(as)g(sp)r(eci\014ed)h(in)f(command)h(\014le)f (for)g Fk(prep)p Fl(,)g(then)h Fk(loki)e Fl(can)i(use)139 5589 y(sex)26 b(sp)r(eci\014c)h(maps.)36 b(In)26 b(this)h(case,)f(a)g (sex)g(sp)r(eci\014c)h(mark)n(er)d(map)j(is)f(sp)r(eci\014ed,)h(and)g Fk(loki)d Fl(will)j(then)g(rep)r(ort)140 5689 y(a)i(male)g(and)f (female)i(map)f(p)r(osition)f(for)h(eac)n(h)f(trait)h(lo)r(cus.)41 b(A)30 b(c)n(hec)n(k)e(is)h(made)g(that)g(map)g(orders)f(in)h(b)r(oth) 1831 5962 y(25)p eop end %%Page: 26 26 TeXDict begin 26 25 bop 140 231 a Fl(maps)29 b(are)g(the)h(same.)42 b(As)29 b(w)n(ould)g(b)r(e)h(exp)r(ected,)g(a)g(trait)f(lo)r(cus)g (will)h(alw)n(a)n(ys)d(b)r(e)j(in)g(the)g(same)f(in)n(terv)-5 b(al)29 b(on)139 331 y(b)r(oth)f(maps!)36 b(The)27 b(use)g(of)g(sex)f (sp)r(eci\014c)i(maps)e(is)h(switc)n(hed)g(on)g(b)n(y)f(using)h(the)g (sex)g(sp)r(eci\014c)g(forms)f(of)h(either)140 431 y(the)32 b(POSITION)e(or)h(MAP)g(commands)g(\(Sections)h(6.7,6.8\).)47 b(Note)32 b(that)f(if)h(some)f(POSITION)g(or)f(MAP)136 530 y(statemen)n(ts)24 b(use)f(the)h(sex)g(sp)r(eci\014c)f(forms,)h (and)g(others)f(do)g(not,)i(then)f(sex)f(sp)r(eci\014c)h(maps)f(will)h (still)g(b)r(e)g(used.)140 630 y(Where)35 b(only)f(a)h(single)f (\014gure)g(has)h(b)r(een)g(pro)n(vided)f(for)g(a)h(map)g(length)g(or)f (mark)n(er)f(p)r(osition,)k(then)e(this)140 729 y(\014gure)27 b(will)h(b)r(e)g(used)f(for)g(b)r(oth)h(male)g(and)f(female)h(maps.)140 1012 y Fh(6.17)112 b(Setting)38 b(the)f(prior)g(on)h(trait)f(lo)s(ci)h (e\013ects)140 1215 y Fl(The)28 b(trait)f(lo)r(ci)h(e\013ects)f(ha)n(v) n(e)g(a)g(normal)g(prior)f(whic)n(h)h(b)n(y)h(default)g(is)f Fc(N)9 b Fl(\(0)p Fc(;)14 b(\034)9 b Fl(\),)28 b(where)g Fc(\034)37 b Fl(is)27 b(determined)h(b)n(y)140 1314 y(an)f(in)n (teraction)g(b)r(et)n(w)n(een)h(the)g(in)n(ternal)e(v)-5 b(ariables)27 b Fk(tau_beta)d Fl(and)k Fk(tau_mode)p Fl(.)33 b(These)28 b(default)g(to)f(2)g(and)140 1414 y(0)g(resp)r(ectiv)n(ely)-7 b(,)27 b(but)h(can)f(b)r(e)h(c)n(hanged)f (using)g(the)h(commands)f(SET)g(tau)p 2502 1414 25 4 v 30 w(mo)r(de)h(and)f(SET)h(tau)p 3228 1414 V 29 w(b)r(eta)g(\(for)140 1514 y(more)f(details)g(on)g(the)h(SET)g(command,)f(see)g(Section)h (6.15\).)36 b(Dep)r(ending)28 b(on)f(the)h(v)-5 b(alue)28 b(of)f(tau)p 3234 1514 V 30 w(mo)r(de,)h Fc(\034)140 1613 y Fl(is)f(set)h(as)f(follo)n(ws:)265 1829 y Fd(\017)41 b Fl(tau)p 473 1829 V 29 w(mo)r(de)23 b(=)g(0)k(\(default\):)38 b Fc(\034)g Fl(is)27 b(set)h(equal)f(to)g(tau)p 1981 1829 V 30 w(b)r(eta)h Fd(\002)f Fl(the)h Fj(starting)35 b Fl(residual)27 b(v)-5 b(ariance.)265 1995 y Fd(\017)41 b Fl(tau)p 473 1995 V 29 w(mo)r(de)23 b(=)g(1:)37 b Fc(\034)g Fl(is)27 b(set)h(equal)f(to)h(tau)p 1638 1995 V 29 w(b)r(eta.)265 2161 y Fd(\017)41 b Fl(tau)p 473 2161 V 29 w(mo)r(de)23 b(=)g(2:)35 b Fc(\034)g Fl(is)25 b(set)h(equal)e(to)h(tau)p 1624 2161 V 30 w(b)r(eta)h Fd(\002)e Fl(the)i Fj(curr)l(ent)32 b Fl(residual)24 b(v)-5 b(ariance)24 b(at)i(eac)n(h)e(iteration.)140 2443 y Fh(6.18)112 b(Estimation)38 b(of)g(Breeding)g(V)-9 b(alues)132 2646 y Fl(If)19 b(an)g(unlink)n(ed)g(p)r(olygenic)f (e\013ect)i(is)e(b)r(eing)h(\014tted,)j(the)d(at)g(eac)n(h)f(iteration) g(Loki)g(will)h(calculate)g(the)g(p)r(olygenic)137 2746 y(additiv)n(e)24 b(e\013ect,)h(or)e(breeding)g(v)-5 b(alue,)25 b(for)f(eac)n(h)f(individual.)36 b(F)-7 b(or)23 b(some)h(applications)f (these)h(v)-5 b(alues)24 b(ma)n(y)f(b)r(e)139 2845 y(of)k(in)n(terest)f (in)h(themselv)n(es,)g(so)f(an)g(option)h(is)g(pro)n(vided)e(to)i (calculate)f(the)h(a)n(v)n(erage)d(v)-5 b(alue)27 b(of)g(the)g (breeding)140 2945 y(v)-5 b(alues)27 b(and)h(write)f(them)h(to)g(a)f (\014le.)37 b(This)28 b(option)f(is)g(selected)h(as)f(follo)n(ws:)140 3161 y Fk(OUTPUT)41 b(POLYGENIC)f("filename")140 3377 y Fl(The)31 b(estimates)h(are)e(only)h(written)h(once,)f(at)h(the)g (end)f(of)h(the)f(analysis)f(run)i(\(either)f(the)h(sc)n(heduled)f (end,)140 3476 y(or)d(when)h(the)g(run)g(is)f(in)n(terrupted.)40 b(The)29 b(v)-5 b(alues)28 b(are)g(also)g(written)h(to)f(the)i(dump)f (\014le,)g(so)f(breeding)g(v)-5 b(alue)136 3576 y(estimation)23 b(runs)g(can)g(b)r(e)g(restarted.)35 b(The)23 b(format)g(of)g(the)h (output)f(\014le)h(is)f(simply)g(id)h(follo)n(w)n(ed)e(b)n(y)h(the)g (mean)140 3676 y(nad)k(standard)g(deviation)g(of)h(the)g(breeding)f(v) -5 b(alue)27 b(for)g(eac)n(h)g(individual.)140 4000 y Fo(7)135 b(Analysis)45 b(of)g(output)140 4232 y Fl(Normally)-7 b(,)43 b(output)e(from)e Fk(loki)g Fl(is)h(written)h(to)f(the)h (out\014les)f(\(b)n(y)g(default)h Fk(loki.out)p Fl(,)f Fk(loki.pos)e Fl(and)140 4331 y Fk(loki.mpos)27 b Fl(if)k(mark)n(er)d (p)r(ositions)i(are)f(allo)n(w)n(ed)g(to)i(v)-5 b(ary)e(,)30 b(but)h(see)f(OUTPUT)g(FILE)g(command,)g(Section)132 4431 y(6.1\).)j(There)18 b(ma)n(y)g(b)r(e)h(additional)f(output)h (\014les)f(pro)r(duced)g(dep)r(ending)h(on)f(the)h(options)f(set)g(in)h (the)g(parameter)140 4530 y(\014le.)39 b(The)28 b(form)g(of)g(the)g (output)h(from)f Fk(loki)e Fl(dep)r(ends)j(on)e(whic)n(h)i(analysis)d (has)i(b)r(een)g(c)n(hosen)g(and)g(v)-5 b(arious)140 4630 y(parameter)27 b(settings.)41 b(Unless)28 b(the)h(ESTIMA)-7 b(TE)29 b(IBD)g(or)f(ANAL)-7 b(YSIS)30 b(commands)e(\(Sections)h (6.13,6.14\))140 4730 y(ha)n(v)n(e)37 b(b)r(een)h(sp)r(eci\014ed)h(in)f (the)h(parameter)d(\014le,)41 b(the)e(default)f(analysis)f(is)h(the)g (quan)n(titativ)n(e)g(trait)g(lo)r(cus)140 4829 y(analysis,)26 b(whic)n(h)i(is)f(discussed)g(b)r(elo)n(w.)140 5111 y Fh(7.1)112 b(Quan)m(titativ)m(e)38 b(trait)f(lo)s(cus)h(analysis)140 5315 y Fl(The)27 b(output)h(consists)e(of)h(a)g(set)g(of)g (realizations)f(of)h(a)g(subset)g(of)g(mo)r(del)h(parameters)d(from)i (eac)n(h)f(sampling)140 5414 y(iteration)37 b(that)h(output)g(is)f (requested)g(for)g(\(con)n(trolled)f(b)n(y)i(the)f(parameter)f(\014le)i (giv)n(en)f(to)g Fk(loki)p Fl(\).)65 b(The)140 5514 y(main)31 b(output)h(is)g(sen)n(t)f(to)g(the)h(\014le)f Fk(loki.out)p Fl(.)46 b(More)30 b(detailed)i(information)e(on)h(QTL)g(p)r(ositions)g (is)h(sen)n(t)139 5613 y(to)27 b Fk(loki.pos)p Fl(,)d(and)j (information)f(on)h(mark)n(er)e(p)r(ositions)h(when)i(they)f(are)f (sampled)g(is)h(sen)n(t)g(to)g Fk(loki.mpos)140 5713 y Fl(\(Section)h(7.1.3\).)36 b(These)27 b(last)g(t)n(w)n(o)g(\014les)h (are)e(new)i(to)f(loki)p 1994 5713 V 30 w(2.3.)1831 5962 y(26)p eop end %%Page: 27 27 TeXDict begin 27 26 bop 140 231 a Fe(7.1.1)94 b(Output)32 b(\014le)f Fk(loki.out)140 434 y Fl(A)n(t)36 b(the)g(start)f(of)h Fk(loki.out)c Fl(is)k(a)f(header)g(whic)n(h)g(giv)n(es)g(information)g (ab)r(out)g(the)i(\014le)e(format.)61 b(First)35 b(is)140 534 y(displa)n(y)n(ed)26 b(information)g(on)h(the)h(v)n(ersion)e(of)h (Loki)g(used,)g(the)h(date)f(and)g(time)h(the)f(program)e(w)n(as)i (run,)g(and)134 634 y(the)20 b(t)n(yp)r(e)h(of)f(output)h(format)f (requested.)34 b(This)20 b(mak)n(es)f(it)i(p)r(ossible)f(for)g (utilities)h(suc)n(h)f(as)g Fk(loki)p 3140 634 27 4 v 29 w(ext)g Fl(\(Section)138 733 y(8\))26 b(to)g(pro)r(cess)f(the)h (output)g(\014le)g(irresp)r(ectiv)n(e)f(of)h(whic)n(h)f(Loki)h(v)n (ersion)e(is)i(used.)36 b(The)26 b(exact)f(output)h(format)140 833 y(dep)r(ends)31 b(on)g(the)g(output)g(t)n(yp)r(e)h(requested,)f(on) f(the)h(mo)r(del,)h(on)f(the)g(mark)n(ers)e(included)i(in)g(the)h (analysis,)137 933 y(and)25 b(on)f(v)-5 b(arious)23 b(quan)n(tities)h (set)h(in)f(the)h(parameter)e(\014le.)36 b(The)25 b(examples)f(giv)n (en)f(b)r(elo)n(w)h(are)g(for)g(the)h(default)138 1032 y(output)h(t)n(yp)r(e)f(for)g(loki)p 854 1032 25 4 v 29 w(2.4.)36 b(Previous)23 b(v)n(ersions)h(of)h(Loki)f(tended)i(to)f (giv)n(e)g(less)f(information)h(in)h(the)f(header,)140 1132 y(but)j(w)n(ere)f(basically)f(similar.)36 b(An)29 b(example)e(of)g(the)h(\014rst)g(t)n(w)n(o)e(lines)i(w)n(ould)f(b)r(e:) 140 1346 y Fk(Created)41 b(by)h(loki)g(2.3.0:)f(Fri)i(Aug)f(18)h (07:51:14)d(2000)140 1445 y(Output)h(format:)g(2)140 1659 y Fl(After)28 b(this)g(comes)f(the)h(mo)r(del)g(b)r(eing)f(used)h (for)f(the)h(analysis:)140 1874 y Fk(Model:)41 b(Q\(1\))h(=)h(QTL)g(+)g (AGE_AT_EXAM)c(+)k(SX)139 2088 y Fl(This)27 b(is)g(follo)n(w)n(ed)f(b)n (y)h(information)f(on)h(an)n(y)f(mark)n(er)f(lo)r(ci)i(b)r(eing)g(mo)r (delled.)37 b(Eac)n(h)26 b(link)-5 b(age)26 b(group)g(is)h(listed)140 2187 y(in)h(map)f(order,)g(with)h(the)g(name)f(and)h(map)f(p)r(osition) g(of)h(eac)n(h)f(mark)n(er)f(b)r(eing)h(displa)n(y)n(ed.)140 2401 y Fk(Linkage)41 b(groups:)227 2501 y(1:)i(chrom_1)84 b(Map)43 b(range:)84 b(\(70cM)42 b(to)h(130cM\))314 2600 y(D1S2866)e(-)i(98.21)184 2700 y(D1S1665)d(-)j(102.02)184 2800 y(D1S1728)d(-)j(109.04)227 2899 y(2:)g(chrom_2)84 b(Map)43 b(range:)84 b(\(0cM)42 b(to)h(70cM\))314 2999 y(D2S1400)e(-)i(27.60)184 3099 y(D2S305)e(-)i(38.87)184 3198 y(D2S144)e(-)i(45.30)184 3298 y(D2S1788)d(-)j(55.51)140 3398 y(Total)f(Map)g(Length:)f(3500cM)140 3612 y Fl(Note)30 b(that)g(if)g(sex)f(sp)r(eci\014c)h(maps)g(are)e(b)r(eing)i(used)g (\(Section)g(6.16\),)f(then)h(eac)n(h)f(mark)n(er)f(will)i(b)r(e)g (follo)n(w)n(ed)140 3711 y(b)n(y)d(t)n(w)n(o)g(n)n(um)n(b)r(ers,)g(the) h(male)g(and)f(female)h(map)f(p)r(ositions.)136 3861 y(After)d(the)f(mark)n(er)f(listing)h(comes)f(information)h(on)g(the)h (column)f(iden)n(tities.)35 b(This)24 b(is)f(t)n(ypically)f(starts)h (with)140 3960 y(the)28 b(follo)n(wing)f(t)n(w)n(o)f(columns:)227 4174 y Fk(1:)43 b(Iteration)d(count)227 4274 y(2:)j(Residual)d (variance)140 4488 y Fl(If)30 b(the)g(residual)f(v)-5 b(ariance)28 b(is)i(\014xed,)g(then)g(the)g(corresp)r(onding)e(column)h (will)h(b)r(e)g(omitted.)44 b(If)30 b(a)f(p)r(olygenic)140 4588 y(e\013ect)f(and/or)e(additional)h(random)g(e\013ects)h(are)e (\014tted,)j(their)e(v)-5 b(ariances)26 b(will)i(app)r(ear)f(next:)227 4802 y Fk(3:)43 b(Additive)d(variance)227 4901 y(4:)j(Additional)c (variance)i(for)h(LITTER)139 5115 y Fl(This)26 b(is)g(follo)n(w)n(ed)f (b)n(y)g(information)h(as)f(to)h(whic)n(h)g(co)n(v)-5 b(ariate)24 b(e\013ects)j(are)e(b)r(eing)h(output)h(in)f(whic)n(h)g (columns.)140 5215 y(The)39 b(follo)n(wing)f(is)i(the)f(output)h(when)f (a)g(candidate)g(gene)g(CG1)f(is)i(b)r(eing)f(\014tted)h(along)e(with)i (the)f(t)n(w)n(o)140 5315 y(lev)n(el)d(factor)g(SX.)i(CG1)e(has)g (three)h(alleles)f(\(A,B,C\),)i(and)f(SX)g(has)f(t)n(w)n(o)g(lev)n(els) g(\(M,F\).)i(Note)f(that)g(the)140 5414 y(\014rst)30 b(lev)n(el)g(of)g(eac)n(h)g(factor)f(e\013ect)i(\(A,A)h(for)d(CG1,)i(M) g(for)f(SX\))h(is)f(not)g(output)h(as)f(it)h(is)f(alw)n(a)n(ys)e(set)j (equal)140 5514 y(to)j(zero.)53 b(In)34 b(addition)g(to)f(the)h(factor) f(e\013ects,)i(candidate)f(genes)e(ha)n(v)n(e)h(additional)g(columns)g (giving)g(the)140 5613 y(allele)c(frequencies)g(\(for)g(all)h(but)g(1)f (of)h(the)f(alleles\),)h(and)g(the)g(size)f(of)g(the)h(genes)f(con)n (tribution.)42 b(F)-7 b(or)29 b(more)140 5713 y(explanation)e(of)g (this,)h(see)f(the)h(section)g(on)f(the)h(QTL)f(e\013ect)h(size)f(b)r (elo)n(w.)1831 5962 y(27)p eop end %%Page: 28 28 TeXDict begin 28 27 bop 184 231 a Fk(covariate)39 b(data:)227 331 y(5:)k(Grand)e(mean)227 431 y(6:)i(CG1)f(freq.)g(A)227 530 y(7:)h(CG1)f(freq.)g(B)227 630 y(8:)h(CG1)f(effect)f(A,B)227 729 y(9:)i(CG1)f(effect)f(B,B)227 829 y(10:)i(CG1)f(effect)f(A,C)227 929 y(11:)i(CG1)f(effect)f(B,C)227 1028 y(12:)i(CG1)f(effect)f(C,C)227 1128 y(13:)i(CG1)f(size)227 1228 y(14:)h(SX)f(effect)f(F)138 1442 y Fl(Again,)26 b(if)g(the)f(grand)g(mean)g(is)g(\014xed)h(then)g (the)g(corresp)r(onding)d(column)i(will)h(b)r(e)g(omitted.)37 b(The)25 b(`size')g(of)h(a)137 1542 y(candidate)e(lo)r(cus)g(is)g(an)g (empirical)f(measure)g(\(not)i(used)f(b)n(y)g(the)g(sampling)g(pro)r (cess\),)g(whic)n(h)g(is)g(an)g(attempt)139 1641 y(to)h(get)h(get)g (around)f(some)g(of)h(the)g(problems)g(of)g(in)n(terpreting)f(the)h (gene)g(e\013ects)g(directly)-7 b(.)36 b(These)26 b(problems)138 1741 y(mainly)g(come)g(when)g(the)g(gene)f(frequency)h(is)g(extreme)f (\(near)h(1)f(or)g(0\).)36 b(In)26 b(these)g(situations)g(there)f(is)h (little)140 1841 y(or)h(no)h(information)g(ab)r(out)g(the)g(e\013ects)h (of)f(one)g(of)g(the)h(homozygotes,)d(so)i(the)g(gene)g(e\013ects)g (can)g(\015uctuate)140 1940 y(wildly)-7 b(,)36 b(making)d(in)n (terpretation)h(di\016cult.)57 b(It)34 b(is)g(also)f(useful)i(to)f(ha)n (v)n(e)f(a)g(single)h(measure)f(of)h(gene)g(size.)140 2040 y(The)29 b(measure)g(used)g(here)f(is)i(the)f(square)f(ro)r(ot)h (of)g(the)g(v)-5 b(ariance)28 b(con)n(tributed)h(b)n(y)g(the)h(trait)f (lo)r(cus,)g(and)g(is)140 2139 y(calculated)e(as)g(b)r(elo)n(w:)977 2355 y Fc(s)c Fl(=)1127 2236 y Fb(s)p 1210 2236 754 4 v 119 x Fl(\(1)p Fc(=n)p Fl(\))1422 2276 y Fb(X)1469 2453 y Ff(i)1555 2355 y Fc(n)1605 2367 y Ff(i)1632 2355 y Fl(\()p Fc(\026)1714 2367 y Ff(i)1761 2355 y Fd(\000)18 b Fc(\026)p Fl(\))1926 2331 y Fg(2)1963 2355 y Fc(;)97 b(\026)23 b Fl(=)g(\(1)p Fc(=n)p Fl(\))2456 2276 y Fb(X)2503 2453 y Ff(i)2589 2355 y Fc(n)2639 2367 y Ff(i)2666 2355 y Fc(\026)2716 2367 y Ff(i)2744 2355 y Fc(;)140 2629 y Fl(where)29 b Fc(n)h Fl(is)f(the)h(total)g(n)n(um)n(b)r(er)f(of)h (individuals)f(observ)n(ed)f(for)h(the)h(trait,)g Fc(n)2601 2641 y Ff(i)2658 2629 y Fl(is)g(the)g(n)n(um)n(b)r(er)f(of)h(observ)n (ed)140 2728 y(individuals)j(with)g(genot)n(yp)r(e)f Fc(i)p Fl(,)i(and)f Fc(\026)1423 2740 y Ff(i)1484 2728 y Fl(is)g(the)g(e\013ect)h(of)e(genot)n(yp)r(e)h Fc(i)p Fl(.)52 b(The)33 b(size)g(is)g(also)e(calculated)i(for)140 2828 y(QTLs)27 b(\(see)g(b)r(elo)n(w\).)140 2977 y(If)34 b(genetic)g(groups)e(ha)n(v)n(e)h(b)r(een)h(sp)r(eci\014ed)g (\(Sections)g(5.4,6.11\),)g(and)f(the)h(n)n(um)n(b)r(er)g(of)g (groups>1,)f(then)i(a)140 3077 y(separate)d(frequency)i(will)g(b)r(e)g (output)h(for)e(eac)n(h)g(group.)55 b(The)33 b(relev)-5 b(an)n(t)34 b(section)f(of)h(the)g(header)f(\014le)h(will)140 3177 y(then)28 b(lo)r(ok)f(something)g(lik)n(e)g(this:)184 3391 y Fk(covariate)39 b(data:)227 3491 y(6:)k(CG1)f([Genetic)f(group)g (1])i(freq.)e(A)227 3590 y(7:)i(CG1)f([Genetic)f(group)g(1])i(freq.)e (B)227 3690 y(8:)i(CG1)f([Genetic)f(group)g(2])i(freq.)e(A)227 3790 y(9:)i(CG1)f([Genetic)f(group)g(2])i(freq.)e(B)227 3889 y(10:)i(CG1)f(effect)f(A,B)227 3989 y(11:)i(CG1)f(effect)f(B,B)227 4089 y(12:)i(CG1)f(effect)f(A,C)227 4188 y(13:)i(CG1)f(effect)f(B,C)227 4288 y(14:)i(CG1)f(effect)f(C,C)227 4387 y(15:)i(CG1)f(size)227 4487 y(16:)h(SX)f(effect)f(F)135 4702 y Fl(After)21 b(the)h(co)n(v)-5 b(ariate)20 b(e\013ects)i(ha)n(v)n(e)e(b)r(een)i(describ)r(ed,)g(there) g(will)f(b)r(e)h(a)f(description)g(of)h(the)g(QTL)f(data)g(blo)r(c)n (ks)138 4801 y(if)27 b(an)n(y)e(QTL)g(are)g(b)r(eing)h(\014tted.)37 b(The)26 b(n)n(um)n(b)r(er)f(of)h(suc)n(h)g(data)f(blo)r(c)n(ks)g(dep)r (ends)h(on)g(the)g(n)n(um)n(b)r(er)g(of)f(QTL)h(in)140 4901 y(the)i(mo)r(del)g(at)f(eac)n(h)g(iteration.)36 b(The)28 b(description)f(in)h(the)g(header)f(will)g(lo)r(ok)g (something)g(lik)n(e)h(this:)140 5115 y Fk(QTL)42 b(data)g(blocks:)227 5215 y(linkage)f(group)227 5315 y([position)f(if)j(linked])227 5414 y(freq.)f(2)227 5514 y(effect)f(1,2)227 5613 y(effect)g(2,2)227 5713 y(size)1831 5962 y Fl(28)p eop end %%Page: 29 29 TeXDict begin 29 28 bop 140 231 a Fl(The)33 b(p)r(osition)g(\014eld)g (only)g(app)r(ears)e(if)j(a)e(QTL)h(is)g(link)n(ed.)52 b(If)34 b(sex)e(sp)r(eci\014c)h(maps)g(Section)g(6.16)e(are)h(used)140 331 y(then)f(there)g(will)g(b)r(e)h(2)e(\014elds)h(output)h(for)e(the)h (male)g(and)g(female)g(map)g(p)r(osition.)46 b(The)31 b(frequency)-7 b(,)32 b(e\013ect)140 431 y(and)g(size)g(\014elds)h(are) e(the)i(same)e(as)h(for)g(when)g(a)g(candidate)g(gene)g(is)g(\014tted)i (\(see)e(ab)r(o)n(v)n(e\),)g(with)h(the)g(same)140 530 y(c)n(hanges)26 b(o)r(ccurring)g(when)i(genetic)f(groups)g(ha)n(v)n(e)f (b)r(een)i(sp)r(eci\014ed.)139 680 y(A)n(t)e(the)g(end)h(of)f(the)g (header)f(there)h(are)f(sev)n(eral)f(lines)i(describing)f(the)i(v)-5 b(alues)25 b(for)h(tau)p 2890 680 25 4 v 30 w(mo)r(de)g(and)g(tau)p 3422 680 V 30 w(b)r(eta)138 779 y(\(Section)f(6.17\),)f(total)g(n)n(um) n(b)r(er)h(of)g(co)n(v)-5 b(ariate)23 b(columns,)i(whether)g(the)g Fk(no_overdominant)18 b Fl(\015ag)25 b(is)f(set6.15,)140 879 y(the)32 b(LM)g(ratio)f(if)h(it)g(is)g Fc(>)d Fl(0)j(\(Section)g (6.15\),)g(the)g(n)n(um)n(b)r(er)f(of)h(genetic)f(groups)g(\(Sections)h (5.4,6.11\),)f(and)140 979 y(whether)f(sex)f(sp)r(eci\014c)h(maps)f (are)g(b)r(eing)h(used)f(\(Section)h(6.16.)42 b(In)30 b(addition,)g(if)h(the)f(grand)e(mean)i(and/or)139 1078 y(the)c(residual)f(v)-5 b(ariance)25 b(ha)n(v)n(e)f(b)r(een)j(\014xed,) f(their)g(v)-5 b(alues)25 b(will)i(b)r(e)f(prin)n(ted)g(here.)36 b(The)26 b(end)g(of)g(the)g(header)f(is)140 1178 y(then)j(alw)n(a)n(ys) e(mark)n(ed)g(b)n(y)i(a)f(line)h(of)f(at)h(least)f(2)g(`)p Fk(_)p Fl(')g(c)n(haracters)f Fj(i.e.)p Fl(,)140 1394 y Fk(Tau)42 b(Mode:)g(0)140 1493 y(Tau)g(Beta:)g(376.924)140 1593 y(No.)g(covariate)e(columns:)g(11)140 1693 y(No.)i(genetic)f (groups:)g(1)140 1792 y(----------------)o(---)o(-)139 2008 y Fl(After)27 b(the)g(header)f(comes)g(a)g(series)f(of)i(output)g (records,)e(eac)n(h)h(record)f(describing)h(a)g(single)g(iteration.)36 b(Not)140 2108 y(all)e(iterations)f(ma)n(y)g(ha)n(v)n(e)g(records,)g (this)i(is)e(con)n(trolled)g(using)h(the)g(ST)-7 b(AR)g(T)34 b(OUTPUT)g(and)g(OUTPUT)140 2207 y(FREQUENCY)28 b(commands)g(6.1.)38 b(An)28 b(output)h(record)e(consists)h(of)g(a)g(n)n(um)n(b)r(er)g(of)g (space)f(separated)g(\014elds)139 2307 y(where)f(the)i(n)n(um)n(b)r(er) e(of)h(\014elds)f(dep)r(ends)i(on)e(\(a\))h(ho)n(w)f(man)n(y)g(co)n(v) -5 b(ariate)25 b(e\013ects)i(ha)n(v)n(e)e(b)r(een)j(\014tted,)f(\(b\))h (ho)n(w)135 2407 y(man)n(y)22 b(trait)g(lo)r(ci)g(are)f(curren)n(tly)g (in)h(the)h(mo)r(del)f(and)g(\(c\))h(whic)n(h)f(output)h(format)e(is)h (b)r(eing)h(used.)35 b(The)22 b(format)140 2506 y(of)28 b(eac)n(h)e(record)h(is)g(as)g(describ)r(ed)g(in)h(the)g(header)f(ab)r (o)n(v)n(e.)140 2772 y Fe(7.1.2)94 b(Output)32 b(\014le)f Fk(loki.pos)140 2975 y Fl(The)j(\014le)g Fk(loki.pos)d Fl(has)i(a)h(compact)f(format)g(whic)n(h)h(is)g(more)f(suitable)h(for)f (b)r(eing)h(read)f(b)n(y)h(a)f(program)137 3074 y(than)24 b(b)n(y)f(hand.)36 b(It)24 b(lists)g(the)g(p)r(ositions)g(of)g(all)f (QTLs)g(at)h(ev)n(ery)f(iteration)g(\(after)h(the)g(\014rst)g(output)g (iteration)140 3174 y(has)31 b(b)r(een)g(reac)n(hed)f(as)g(de\014ned)i (b)n(y)e(the)i(ST)-7 b(AR)g(T)31 b(OUTPUT)g(command)g(6.1\).)46 b(Loki)31 b(go)r(es)f(through)g(eac)n(h)140 3274 y(link)-5 b(age)34 b(group)g(in)g(turn)h(\(including)g(the)g(sp)r(ecial)f(unlink) n(ed)h(group)f(0\),)i(and)e(prin)n(ts)g(out)h(the)g(n)n(um)n(b)r(er)f (of)140 3373 y(QTL)28 b(in)g(that)h(group)e(and)h(the)h(p)r(ositions)f (of)g(eac)n(h)g(QTL)g(\(if)h(not)f(in)h(group)e(0\).)39 b(A)n(t)29 b(the)f(end)h(of)f(the)h(line)f(is)140 3473 y(a)e(colon)h(follo)n(w)n(ed)f(b)n(y)g(a)h(n)n(um)n(b)r(er;)g(this)h (is)f(the)g(n)n(um)n(b)r(er)g(of)g(iterations)f(where)h(the)g (information)g(in)g(the)h(line)140 3573 y(did)j(not)f(c)n(hange.)44 b(By)30 b(only)g(rep)r(orting)g(when)g(a)g(line)h(c)n(hanges)e(the)i (output)g(can)f(b)r(e)g(greatly)g(compressed.)140 3672 y(A)e(t)n(ypical)f(\014le)h(w)n(ould)f(lo)r(ok)g(something)g(lik)n(e)g (this:)140 3888 y Fk(0)43 b(3:99)140 3988 y(0)g(4:4)140 4087 y(0)g(3)g(1)h(1)f(34.3557:4)140 4187 y(0)g(3)g(1)h(1)f(35.3592:2) 140 4403 y Fl(This)33 b(sa)n(ys)f(that)h(there)g(w)n(ere)f(3)g(unlink)n (ed)h(QTLs)g(for)f(99)g(iterations)g(follo)n(w)n(ed)g(b)n(y)h(4)g (unlink)n(ed)g(QTLs)f(for)140 4502 y(4)k(iterations.)62 b(One)36 b(of)g(those)g(QTLs)f(b)r(ecame)h(link)n(ed)h(to)f(link)-5 b(age)35 b(group)h(1)f(at)i(p)r(osition)f(34.3557)d(for)j(4)140 4602 y(iterations,)f(and)f(then)h(mo)n(v)n(ed)e(to)i(p)r(osition)f (35.3592)d(for)j(2)g(iterations.)56 b(There)34 b(are)f(2)h(supplied)h (scripts,)140 4702 y Fk(count.pl)24 b Fl(and)k Fk(dist.pl)p Fl(,)d(whic)n(h)i(in)n(terpret)g(this)h(\014le)g(\(Section)g(8\).)140 4967 y Fe(7.1.3)94 b(Output)32 b(\014le)f Fk(loki.mpos)140 5170 y Fl(This)41 b(\014le)h(is)f(pro)r(duced)g(if)g(mark)n(er)f(p)r (ositions)h(are)f(allo)n(w)n(ed)g(to)h(v)-5 b(ary)40 b(using)h(the)g(ST)-7 b(AR)g(T)42 b(POSITION)140 5270 y(command)30 b(\(Section)h(6.7\).)45 b(The)31 b(\014le)g(format)f(is)g (v)n(ery)f(simple.)46 b(The)31 b(\014rst)f(line)h(giv)n(es)f(the)h (mark)n(ers)d(whose)140 5370 y(p)r(ositions)37 b(are)g(b)r(eing)g (samples,)j(and)d(subsequen)n(t)g(lines)h(giv)n(e)f(the)h(iteration)e (n)n(um)n(b)r(er)i(and)f(the)h(mark)n(er)140 5469 y(p)r(ositions)i(in)h (the)g(same)e(order)h(as)f(the)i(\014rst)f(line.)76 b(If)41 b(sex)f(sp)r(eci\014c)h(maps)f(are)f(b)r(eing)i(used)f(then)h(t)n(w)n (o)140 5569 y(p)r(ositions)27 b(\(female,male\))h(will)g(b)r(e)g (output)g(for)f(eac)n(h)g(mark)n(er.)1831 5962 y(29)p eop end %%Page: 30 30 TeXDict begin 30 29 bop 140 231 a Fe(7.1.4)94 b(Mark)m(er)33 b(allele)d(frequency)j(\014le)140 434 y Fl(The)41 b(OUTPUT)g(FREQUENCY) h("freq\014le")e(command)h(will)g(cause)g(estimates)g(of)g(the)h(mark)n (er)e(allele)140 534 y(frequencies)33 b(to)g(b)r(e)h(output)g(at)f(eac) n(h)g(output)g(iteration)g(to)g(freq\014le)h(\(see)f(Section)g(6.10.)53 b(This)33 b(\014le)h(has)f(a)140 634 y(header)f(whic)n(h)h(describ)r (es)g(the)g(mark)n(ers)e(and)i(alleles)f(whic)n(h)h(are)f(b)r(eing)h (output.)54 b(F)-7 b(ollo)n(wing)32 b(the)h(header)137 733 y(are)24 b(a)g(series)f(of)i(lines,)g(1)f(p)r(er)h(output)g (iteration,)f(whic)n(h)h(ha)n(v)n(e)e(the)i(iteration)f(n)n(um)n(b)r (er)g(and)g(allele)h(frequency)140 833 y(realizations.)35 b(An)28 b(example)f(of)h(the)g(\014le)g(follo)n(ws:)140 1049 y Fk(Created)41 b(by)h(loki)g(2.3.0:)f(Fri)i(Sep)f(22)h(11:31:32)d (2000)140 1148 y(0)j(D1S1597:)d(6)k(7)f(3)140 1248 y(1)g(D1S1612:)d(5)k (7)f(9)g(6)140 1348 y(No.)f(genetic)f(groups:)g(1)140 1447 y(----------------)o(---)o(-)140 1547 y(100)h(0.477894)f(0.230591) f(0.291515)g(0.0398045)g(0.0172819)g(0.00242949)f(0.940484)140 1647 y(104)j(0.478429)f(0.255159)f(0.266412)g(0.0346967)g(0.0140646)g (0.00211458)f(0.949124)140 1862 y Fl(The)d(line)h(lengths)f(in)g(the)h (\014le)g(can)e(ob)n(viously)g(get)h(v)n(ery)f(long)h(if)h(man)n(y)e (mark)n(ers)g(are)g(b)r(eing)h(analyzed.)140 1962 y(Pro)r(cessing)25 b(of)j(this)g(script)f(to)g(pro)r(duce)g(allele)h(frequency)f (estimates)g(can)g(b)r(e)h(done)f(using)g(the)h(p)r(erl)g(script)140 2062 y Fk(freq.pl)34 b Fl(\(Sections)j(8.4.)64 b(Note)36 b(that)i(if)f(there)g(are)e(m)n(ultiple)j(genetic)e(groups)g(there)g (will)i(b)r(e)f(m)n(ultiple)140 2161 y(estimates)32 b(for)f(eac)n(h)h (allele.)49 b(The)33 b(n)n(um)n(b)r(er)e(of)h(columns)g(will)g (therefore)g(b)r(e)g(the)g(total)g(n)n(um)n(b)r(er)g(of)g(alleles)140 2261 y(m)n(ultiplied)c(b)n(y)g(the)g(n)n(um)n(b)r(er)f(of)h(genetic)f (groups.)140 2543 y Fh(7.2)112 b(IBD)37 b(sharing)i(analysis)140 2746 y Fl(Not)28 b(do)r(cumen)n(ted)g(-)f(not)h(in)f(a)h(stable)f (state.)140 3028 y Fh(7.3)112 b(Estimation)38 b(of)g(IBD)e (relationship)j(matrices)140 3231 y Fl(This)h(analysis)f(is)h(designed) g(to)g(estimate)g(the)g(IBD)h(relationship)e(matrices)g(for)h(v)-5 b(ariance)39 b(comp)r(onen)n(t)140 3331 y(analysis)29 b(programs)f(\(suc)n(h)i(as)g(SOLAR\).)g(IBD)h(calculations)e(are)g (time)i(consuming)f(and)g(exp)r(ensiv)n(e,)h(and)140 3431 y(for)e(large)g(p)r(edigrees)g(the)h(only)f(feasible)h(w)n(a)n(y)e (is)i(often)g(to)g(use)f(MCMC)h(metho)r(ds.)44 b Fk(loki)28 b Fl(will)i(supply)g(the)134 3530 y(IBD)20 b(matrices)g(in)g(v)-5 b(arious)19 b(formats,)j(to)e(mak)n(e)f(it)i(easier)e(to)i(use)f(the)g (output)h(with)g(other)f(analysis)f(programs.)136 3680 y(The)24 b(IBD)g(relationship)e(b)r(et)n(w)n(een)i(2)f(individuals)h (can)f(b)r(e)h(expressed)e(as)h(a)g(v)n(ector)f(of)i(9)f(probabilities) g(giving)140 3779 y(the)28 b(probabilities)f(of)g(the)h(9)f(condensed)h (iden)n(tit)n(y)f(states)g(sho)n(wn)g(in)h(\014gure)f(4.)140 3929 y(Let)42 b(\001)372 3941 y Ff(i)447 3929 y Fl(=)k Fc(p)p Fl(\()p Fc(S)683 3941 y Ff(i)711 3929 y Fl(\),)g(the)c (probabilit)n(y)f(of)h(iden)n(tit)n(y)g(state)g Fc(i)p Fl(,)j(and)d Fe(\001)f Fl(b)r(e)i(the)f(v)n(ector)f(of)g(iden)n(tit)n (y)i(state)140 4028 y(probabilities.)69 b(T)-7 b(o)39 b(sa)n(v)n(e)e(space,)k Fk(loki)c Fl(do)r(es)h(not)h(store)f(estimates) g(of)h(all)f(9)g(p)r(ossible)h(states)f(for)g(eac)n(h)140 4128 y(relativ)n(e)j(pair.)80 b(Instead)42 b(it)h(calculates)e(t)n(w)n (o)h(functions)g(of)h Fe(\001)o Fl(,)j(t)n(wice)d(the)f(kinship)h(co)r (e\016cien)n(t)f(2\010)47 b(=)133 4228 y(2\(\001)276 4240 y Fg(1)317 4228 y Fl(+)395 4195 y Fg(1)p 395 4209 34 4 v 395 4256 a(2)438 4228 y Fl(\(\001)539 4240 y Fg(3)580 4228 y Fl(+)s(\001)717 4240 y Fg(5)757 4228 y Fl(+)s(\001)894 4240 y Fg(7)932 4228 y Fl(\))s(+)1045 4195 y Fg(1)p 1045 4209 V 1045 4256 a(4)1088 4228 y Fl(\001)1157 4240 y Fg(8)1195 4228 y Fl(\))40 b(and)20 b(\001)1490 4240 y Fg(7)1531 4228 y Fl(+)s(\001)1668 4240 y Fg(1)1705 4228 y Fl(,)i(as)d(these)h(are)g(the)g(quan)n(tities)g(required)f(b)n(y)g (most)h(v)-5 b(ariance)140 4327 y(comp)r(onen)n(t)40 b(programs)e(\014tting)i(additiv)n(e)g(and)g(dominance)g(v)-5 b(ariance)39 b(comp)r(onen)n(ts.)74 b(Note)40 b(that)g(these)140 4427 y(quan)n(tities)30 b(are)f(estimated)h(correctly)-7 b(,)29 b(ev)n(en)g(in)h(the)g(case)g(of)f(in)n(breeding,)h(but)h(\(It)f (is)g(not)g(clear,)f(ho)n(w)n(ev)n(er,)139 4527 y(if)f(the)f(\001)426 4539 y Fg(7)481 4527 y Fl(+)16 b(\001)631 4539 y Fg(1)696 4527 y Fl(v)-5 b(alue)27 b(is)f(appropriate)g(for)g(the)h(dominance)g (comp)r(onen)n(t)g(in)g(the)g(case)f(of)h(in)n(breeding,)f(but)140 4626 y(that)i(is)f(another)g(question.)13 b(.)h(.)g(\))140 4776 y(If)42 b(IBD)g(estimates)f(are)g(requested)g(at)h(man)n(y)f(p)r (ositions)g(\(for)g(example,)k(ev)n(ery)40 b(cen)n(timorgan)g(along)h (a)140 4875 y(c)n(hromosome\),)47 b(the)d(accum)n(ulation)g(of)g(the)h (IBD)f(sharing)f(statistics)h(can)g(accoun)n(t)f(for)h(a)g (signi\014can)n(t)140 4975 y(prop)r(ortion)c(of)h(the)h(running)f (time.)78 b(It)41 b(can)g(therefore)g(b)r(e)g(adv)-5 b(an)n(tageous)39 b(to)i(request)g Fk(loki)f Fl(to)h(only)140 5075 y(collect)32 b(the)g(sharing)e(statistics)i(ev)n(ery)e Fc(n)i Fl(iterations.)49 b(This)32 b(has)f(the)h(adv)-5 b(an)n(tage)31 b(that)h(the)g(samples)f(that)140 5174 y Fj(ar)l(e)37 b Fl(collected)31 b(are)f(less)g(correlated)f(than)i(if) g(collection)f(is)h(p)r(erformed)f(at)g(ev)n(ery)g(iteration.)46 b(Ob)n(viously)29 b(if)140 5274 y(IBD)34 b(sharing)e(is)h(estimated)h (at)f(only)g(a)g(few)h(p)r(ositions)f(\(or)g(if)h(unlink)n(ed)f(mark)n (ers)f(are)g(b)r(eing)i(used\),)h(the)140 5373 y(optim)n(um)28 b(strategy)f(ma)n(y)h(still)g(b)r(e)h(to)f(collect)g(estimates)f(at)i (ev)n(ery)d(iteration.)38 b(As)29 b(with)f(the)h(normal)e Fk(loki)134 5473 y Fl(analyses,)22 b(the)g(starting)e(iteration)h(and)g (collection)g(frequency)g(are)g(sp)r(eci\014ed)g(using)g(the)h(ST)-7 b(AR)g(T)22 b(OUTPUT)140 5573 y(and)27 b(OUTPUT)h(FREQUENCY)f (commands.)1831 5962 y(30)p eop end %%Page: 31 31 TeXDict begin 31 30 bop 672 1743 a @beginspecial 60 @llx 268 @lly 549 @urx 593 @ury 2880 @rwi @setspecial %%BeginDocument: docfig1.eps %!PS-Adobe-2.0 EPSF-2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: ibd_coeff.dvi %%BoundingBox: 60 268 549 593 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -E -o docfig1.eps ibd_coeff %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2002.10.28:1313 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr 1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B /chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ /cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 {2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ 1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X 1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) (LaserWriter 16/600)]{A length product length le{A length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end %%EndProcSet %%BeginProcSet: pstricks.pro %! % PostScript prologue for pstricks.tex. % Version 97 patch 3, 98/06/01 % For distribution, see pstricks.tex. % /tx@Dict 200 dict def tx@Dict begin /ADict 25 dict def /CM { matrix currentmatrix } bind def /SLW /setlinewidth load def /CLW /currentlinewidth load def /CP /currentpoint load def /ED { exch def } bind def /L /lineto load def /T /translate load def /TMatrix { } def /RAngle { 0 } def /Atan { /atan load stopped { pop pop 0 } if } def /Div { dup 0 eq { pop } { div } ifelse } def /NET { neg exch neg exch T } def /Pyth { dup mul exch dup mul add sqrt } def /PtoC { 2 copy cos mul 3 1 roll sin mul } def /PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def /PathLength { flattenpath /z 0 def { /y1 ED /x1 ED /y2 y1 def /x2 x1 def } { /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ } /pathforall load stopped { pop pop pop pop } if z } def /STP { .996264 dup scale } def /STV { SDict begin normalscale end STP } def /DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul /y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ] 0 } ifelse setdash stroke } def /DotLine { /b PathLength def /a ED /z ED /y CLW def /z y z add def a 0 gt { /b b a div def } { a 0 eq { /b b y sub def } { a -3 eq { /b b y add def } if } ifelse } ifelse [ 0 b b z Div round Div dup 0 le { pop 1 } if ] a 0 gt { 0 } { y 2 div a -2 gt { neg } if } ifelse setdash 1 setlinecap stroke } def /LineFill { gsave abs CLW add /a ED a 0 dtransform round exch round exch 2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25 % DG/SR modification begin - Dec. 12, 1997 - Patch 2 %itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a % DG/SR modification end Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict /setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1 % DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) % a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore } % def a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore pop pop } def % DG/SR modification end /BeginArrow { ADict begin /@mtrx CM def gsave 2 copy T 2 index sub neg exch 3 index sub exch Atan rotate newpath } def /EndArrow { @mtrx setmatrix CP grestore end } def /Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1 scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto gsave fill grestore } def /Tbar { CLW mul add /z ED z -2 div CLW 2 div moveto z 0 rlineto stroke 0 CLW moveto } def /Bracket { CLW mul add dup CLW sub 2 div /x ED mul CLW add /y ED /z CLW 2 div def x neg y moveto x neg CLW 2 div L x CLW 2 div L x y L stroke 0 CLW moveto } def /RoundBracket { CLW mul add dup 2 div /x ED mul /y ED /mtrx CM def 0 CLW 2 div T x y mul 0 ne { x y scale } if 1 1 moveto .85 .5 .35 0 0 0 curveto -.35 0 -.85 .5 -1 1 curveto mtrx setmatrix stroke 0 CLW moveto } def /SD { 0 360 arc fill } def /EndDot { { /z DS def } { /z 0 def } ifelse /b ED 0 z DS SD b { 0 z DS CLW sub SD } if 0 DS z add CLW 4 div sub moveto } def /Shadow { [ { /moveto load } { /lineto load } { /curveto load } { /closepath load } /pathforall load stopped { pop pop pop pop CP /moveto load } if ] cvx newpath 3 1 roll T exec } def /NArray { aload length 2 div dup dup cvi eq not { exch pop } if /n exch cvi def } def /NArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def /Line { NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def n { Lineto } repeat CP 4 2 roll ArrowB L pop pop } if } def /Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 } ifelse { pop } repeat a } def /CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq and { pop pop /n n 1 sub def } if } def /Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1 ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1 moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto Lineto pop pop closepath } ifelse } def /Diamond { /mtrx CM def T rotate /h ED /w ED dup 0 eq { pop } { CLW mul neg /d ED /a w h Atan def /h d a sin Div h add def /w d a cos Div w add def } ifelse mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 div /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx setmatrix } def % DG modification begin - Jan. 15, 1997 %/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq { %pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 %div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0 %d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx %setmatrix } def /Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 div dup cos exch sin Div mul sub def mark 0 d w neg d 0 h w d 0 d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx % DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) % setmatrix } def setmatrix pop } def % DG/SR modification end /CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth def } def /CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth def } def /CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1 def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def /y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul m mul neg def } def /IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def } def /BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def /NC { CC x1 y1 x2 y2 x y curveto } def /EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def /BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def /NAC { x2 y2 x y curveto CC x1 y1 } def /EAC { x2 y2 x y ArrowB curveto pop pop } def /OpenCurve { NArray n 3 lt { n { pop pop } repeat } { BOC /n n 3 sub def n { NC } repeat EOC } ifelse } def /AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload /Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def /ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt { CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC } repeat closepath pop pop } ifelse } def /SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def /ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def /SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } def /FontDot { DS 2 mul dup matrix scale matrix concatmatrix exch matrix rotate matrix concatmatrix exch findfont exch makefont setfont } def /Rect { x1 y1 y2 add 2 div moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto x1 y1 lineto closepath } def /OvalFrame { x1 x2 eq y1 y2 eq or { pop pop x1 y1 moveto x2 y2 L } { y1 y2 sub abs x1 x2 sub abs 2 copy gt { exch pop } { pop } ifelse 2 div exch { dup 3 1 roll mul exch } if 2 copy lt { pop } { exch pop } ifelse /b ED x1 y1 y2 add 2 div moveto x1 y2 x2 y2 b arcto x2 y2 x2 y1 b arcto x2 y1 x1 y1 b arcto x1 y1 x1 y2 b arcto 16 { pop } repeat closepath } ifelse } def /Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add /y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq { pop pop Rect } { OvalFrame } ifelse } def /BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def /OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto } ifelse } def /ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def /BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1 sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore } def /Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1 sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0 y0 x0 2 mul x1 sub y1 ] def } def /Grid { newpath /a 4 string def /b ED /c ED /n ED cvi dup 1 lt { pop 1 } if /s ED s div dup 0 eq { pop 1 } if /dy ED s div dup 0 eq { pop 1 } if /dx ED dy div round dy mul /y0 ED dx div round dx mul /x0 ED dy div round cvi /y2 ED dx div round cvi /x2 ED dy div round cvi /y1 ED dx div round cvi /x1 ED /h y2 y1 sub 0 gt { 1 } { -1 } ifelse def /w x2 x1 sub 0 gt { 1 } { -1 } ifelse def b 0 gt { /z1 b 4 div CLW 2 div add def /Helvetica findfont b scalefont setfont /b b .95 mul CLW 2 div add def } if systemdict /setstrokeadjust known { true setstrokeadjust /t { } def } { /t { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add exch itransform } bind def } ifelse gsave n 0 gt { 1 setlinecap [ 0 dy n div ] dy n div 2 div setdash } { 2 setlinecap } ifelse /i x1 def /f y1 dy mul n 0 gt { dy n div 2 div h mul sub } if def /g y2 dy mul n 0 gt { dy n div 2 div h mul add } if def x2 x1 sub w mul 1 add dup 1000 gt { pop 1000 } if { i dx mul dup y0 moveto b 0 gt { gsave c i a cvs dup stringwidth pop /z2 ED w 0 gt {z1} {z1 z2 add neg} ifelse h 0 gt {b neg} {z1} ifelse rmoveto show grestore } if dup t f moveto g t L stroke /i i w add def } repeat grestore gsave n 0 gt % DG/SR modification begin - Nov. 7, 1997 - Patch 1 %{ 1 setlinecap [ 0 dx n div ] dy n div 2 div setdash } { 1 setlinecap [ 0 dx n div ] dx n div 2 div setdash } % DG/SR modification end { 2 setlinecap } ifelse /i y1 def /f x1 dx mul n 0 gt { dx n div 2 div w mul sub } if def /g x2 dx mul n 0 gt { dx n div 2 div w mul add } if def y2 y1 sub h mul 1 add dup 1000 gt { pop 1000 } if { newpath i dy mul dup x0 exch moveto b 0 gt { gsave c i a cvs dup stringwidth pop /z2 ED w 0 gt {z1 z2 add neg} {z1} ifelse h 0 gt {z1} {b neg} ifelse rmoveto show grestore } if dup f exch t moveto g exch t L stroke /i i h add def } repeat grestore } def /ArcArrow { /d ED /b ED /a ED gsave newpath 0 -1000 moveto clip newpath 0 1 0 0 b grestore c mul /e ED pop pop pop r a e d PtoC y add exch x add exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c mul neg d } def /Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def /Rot { CP CP translate 3 -1 roll neg rotate NET } def /RotBegin { tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } def } if /TMatrix [ TMatrix CM ] cvx def /a ED a Rot /RAngle [ RAngle dup a add ] cvx def } def /RotEnd { /TMatrix [ TMatrix setmatrix ] cvx def /RAngle [ RAngle pop ] cvx def } def /PutCoor { gsave CP T CM STV exch exec moveto setmatrix CP grestore } def /PutBegin { /TMatrix [ TMatrix CM ] cvx def CP 4 2 roll T moveto } def /PutEnd { CP /TMatrix [ TMatrix setmatrix ] cvx def moveto } def /Uput { /a ED add 2 div /h ED 2 div /w ED /s a sin def /c a cos def /b s abs c abs 2 copy gt dup /q ED { pop } { exch pop } ifelse def /w1 c b div w mul def /h1 s b div h mul def q { w1 abs w sub dup c mul abs } { h1 abs h sub dup s mul abs } ifelse } def /UUput { /z ED abs /y ED /x ED q { x s div c mul abs y gt } { x c div s mul abs y gt } ifelse { x x mul y y mul sub z z mul add sqrt z add } { q { x s div } { x c div } ifelse abs } ifelse a PtoC h1 add exch w1 add exch } def /BeginOL { dup (all) eq exch TheOL eq or { IfVisible not { Visible /IfVisible true def } if } { IfVisible { Invisible /IfVisible false def } if } ifelse } def /InitOL { /OLUnit [ 3000 3000 matrix defaultmatrix dtransform ] cvx def /Visible { CP OLUnit idtransform T moveto } def /Invisible { CP OLUnit neg exch neg exch idtransform T moveto } def /BOL { BeginOL } def /IfVisible true def } def end % END pstricks.pro %%EndProcSet %%BeginProcSet: pst-dots.pro %!PS-Adobe-2.0 %%Title: Dot Font for PSTricks 97 - Version 97, 93/05/07. %%Creator: Timothy Van Zandt %%Creation Date: May 7, 1993 10 dict dup begin /FontType 3 def /FontMatrix [ .001 0 0 .001 0 0 ] def /FontBBox [ 0 0 0 0 ] def /Encoding 256 array def 0 1 255 { Encoding exch /.notdef put } for Encoding dup (b) 0 get /Bullet put dup (c) 0 get /Circle put dup (C) 0 get /BoldCircle put dup (u) 0 get /SolidTriangle put dup (t) 0 get /Triangle put dup (T) 0 get /BoldTriangle put dup (r) 0 get /SolidSquare put dup (s) 0 get /Square put dup (S) 0 get /BoldSquare put dup (q) 0 get /SolidPentagon put dup (p) 0 get /Pentagon put (P) 0 get /BoldPentagon put /Metrics 13 dict def Metrics begin /Bullet 1000 def /Circle 1000 def /BoldCircle 1000 def /SolidTriangle 1344 def /Triangle 1344 def /BoldTriangle 1344 def /SolidSquare 886 def /Square 886 def /BoldSquare 886 def /SolidPentagon 1093.2 def /Pentagon 1093.2 def /BoldPentagon 1093.2 def /.notdef 0 def end /BBoxes 13 dict def BBoxes begin /Circle { -550 -550 550 550 } def /BoldCircle /Circle load def /Bullet /Circle load def /Triangle { -571.5 -330 571.5 660 } def /BoldTriangle /Triangle load def /SolidTriangle /Triangle load def /Square { -450 -450 450 450 } def /BoldSquare /Square load def /SolidSquare /Square load def /Pentagon { -546.6 -465 546.6 574.7 } def /BoldPentagon /Pentagon load def /SolidPentagon /Pentagon load def /.notdef { 0 0 0 0 } def end /CharProcs 20 dict def CharProcs begin /Adjust { 2 copy dtransform floor .5 add exch floor .5 add exch idtransform 3 -1 roll div 3 1 roll exch div exch scale } def /CirclePath { 0 0 500 0 360 arc closepath } def /Bullet { 500 500 Adjust CirclePath fill } def /Circle { 500 500 Adjust CirclePath .9 .9 scale CirclePath eofill } def /BoldCircle { 500 500 Adjust CirclePath .8 .8 scale CirclePath eofill } def /BoldCircle { CirclePath .8 .8 scale CirclePath eofill } def /TrianglePath { 0 660 moveto -571.5 -330 lineto 571.5 -330 lineto closepath } def /SolidTriangle { TrianglePath fill } def /Triangle { TrianglePath .85 .85 scale TrianglePath eofill } def /BoldTriangle { TrianglePath .7 .7 scale TrianglePath eofill } def /SquarePath { -450 450 moveto 450 450 lineto 450 -450 lineto -450 -450 lineto closepath } def /SolidSquare { SquarePath fill } def /Square { SquarePath .89 .89 scale SquarePath eofill } def /BoldSquare { SquarePath .78 .78 scale SquarePath eofill } def /PentagonPath { -337.8 -465 moveto 337.8 -465 lineto 546.6 177.6 lineto 0 574.7 lineto -546.6 177.6 lineto closepath } def /SolidPentagon { PentagonPath fill } def /Pentagon { PentagonPath .89 .89 scale PentagonPath eofill } def /BoldPentagon { PentagonPath .78 .78 scale PentagonPath eofill } def /.notdef { } def end /BuildGlyph { exch begin Metrics 1 index get exec 0 BBoxes 3 index get exec setcachedevice CharProcs begin load exec end end } def /BuildChar { 1 index /Encoding get exch get 1 index /BuildGlyph get exec } bind def end /PSTricksDotFont exch definefont pop % END pst-dots.pro %%EndProcSet %%BeginProcSet: pst-node.pro %! % PostScript prologue for pst-node.tex. % Version 97 patch 1, 97/05/09. % For distribution, see pstricks.tex. % /tx@NodeDict 400 dict def tx@NodeDict begin tx@Dict begin /T /translate load def end /NewNode { gsave /next ED dict dup 3 1 roll def exch { dup 3 1 roll def } if begin tx@Dict begin STV CP T exec end /NodeMtrx CM def next end grestore } def /InitPnode { /Y ED /X ED /NodePos { NodeSep Cos mul NodeSep Sin mul } def } def /InitCnode { /r ED /Y ED /X ED /NodePos { NodeSep r add dup Cos mul exch Sin mul } def } def /GetRnodePos { Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def } ifelse Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def } ifelse dx Sin mul abs dy Cos mul abs gt { dy Cos mul Sin div dy } { dx dup Sin mul Cos Div } ifelse } def /InitRnode { /Y ED /X ED X sub /r ED /l X neg def Y add neg /d ED Y sub /u ED /NodePos { GetRnodePos } def } def /DiaNodePos { w h mul w Sin mul abs h Cos mul abs add Div NodeSep add dup Cos mul exch Sin mul } def /TriNodePos { Sin s lt { d NodeSep sub dup Cos mul Sin Div exch } { w h mul w Sin mul h Cos abs mul add Div NodeSep add dup Cos mul exch Sin mul } ifelse } def /InitTriNode { sub 2 div exch 2 div exch 2 copy T 2 copy 4 index index /d ED pop pop pop pop -90 mul rotate /NodeMtrx CM def /X 0 def /Y 0 def d sub abs neg /d ED d add /h ED 2 div h mul h d sub Div /w ED /s d w Atan sin def /NodePos { TriNodePos } def } def /OvalNodePos { /ww w NodeSep add def /hh h NodeSep add def Sin ww mul Cos hh mul Atan dup cos ww mul exch sin hh mul } def /GetCenter { begin X Y NodeMtrx transform CM itransform end } def /XYPos { dup sin exch cos Do /Cos ED /Sin ED /Dist ED Cos 0 gt { Dist Dist Sin mul Cos div } { Cos 0 lt { Dist neg Dist Sin mul Cos div neg } { 0 Dist Sin mul } ifelse } ifelse Do } def /GetEdge { dup 0 eq { pop begin 1 0 NodeMtrx dtransform CM idtransform exch atan sub dup sin /Sin ED cos /Cos ED /NodeSep ED NodePos NodeMtrx dtransform CM idtransform end } { 1 eq {{exch}} {{}} ifelse /Do ED pop XYPos } ifelse } def /AddOffset { 1 index 0 eq { pop pop } { 2 copy 5 2 roll cos mul add 4 1 roll sin mul sub exch } ifelse } def /GetEdgeA { NodeSepA AngleA NodeA NodeSepTypeA GetEdge OffsetA AngleA AddOffset yA add /yA1 ED xA add /xA1 ED } def /GetEdgeB { NodeSepB AngleB NodeB NodeSepTypeB GetEdge OffsetB AngleB AddOffset yB add /yB1 ED xB add /xB1 ED } def /GetArmA { ArmTypeA 0 eq { /xA2 ArmA AngleA cos mul xA1 add def /yA2 ArmA AngleA sin mul yA1 add def } { ArmTypeA 1 eq {{exch}} {{}} ifelse /Do ED ArmA AngleA XYPos OffsetA AngleA AddOffset yA add /yA2 ED xA add /xA2 ED } ifelse } def /GetArmB { ArmTypeB 0 eq { /xB2 ArmB AngleB cos mul xB1 add def /yB2 ArmB AngleB sin mul yB1 add def } { ArmTypeB 1 eq {{exch}} {{}} ifelse /Do ED ArmB AngleB XYPos OffsetB AngleB AddOffset yB add /yB2 ED xB add /xB2 ED } ifelse } def /InitNC { /b ED /a ED /NodeSepTypeB ED /NodeSepTypeA ED /NodeSepB ED /NodeSepA ED /OffsetB ED /OffsetA ED tx@NodeDict a known tx@NodeDict b known and dup { /NodeA a load def /NodeB b load def NodeA GetCenter /yA ED /xA ED NodeB GetCenter /yB ED /xB ED } if } def /LPutLine { 4 copy 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED 1 t sub mul 3 1 roll 1 t sub mul 4 1 roll t mul add /Y ED t mul add /X ED } def /LPutLines { mark LPutVar counttomark 2 div 1 sub /n ED t floor dup n gt { pop n 1 sub /t 1 def } { dup t sub neg /t ED } ifelse cvi 2 mul { pop } repeat LPutLine cleartomark } def /BezierMidpoint { /y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED /y0 ED /x0 ED /t ED /cx x1 x0 sub 3 mul def /cy y1 y0 sub 3 mul def /bx x2 x1 sub 3 mul cx sub def /by y2 y1 sub 3 mul cy sub def /ax x3 x0 sub cx sub bx sub def /ay y3 y0 sub cy sub by sub def ax t 3 exp mul bx t t mul mul add cx t mul add x0 add ay t 3 exp mul by t t mul mul add cy t mul add y0 add 3 ay t t mul mul mul 2 by t mul mul add cy add 3 ax t t mul mul mul 2 bx t mul mul add cx add atan /NAngle ED /Y ED /X ED } def /HPosBegin { yB yA ge { /t 1 t sub def } if /Y yB yA sub t mul yA add def } def /HPosEnd { /X Y yyA sub yyB yyA sub Div xxB xxA sub mul xxA add def /NAngle yyB yyA sub xxB xxA sub Atan def } def /HPutLine { HPosBegin /yyA ED /xxA ED /yyB ED /xxB ED HPosEnd } def /HPutLines { HPosBegin yB yA ge { /check { le } def } { /check { ge } def } ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { dup Y check { exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark HPosEnd } def /VPosBegin { xB xA lt { /t 1 t sub def } if /X xB xA sub t mul xA add def } def /VPosEnd { /Y X xxA sub xxB xxA sub Div yyB yyA sub mul yyA add def /NAngle yyB yyA sub xxB xxA sub Atan def } def /VPutLine { VPosBegin /yyA ED /xxA ED /yyB ED /xxB ED VPosEnd } def /VPutLines { VPosBegin xB xA ge { /check { le } def } { /check { ge } def } ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { 1 index X check { exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark VPosEnd } def /HPutCurve { gsave newpath /SaveLPutVar /LPutVar load def LPutVar 8 -2 roll moveto curveto flattenpath /LPutVar [ {} {} {} {} pathforall ] cvx def grestore exec /LPutVar /SaveLPutVar load def } def /NCCoor { /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 xA1 yA1 ] cvx def /LPutPos { LPutVar LPutLine } def /HPutPos { LPutVar HPutLine } def /VPutPos { LPutVar VPutLine } def LPutVar } def /NCLine { NCCoor tx@Dict begin ArrowA CP 4 2 roll ArrowB lineto pop pop end } def /NCLines { false NArray n 0 eq { NCLine } { 2 copy yA sub exch xA sub Atan /AngleA ED n 2 mul dup index exch index yB sub exch xB sub Atan /AngleB ED GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 n 2 mul 4 add 4 roll xA1 yA1 ] cvx def mark LPutVar tx@Dict begin false Line end /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } ifelse } def /NCCurve { GetEdgeA GetEdgeB xA1 xB1 sub yA1 yB1 sub Pyth 2 div dup 3 -1 roll mul /ArmA ED mul /ArmB ED /ArmTypeA 0 def /ArmTypeB 0 def GetArmA GetArmB xA2 yA2 xA1 yA1 tx@Dict begin ArrowA end xB2 yB2 xB1 yB1 tx@Dict begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines } HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def /NCAngles { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def xA2 yA2 mtrx transform pop xB2 yB2 mtrx transform exch pop mtrx itransform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCAngle { GetEdgeA GetEdgeB GetArmB /mtrx AngleA matrix rotate def xB2 yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA1 yA1 tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCBar { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def xA2 yA2 mtrx itransform pop xB2 yB2 mtrx itransform pop sub dup 0 mtrx transform 3 -1 roll 0 gt { /yB2 exch yB2 add def /xB2 exch xB2 add def } { /yA2 exch neg yA2 add def /xA2 exch neg xA2 add def } ifelse mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCDiag { GetEdgeA GetEdgeB GetArmA GetArmB mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCDiagg { GetEdgeA GetArmA yB yA2 sub xB xA2 sub Atan 180 add /AngleB ED GetEdgeB mark xB1 yB1 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def /NCLoop { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def xA2 yA2 mtrx transform loopsize add /yA3 ED /xA3 ED /xB3 xB2 yB2 mtrx transform pop def xB3 yA3 mtrx itransform /yB3 ED /xB3 ED xA3 yA3 mtrx itransform /yA3 ED /xA3 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } def % DG/SR modification begin - May 9, 1997 - Patch 1 %/NCCircle { 0 0 NodesepA nodeA \tx@GetEdge pop xA sub 2 div dup 2 exp r %r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add %exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 %mul add dup 5 1 roll 90 sub \tx@PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED /NCCircle { NodeSepA 0 NodeA 0 GetEdge pop 2 div dup 2 exp r r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 mul add dup 5 1 roll 90 sub PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED % DG/SR modification end } def /HPutPos { LPutPos } def /VPutPos { LPutPos } def r AngleA 90 sub a add AngleA 270 add a sub tx@Dict begin /angleB ED /angleA ED /r ED /c 57.2957 r Div def /y ED /x ED } def /NCBox { /d ED /h ED /AngleB yB yA sub xB xA sub Atan def /AngleA AngleB 180 add def GetEdgeA GetEdgeB /dx d AngleB sin mul def /dy d AngleB cos mul neg def /hx h AngleB sin mul neg def /hy h AngleB cos mul def /LPutVar [ xA1 hx add yA1 hy add xB1 hx add yB1 hy add xB1 dx add yB1 dy add xA1 dx add yA1 dy add ] cvx def /LPutPos { LPutLines } def /HPutPos { xB yB xA yA LPutLine } def /VPutPos { HPutPos } def mark LPutVar tx@Dict begin false Polygon end } def /NCArcBox { /l ED neg /d ED /h ED /a ED /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def /tA AngleA a sub 90 add def /tB tA a 2 mul add def /r xB xA sub tA cos tB cos sub Div dup 0 eq { pop 1 } if def /x0 xA r tA cos mul add def /y0 yA r tA sin mul add def /c 57.2958 r div def /AngleA AngleA a sub 180 add def /AngleB AngleB a add 180 add def GetEdgeA GetEdgeB /AngleA tA 180 add yA yA1 sub xA xA1 sub Pyth c mul sub def /AngleB tB 180 add yB yB1 sub xB xB1 sub Pyth c mul add def l 0 eq { x0 y0 r h add AngleA AngleB arc x0 y0 r d add AngleB AngleA arcn } { x0 y0 translate /tA AngleA l c mul add def /tB AngleB l c mul sub def 0 0 r h add tA tB arc r h add AngleB PtoC r d add AngleB PtoC 2 copy 6 2 roll l arcto 4 { pop } repeat r d add tB PtoC l arcto 4 { pop } repeat 0 0 r d add tB tA arcn r d add AngleA PtoC r h add AngleA PtoC 2 copy 6 2 roll l arcto 4 { pop } repeat r h add tA PtoC l arcto 4 { pop } repeat } ifelse closepath /LPutVar [ x0 y0 r AngleA AngleB h d ] cvx def /LPutPos { LPutVar /d ED /h ED /AngleB ED /AngleA ED /r ED /y0 ED /x0 ED t 1 le { r h add AngleA 1 t sub mul AngleB t mul add dup 90 add /NAngle ED PtoC } { t 2 lt { /NAngle AngleB 180 add def r 2 t sub h mul t 1 sub d mul add add AngleB PtoC } { t 3 lt { r d add AngleB 3 t sub mul AngleA 2 t sub mul add dup 90 sub /NAngle ED PtoC } { /NAngle AngleA 180 add def r 4 t sub d mul t 3 sub h mul add add AngleA PtoC } ifelse } ifelse } ifelse y0 add /Y ED x0 add /X ED } def /HPutPos { LPutPos } def /VPutPos { LPutPos } def } def /Tfan { /AngleA yB yA sub xB xA sub Atan def GetEdgeA w xA1 xB sub yA1 yB sub Pyth Pyth w Div CLW 2 div mul 2 div dup AngleA sin mul yA1 add /yA1 ED AngleA cos mul xA1 add /xA1 ED /LPutVar [ xA1 yA1 m { xB w add yB xB w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos { LPutLines } def /VPutPos@ { LPutVar flag { 8 4 roll pop pop pop pop } { pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine } def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin /ArrowA { moveto } def /ArrowB { } def false Line closepath end } def /LPutCoor { NAngle tx@Dict begin /NAngle ED end gsave CM STV CP Y sub neg exch X sub neg exch moveto setmatrix CP grestore } def /LPut { tx@NodeDict /LPutPos known { LPutPos } { CP /Y ED /X ED /NAngle 0 def } ifelse LPutCoor } def /HPutAdjust { Sin Cos mul 0 eq { 0 } { d Cos mul Sin div flag not { neg } if h Cos mul Sin div flag { neg } if 2 copy gt { pop } { exch pop } ifelse } ifelse s add flag { r add neg } { l add } ifelse X add /X ED } def /VPutAdjust { Sin Cos mul 0 eq { 0 } { l Sin mul Cos div flag { neg } if r Sin mul Cos div flag not { neg } if 2 copy gt { pop } { exch pop } ifelse } ifelse s add flag { d add } { h add neg } ifelse Y add /Y ED } def end % END pst-node.pro %%EndProcSet %%BeginProcSet: special.pro %! TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N /vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N /rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N /@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{ /hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B /@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{ /urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known {userdict/md get type/dicttype eq{userdict begin md length 10 add md maxlength ge{/md md dup length 20 add dict copy def}if end md begin /letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{ itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack} if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{ noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{ Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale }if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState save N userdict maxlength dict begin/magscale true def normalscale currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts /psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR/showpage{}N/erasepage{}N/copypage{}N/p 3 def @MacSetUp}N/doclip{ psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath moveto}N/endTexFig{end psf$SavedState restore}N/@beginspecial{SDict begin/SpecialSave save N gsave normalscale currentpoint TR @SpecialDefaults count/ocount X/dcount countdictstack N}N/@setspecial{ CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR }{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto closepath clip}if/showpage{}N/erasepage{}N/copypage{}N newpath}N /@endspecial{count ocount sub{pop}repeat countdictstack dcount sub{end} repeat grestore SpecialSave restore end}N/@defspecial{SDict begin}N /@fedspecial{end}B/li{lineto}B/rl{rlineto}B/rc{rcurveto}B/np{/SaveX currentpoint/SaveY X N 1 setlinecap newpath}N/st{stroke SaveX SaveY moveto}N/fil{fill SaveX SaveY moveto}N/ellipse{/endangle X/startangle X /yrad X/xrad X/savematrix matrix currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix}N end %%EndProcSet TeXDict begin 40258437 52099154 1000 600 600 (ibd_coeff.dvi) @start %DVIPSBitmapFont: Fa lcmss8 12 9 /Fa 9 58 df<140F4A7E143F14FF1303131F0007B5FC127FB6FCA25BEA7FF0EA3C00C7FC B3B3AD003FB612FE4815FFA46C15FE284475C33E>49 DIII<48B712F848825AA45F01F8CAFCB0EC07FF027F13F001F9B5 12FC90B7FC8383DAFC037F9139C0007FF091C7EA1FF8496E7E01F86E7EA26C486E7E6C5A C96C1380A37013C0A95E1880120C001C5D003E1700007F5D486C5D6D140F01F04A5A6C6C EC7FF86CB449485A6CD9E00F5B000790B65A6C5E6C4BC7FC6C6C5C011F14F00103148090 26003FF8C8FC32447BC13E>II<007FB812 C0B912E0A56C1780C9000113004C5A4C5A4C5A4C5A4C5A4C5A4C5A5D94C7FC4B5A4B5A4B 5AA24B5A4B5AA24B5A4B5AA24A90C8FCA24A5AA24A5AA24A5AA34A5AA24A5AA34A5AA314 FF5DA44990C9FCA65B5CAA6D5A33437BC13E>III E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fb cmmi8 16.59 1 /Fb 1 84 df<942603FFC01460053F01FC14F04CB6EA800104079238E003E0041FEDF007 933B7FFE007FF80FDCFFF090380FFC1F4B0180D901FE13C0DB07FEC8EA7F3F4B48ED3FFF DB1FF0814B486F13804B48814B5A4A90C97E4B180014034A48825D020F605D021F1700A2 023F605DA3027F60A36F1601631A006F94C7FCA281816E7E16C016F06E13FF17F06E14FF 18F06E15FF6E16E06E16F86E826F15FF031F82030782030182ED001F040181DC001F8017 01DD001F7F180384726C7E193FA2191F190FA3190713F01201A21203625BA20007180F62 A262000F181FA26D4D5A62001F187F6D4D5A97C8FC6D5E003F4D5A6D4C5A6D4C5A6E4B5A 486DED7FE0D9DFF04B5AD98FFC020390C9FC902607FF80EB0FFED8FE0101FCEBFFFC486C 90B612F048013F15C0020F92CAFC48010114F848D9000F1380546478E059>83 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fc cmmi8 10 4 /Fc 4 117 df<163FED1FFFA3ED007F167EA216FEA216FCA21501A216F8A21503A216F0 A21507A2027E13E0903803FF87010F13CF90381F81EF90397F00FFC001FC137F485A0003 143F484814805B120F485A1600485A5D127F90C7127EA215FE5A485CA21401A248ECF80E A21403161E913807F01CA2007E010F133C021F1338003E013F1378003F01F913703A1F83 F1F8F03A0FFFC0FFE000039038807FC03A00FC001F00283B7CB92D>100 D110 D115 D<14E0497E1303A413075CA3130F5CA3131F5C00 7FB512E0A2B6FCD8003FC7FCA35B137EA313FE5BA312015BA312035BA312079038E001C0 A21403000F1480EBC007EC0F00140E141E5C00075BEBE1F06CB45A6C1380D8007EC7FC1B 357FB320>I E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fd lcmss8 13.82 16 /Fd 16 119 df49 D<913807FFE0027F13FE0103B612C0010F15F04915FC4915FF90B87E488348D9F8018048 9026C0000F7F91C700037FD80FFC02007F4848ED3FFE49151F003F707E498148486F1380 A248488119C06CCAFC7E121E120E1206CBFCA45F1980A25F19005F604D5A171F604D5A4D 5A4D5A4C5B4C90C7FC4C5AEE1FFC4C5A4C5AEEFFC003035B4B90C8FCED0FFCED3FF84B5A EDFFC002035B4A48C9FC4A5A4A5AEC7FE04A5A495B4990CAFCEB07FCEB1FF8495AEB7FC0 495A000390CBFCEA07FC48B912805A007F18C0A46C18807E3A4E7ACD48>I97 D100 D<913803FF80021F13F0027F13FE49B67E010781 4915F049814901007FD97FF8EB1FFED9FFE0130748496D7E48490100138091C8127F4848 16C04848153F49ED1FE0485AA24848ED0FF0A34848150718F8A25B12FF1703A390B8FCA3 18F0A20180CAFCA4127F7FA36C7EA27F121F7F6C6C1630000717F06D15016C6C15036C6D 140F02E0141F6C6D147FD97FFCEB03FF90273FFF803F13C06D90B61280010716006D15FC 010015F0023F14C0020791C7FC020013F0353F7ABD40>I<92381FFFC04AB512FC140714 1F5C5C91B6FC49EBF00349903880003C4948C8FC14F8130FAA003FB612F05AB77EA36C5D A226000FF8C8FCB3B3AF6D5A13032E517DD02C>I<913A01FF8003F8021F13F0027F9038 F807FC49B512FE4914FF010F15874915C7499038E03FE749EB0007D9FFF8EB03F74849EB 00FF4801C0147F5C4890C8123F485A49151F121F49150F485A17075B127FA25BA212FF5B A96D150FA2127FA26D151FA26C7E173F6C7E6D157F6C7E6D15F76C6D13016C6DEB03E76C 01F013076C01FCEB1FC7903A7FFF807F876D90B512076D14FE6D14FC010314F8010014F0 023F13C0913807FE0091C8FCA318F8A2170F18F0171FA20006EE3FE0D80FC0EDFFC001F8 4A138001FF140702F8013F130091B65A5F6C16F06C5ED8003F158001034AC7FCD9000F13 E036507ABC48>I105 D<123F5AEAFF80B3B3B3B3A4EA7F007E095075CF20> 108 DIII114 DI<003F167F5A486CEDFF80B3B3A45EA35EA2 5E6D5C5E007F153E6D14FE01F8EB03FC6CB4EB1FF891B55A6C15C06C5D6C5D000102FCEB 7F006C14E0010F90C9FC313D75BB48>117 D<007E173FB4EF7F806D16FF6D5D007F1800 7F003F4C5AA26D1507001F5F7F000F4C5AA26D151F00075F7F00034C5AA26D157F6C5F80 6C4C5AA26E5B017F93C7FC80013F4A5AA26E1307011F5D80010F4A5AA26E131F01075D80 01034A5AA26E137F6D5D15806D4A5AA281DA7FC190C8FCA291383FE3FEA215F391381FF7 FCA26EB45AA36E5BA26E5BA26E5B6E6CC9FC393C7DBB40>I E %EndDVIPSBitmapFont end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%EndSetup 0 0 bop -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 347.12273 330.05112 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {347.12273 330.05112 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 381.26595 330.05112 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {381.26595 330.05112 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 347.12273 295.9079 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {347.12273 295.9079 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -233 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 381.26595 295.9079 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -233 3946 a tx@Dict begin tx@NodeDict begin {381.26595 295.9079 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -233 3946 a 937 1243 a Fd(genes)47 b(from)g(1)1706 1203 y Fc(st)1830 1243 y Fd(individual)924 1530 y(genes)g(from)g(2)1693 1490 y Fc(nd)1843 1530 y Fd(individual)-185 3946 y @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i2 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 443.86185 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {443.86185 227.62146 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 478.00507 227.62146 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {478.00507 227.62146 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 443.86185 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {443.86185 193.47824 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 478.00507 193.47824 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {478.00507 193.47824 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 34.14322 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {34.14322 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 68.28644 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {68.28644 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i3 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 136.57288 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {136.57288 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 170.7161 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {170.7161 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i2 /N@i4 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 239.00253 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {239.00253 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 273.14575 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {273.14575 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a -185 3946 a tx@Dict begin gsave STV newpath 0.75 SLW 0. setgray /ArrowA { moveto } def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 0.0 0.0 0 0 /N@i1 /N@i3 InitNC { NCLine } if end gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore grestore end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 102.42966 2.84526 } false /N@i1 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 102.42966 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0. setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 102.42966 2.84526 } false /N@i2 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 341.43219 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {341.43219 68.28644 2.84526 } false /N@i3 11 {InitCnode } NewNode end end -185 3946 a @beginspecial @setspecial tx@Dict begin STP newpath 0.75 SLW 0. setgray 375.57541 68.28644 2.84526 .5 CLW mul sub 0 360 arc closepath gsave 0.5 setgray fill grestore gsave 0.75 SLW 0. setgray 0 setlinecap stroke grestore end @endspecial -185 3946 a tx@Dict begin tx@NodeDict begin {375.57541 68.28644 2.84526 } false /N@i4 11 {InitCnode } NewNode end end -185 3946 a 162 2614 a Fb(S)251 2632 y Fa(1)1013 2614 y Fb(S)1102 2632 y Fa(2)1863 2614 y Fb(S)1952 2632 y Fa(3)2713 2614 y Fb(S)2802 2632 y Fa(4)3564 2614 y Fb(S)3653 2632 y Fa(5)162 3653 y Fb(S)251 3671 y Fa(6)1013 3653 y Fb(S)1102 3671 y Fa(7)1863 3653 y Fb(S)1952 3671 y Fa(8)2713 3653 y Fb(S)2802 3671 y Fa(9)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF %%EndDocument @endspecial 750 2009 a Fl(Figure)27 b(4:)36 b(The)28 b(nine)g(condensed)f(iden)n(tit)n(y)g(states)h(for)f(2)g(individuals) 140 2274 y Fe(N.B.)34 b Fl(In)i(most)g(cases,)g(p)r(edigree)f(pruning)h (should)f(b)r(e)h(turned)g Fj(o\013)53 b Fl(in)36 b Fk(prep)e Fl(when)i(IBD)g(estimation)f(is)140 2374 y(p)r(erformed)c(\(5.20\).)49 b(If)33 b(not)e(then)i(individuals)f(ma)n(y)f(b)r(e)h(missing)f(from)h (the)g(output)g(matrices.)49 b(Pruning,)135 2474 y(though)22 b(useful)g(in)g(most)g(other)f(cases,)h(should)g(only)f(b)r(e)h(left)h (on)e(with)i(IBD)f(estimation)g(if)g(y)n(ou)f(kno)n(w)g(exactly)140 2573 y(what)28 b(y)n(ou)e(are)h(doing!)140 2839 y Fe(7.3.1)94 b(Output)32 b(options)134 3042 y Fl(In)20 b(con)n(trast)f(to)h(earlier) f(v)n(ersions)g(of)27 b Fk(loki)p Fl(,)20 b(only)g(one)g(set)g(of)h (estimates)f(of)g(the)h(IBD)f(matrices)g(are)f(calculated)133 3142 y(\(at)i(the)f(end)h(of)f(the)g(sampling)g(run\).)34 b(If)27 b Fk(loki)19 b Fl(is)h(in)n(terrupted)g(\(b)n(y)g(the)h (receipt)e(of)i(a)e(signal\),)i(it)g(will)f(generate)140 3241 y(a)31 b(set)g(of)g(estimates)g(b)r(efore)g(quitting.)48 b(Note)32 b(that)f(this)h(can)e(tak)n(e)h(some)g(time)g(\(as)g(the)h (\014les)f(can)g(b)r(e)h(v)n(ery)140 3341 y(large\),)37 b(and)f(it)h(ma)n(y)e(not)h(alw)n(a)n(ys)e(b)r(e)j(p)r(ossible)e(for)h Fk(loki)f Fl(to)h(complete)g(this)g(successfully)g(in)g(time)h(\(for) 140 3440 y(example,)27 b(if)h(the)g(host)g(computer)f(is)g(sh)n(utting) h(do)n(wn\).)135 3590 y(Three)22 b(output)h(formats)f(are)f(curren)n (tly)g(o\013ered,)i(the)g(default)g Fk(loki)e Fl(format,)i(a)f(MERLIN)g (t)n(yp)r(e)g(format)g(and)136 3689 y(a)g(SOLAR)h(t)n(yp)r(e)g(format.) 35 b(The)23 b Fk(loki)e Fl(and)h(MERLIN)h(outputs)g(are)f(written)h(to) g(a)f(single)g(\014le)h(\(default)h(name)139 3789 y Fk(loki.ibd)p Fl(\),)g(whic)n(h)j(the)g(SOLAR)g(output)g(is)g(written)g(to)g(a)f(set) h(of)f(\014les,)h(one)g(\014le)g(p)r(er)f(p)r(osition)h(estimated.)140 3889 y(These)k(\014les)h(are)f(written)h(to)f(a)g(directory)g (\(default)h(name)g Fk(loki_ibd)p Fl(\).)46 b(Within)33 b(this)f(directory)-7 b(,)31 b(the)h(\014le)140 3988 y(names)c(ob)r(ey)g(the)h(SOLAR)f(naming)h(sc)n(heme,)f(so)g(the)g (\014le)h(for)f(p)r(osition)g(13.4)f(on)h(c)n(hromosome)f(11)g(will)i (b)r(e)140 4088 y(called)h Fk(mibd.11.13.4.gz)25 b Fl(\(if)31 b(compressed\).)45 b(This)31 b(naming)f(sc)n(heme)g(can)g(not)h(b)r(e)g (c)n(hanged.)44 b(Note)31 b(that)140 4188 y(to)f(prop)r(erly)g(follo)n (w)f(the)i(SOLAR)g(sc)n(heme,)f(the)h(c)n(hromosome)d(names)i(should)g (b)r(e)h(n)n(umeric)f(-)g(this)h(is)f(not)140 4287 y(enforced)d(b)n(y)h Fk(loki)p Fl(.)140 4437 y(The)g(default)g(\014le)f(names)h(can)f(b)r(e) h(c)n(hanged)e(using)i(the)g(follo)n(wing)e(commands:)140 4653 y Fk(OUTPUT)41 b(IBD)h(FILE)g("myibdfile")d(#)44 b(For)e(MERLIN)f(format)140 4752 y(OUTPUT)g(IBD)h(DIR)h("myibd_dir")c (#)k(For)f(SOLAR)g(format)139 4968 y Fl(T)-7 b(o)26 b(reduce)g(the)h (size)f(of)h(the)f(output)h(\014les,)g Fk(loki)e Fl(can)h(compress)f (the)i(output)g(\(for)f(all)h(formats\))f(using)g(gzip)140 5068 y(\(highly)i(recommended!\).)36 b(This)28 b(is)f(done)h(using)f (the)h(follo)n(wing)e(command:)140 5283 y Fk(COMPRESS)40 b(IBD)j(OUTPUT)140 5383 y(COMPRESS)d(OUTPUT)h(IBD)i(#)g(Alternate)d (command)g(format)140 5599 y Fl(When)35 b(this)g(option)f(is)g(used,)i Fk(.gz)d Fl(will)i(b)r(e)f(app)r(ended)h(to)f(the)h(output)g(\014le)f (name,)i(unless)e(the)h(sp)r(eci\014ed)140 5699 y(name)27 b(already)g(ends)g(in)h Fk(.gz)p Fl(.)1831 5962 y(31)p eop end %%Page: 32 32 TeXDict begin 32 31 bop 140 231 a Fe(7.3.2)94 b(Output)32 b(F)-8 b(ormats)140 434 y Fl(The)28 b(output)g(format)f(for)g(the)h (IBD)g(estimates)f(is)h(selected)f(as)g(in)h(the)g(follo)n(wing)e (examples:)140 650 y Fk(OUTPUT)41 b(IBD)h(LOKI)g(#)i(Default)c(output)h (format)140 750 y(OUTPUT)g(IBD)h(MERLIN)140 850 y(OUTPUT)f(IBD)h(SOLAR) 140 1065 y Fl(The)37 b(main)h(output)g(to)f(the)g(screen)g(consists)f (only)h(of)h(the)f(iterations)g(coun)n(t.)65 b(The)38 b(other)f(output)g(\014les)140 1165 y(\(notable)27 b Fk(loki.out)p Fl(\))e(are)i(not)g(pro)r(duced.)37 b(The)28 b(trait)f(lo)r(cus)g(co)r(de)h(is)f(not)h(in)n(v)n(ok)n(ed)e(at)h(all.) 140 1431 y Fe(7.3.3)94 b(Default)32 b(\()p Fk(loki)p Fe(\))e(format)140 1634 y Fl(An)e(example)f(fragmen)n(t)g(of)h(the)g (default)g(output)g(format)f(is)g(sho)n(wn)g(b)r(elo)n(w:)140 1850 y Fk(Iteration)40 b(200)140 2049 y(**Linkage)g(group)h(chromosome) f(1:)140 2248 y(**Position)f(=)44 b(0)140 2348 y(1)f(1)g(1)h(1)140 2447 y(2)f(2)g(1)h(1)140 2547 y(4)f(1)g(0.5)g(0)140 2647 y(4)g(2)g(0.5)g(0)140 2746 y(4)g(4)g(1)h(1)140 2846 y(5)f(1)g(0.5)g(0) 140 2945 y(5)g(2)g(0.5)g(0)140 3045 y(5)g(4)g(0.3975)e(0.15)140 3145 y(5)i(5)g(1)h(1)140 3244 y(6)f(6)g(1)h(1)140 3344 y(7)f(1)g(0.5)g(0)140 3444 y(7)g(2)g(0.5)g(0)140 3543 y(7)g(4)g(0.485)f(0.23)140 3643 y(7)h(5)g(0.4425)e(0.21)140 3742 y(7)i(7)g(1)h(1)137 3958 y Fl(As)25 b(can)f(b)r(e)g(seen,)h(the)g (output)g(starts)e(with)i(a)f(small)g(header)g(giving)f(the)i (iteration)f(n)n(um)n(b)r(er,)h(link)-5 b(age)23 b(group)140 4058 y(and)29 b(p)r(osition)g(for)g(whic)n(h)h(the)f(estimates)g(are)g (for.)42 b(This)29 b(is)g(then)h(follo)n(w)n(ed)e(b)n(y)i(2)2765 4037 y(^)2756 4058 y(\010)e(and)3040 4037 y(^)3008 4058 y(\001)3077 4070 y Fg(7)3144 4058 y Fl(for)g(eac)n(h)h(pair)140 4158 y(of)f(individuals)f(for)g(whom)1038 4137 y(^)1029 4158 y(\010)c Fc(>)f Fl(0.)140 4307 y(Note)29 b(that)h(if)g(family)g (ids)f(are)g(used)g(\(so)g(the)h(second)f(form)g(of)g(the)h(PEDIGREE)e (command)h(is)g(used)h(with)135 4407 y Fk(prep)p Fl(\),)23 b(then)g(there)f(will)h(b)r(e)g(an)f(extra)f(column)i(with)g(the)g (family)f(name)h(b)r(efore)f(the)h(individual)f(id)h(columns.)140 4672 y Fe(7.3.4)94 b(MERLIN)31 b(format)140 4875 y Fl(An)d(example)f (fragmen)n(t)g(MERLIN)h(output)g(format)f(is)g(sho)n(wn)g(b)r(elo)n(w:) 140 5091 y Fk(1)43 b(1)g(0)h(0)f(0)g(1)140 5191 y(2)g(1)g(0)h(1)f(0)g (0)140 5290 y(2)g(2)g(0)h(0)f(0)g(1)140 5390 y(4)g(1)g(0)h(0)f(1)g(0) 140 5490 y(4)g(2)g(0)h(0)f(1)g(0)140 5589 y(4)g(4)g(0)h(0)f(0)g(1)140 5689 y(5)g(1)g(0)h(0)f(1)g(0)1831 5962 y Fl(32)p eop end %%Page: 33 33 TeXDict begin 33 32 bop 140 231 a Fk(5)43 b(2)g(0)h(0)f(1)g(0)140 331 y(5)g(4)g(0)h(0.24)d(0.485)h(0.275)140 431 y(5)h(5)g(0)h(0)f(0)g(1) 140 530 y(6)g(1)g(0)h(1)f(0)g(0)140 630 y(6)g(2)g(0)h(1)f(0)g(0)140 729 y(6)g(4)g(0)h(1)f(0)g(0)140 829 y(6)g(5)g(0)h(1)f(0)g(0)140 929 y(6)g(6)g(0)h(0)f(0)g(1)140 1028 y(7)g(1)g(0)h(0)f(1)g(0)140 1128 y(7)g(2)g(0)h(0)f(1)g(0)140 1228 y(7)g(4)g(0)h(0.165)d(0.565)h (0.27)140 1327 y(7)h(5)g(0)h(0.265)d(0.48)h(0.255)137 1543 y Fl(This)24 b(format)g(has)g(no)f(header,)i(and)f(the)g(p)r (osition)g(is)g(giv)n(en)g(in)g(the)h(3)2314 1555 y Ff(r)r(d)2409 1543 y Fl(column)f(of)g(the)h(output.)36 b(If)25 b(m)n(ultiple)140 1643 y(families)31 b(are)f(presen)n(t)g(then)i(the)f(estimates)g(for)f (the)h(\014rst)g(family)g(at)g(eac)n(h)f(p)r(osition)h(are)f(giv)n(en,) h(then)g(the)137 1742 y(second)24 b(family)g(etc.)36 b(Unlik)n(e)24 b(the)h(default)g(format,)f(an)g(output)h(line)f(exists) g(for)g(ev)n(ery)f(pair)h(\(ev)n(en)g(unrelated)140 1842 y(pairs\).)57 b(This)35 b(can)f(mak)n(e)g(the)h(output)g(m)n(uc)n(h)g (larger)e(than)h(the)h(default)g(output)h(\(ev)n(en)e(if)h (compressed\).)140 1942 y(Three)g(columns)h(of)g(IBD)g(estimates)g(are) f(giv)n(en,)i(whic)n(h)f(in)g(the)h(case)e(of)h(no-in)n(breeding)e (corresp)r(ond)g(to)138 2041 y(\001)207 2053 y Fg(9)245 2041 y Fc(;)14 b Fl(\001)351 2053 y Fg(8)388 2041 y Fc(;)g Fl(\001)494 2053 y Fg(7)532 2041 y Fl(,)26 b(the)g(probabilities)f(of)h (the)g(pair)g(sharing)e(0,)i(1)g(and)f(2)h(genes)f(IBD.)h(In)g(the)h (case)e(of)h(in)n(breeding,)140 2141 y(this)i(sc)n(heme)g(can)f(not)h (accurately)f(p)r(ortra)n(y)f(the)i(IBD)g(relationships)f(\(and)h (MERLIN)g(as)f(of)h(v)n(ersion)f(0.9.3)140 2240 y(do)r(es)36 b(not)g(try)g(to)g(calculate)g(sharing)f(probabilities)h(correctly)e (with)j(in)n(breeding\).)63 b(In)36 b(the)h(presence)e(of)140 2340 y(in)n(breeding,)i Fk(loki)d Fl(will)i(output)g(v)-5 b(alues)35 b(suc)n(h)h(that)g(the)g(last)f(column)h(\(\001)2587 2352 y Fg(7)2624 2340 y Fl(\))g(is)g(correct,)g(and)g(the)g(other)140 2440 y(columns)g(are)e(adjusted)i(so)f(that)h(if)h(\010)f(is)f (calculated)g(using)h(the)g(form)n(ula)f(for)g(non-in)n(bred)g(p)r (opulations)140 2539 y(\(\010)29 b(=)365 2507 y Fg(1)p 365 2521 34 4 v 365 2568 a(2)408 2539 y Fl(\001)477 2551 y Fg(7)535 2539 y Fl(+)631 2507 y Fg(1)p 631 2521 V 631 2568 a(4)674 2539 y Fl(\001)743 2551 y Fg(8)780 2539 y Fl(\),)j(the)g(correct)e(v)-5 b(alue)31 b(for)g(\010)g(\(allo)n(wing) f(for)g(in)n(breeding\))h(will)g(b)r(e)h(giv)n(en.)47 b(Y)-7 b(es,)32 b(this)f(is)140 2639 y(confusing)c(and)h(no,)f(I)h (don't)f(recommend)g(using)h(this)g(format)f(for)g(in)n(bred)g (families.)140 2788 y(As)39 b(b)r(efore,)i(if)f(family)f(IDs)g(are)f (used,)k(an)c(extra)g(column)h(of)g(output)g(with)h(the)f(family)g (name)g(will)g(b)r(e)140 2888 y(outputted.)140 3154 y Fe(7.3.5)94 b(SOLAR)32 b(format)140 3357 y Fl(An)c(example)f(fragmen)n (t)g(of)h(SOLAR)f(output)h(format)f(is)h(sho)n(wn)f(b)r(elo)n(w:)227 3573 y Fk(640)130 b(640)86 b(1.0000000)d(1.0000000)227 3672 y(641)130 b(641)86 b(1.0000000)d(1.0000000)227 3772 y(773)130 b(640)86 b(0.5000000)d(0.0000000)227 3871 y(773)130 b(641)86 b(0.5000000)d(0.0000000)227 3971 y(773)130 b(773)86 b(1.0000000)d(1.0000000)227 4071 y(643)130 b(643)86 b(1.0000000)d (1.0000000)227 4170 y(642)130 b(642)86 b(1.0000000)d(1.0000000)227 4270 y(774)130 b(643)86 b(0.5000000)d(0.0000000)227 4370 y(774)130 b(642)86 b(0.5000000)d(0.0000000)227 4469 y(774)130 b(774)86 b(1.0000000)d(1.0000000)227 4569 y(908)130 b(640)86 b(0.5000000)d(0.0000000)227 4668 y(908)130 b(641)86 b(0.0000000)d (0.0000000)138 4884 y Fl(This)24 b(format)h(has)f(no)h(header,)f(and)h (the)g(p)r(osition)g(is)g(giv)n(en)f(in)h(the)g(output)g(\014lename.)36 b(The)25 b(\014rst)g(2)f(columns)140 4984 y(are)37 b(the)h(SOLAR)h(IBD) f(IDs,)j(or)c(in)n(ternal)g(IDs)i(for)e(the)i(pair,)h(follo)n(w)n(ed)d (b)n(y)g(2\010)h(and)g(\001)3076 4996 y Fg(7)3113 4984 y Fl(,)j(as)c(with)i(the)140 5084 y(default)g(format.)67 b(The)38 b(IBD)h(estimates)f(are)f(alw)n(a)n(ys)f(prin)n(ted)i(to)g (the)g(same)g(precision.)67 b(T)-7 b(o)38 b(kno)n(w)f(the)140 5183 y(corresp)r(ondence)29 b(b)r(et)n(w)n(een)i(the)g(original)f(IDs)h (and)g(the)g(SOLAR)g(IBD)h(IDs,)g Fk(loki)d Fl(needs)i(to)g(read)f(in)h (t)n(w)n(o)135 5283 y(output)23 b(\014les)g(from)f(SOLAR,)h Fk(pedindex.cde)17 b Fl(and)22 b Fk(pedindex.out)p Fl(.)31 b(These)22 b(should)g(b)r(e)h(put)g(in)g(the)g(curren)n(t)139 5382 y(directory)-7 b(.)36 b(With)27 b(these,)h Fk(loki)d Fl(will)i(b)r(e)g(able)g(to)f(automatically)g(translate)g(the)h(IDs)g (for)g(SOLAR.)f(Output)140 5482 y(lines)34 b(are)f(only)h(giv)n(en)g (for)f(related)h(individuals,)i(so)d(the)i(\014les)f(size)g(tends)g(to) g(b)r(e)h(similar)e(to)h(the)h(default)140 5582 y(output,)28 b(and)g(smaller)e(than)i(MERLIN)g(output.)1831 5962 y(33)p eop end %%Page: 34 34 TeXDict begin 34 33 bop 140 231 a Fo(8)135 b(Analysis)45 b(Scripts)g(and)f(Utilit)l(y)k(Programs)140 463 y Fl(It)31 b(is)g(not)g(straigh)n(tforw)n(ard)d(to)j(lo)r(ok)g(directly)f(at)h (the)h(output)f(from)g(Loki)f(and)h(mak)n(e)f(conclusions)g(ab)r(out) 139 563 y(whether)d(there)f(is)h(link)-5 b(age)26 b(to)h(a)f(region,)g (ho)n(w)g(man)n(y)g(QTLs)g(are)g(in)h(the)g(mo)r(del,)g(what)g(size)g (of)f(QTLs)g(ha)n(v)n(e)140 662 y(b)r(een)k(found)g(etc.)42 b(F)-7 b(or)29 b(this)h(reason,)e(sev)n(eral)g(p)r(erl)h(scripts)g(and) g(small)g(utilit)n(y)h(programs)d(in)j(C)g(ha)n(v)n(e)e(b)r(een)140 762 y(supplied)g(with)g(Loki.)37 b(These)27 b(can)h(b)r(e)g(used)f(to)h (read)f(the)h(output)g(\014les)g(from)f(Loki,)g(and)h(pro)r(duce)f (either)h(a)140 862 y(text)i(rep)r(ort,)f(a)g(selection)f(of)i(columns) f(of)g(data)g(or)f(a)h(graphical)f(view)h(of)g(the)h(data.)41 b(The)30 b(graphical)e(view)140 961 y(of)33 b(the)g(data)g(requires)e (that)i Fk(gnuplot)d Fl(b)r(e)k(installed)f(on)f(the)i(system.)52 b(This)33 b(is)g(a)f(widely)h(a)n(v)-5 b(ailable)32 b(data)138 1061 y(plotting)26 b(utilit)n(y)g(whic)n(h)f(can)g(b)r(e)h(do)n (wnloaded)e(from)h(ftp.dartmouth.edu/pub/gn)n(uplot.)36 b(A)26 b(w)n(eb)f(page)g(for)140 1160 y Fk(gnuplot)g Fl(can)i(b)r(e)h(found)g(at)f(h)n(ttp://www.cs.dartmouth.edu/gn)n (uplot.)140 1438 y Fh(8.1)112 b(Extracting)37 b(information)i(on)e (e\013ects:)51 b Fa(loki)p 2312 1438 31 4 v 38 w(ext.pl)140 1642 y Fl(The)34 b(p)r(erl)g(script)f Fk(loki_ext.pl)d Fl(can)j(b)r(e)h(used)g(to)g(extract)f(information)g(from)h(the)g Fk(loki.out)d Fl(\014le)j(suc)n(h)137 1741 y(that)24 b(it)g(can)g(b)r(e)g(used)g(b)n(y)g(other)f(programs)f(and/or)g (scripts.)36 b(Probably)22 b(the)i(t)n(w)n(o)f(most)h(useful)h (applications)138 1841 y(of)h(this)g(script)g(are)e(to)i(extract)f (information)g(ab)r(out)h(QTLs)f(and)g(to)h(extract)f(information)g(ab) r(out)h(co)n(v)-5 b(ariate)140 1940 y(e\013ects.)37 b(T)-7 b(o)27 b(do)h(the)g(former,)e(the)i(script)g(is)f(in)n(v)n(ok)n(ed)f (lik)n(e)h(this:)140 2137 y Fk(loki_ext.pl)39 b(-x)140 2237 y(loki_ext.pl)g(-x)k(-c2)140 2336 y(loki_ext.pl)c(-x)k(-c2)f (-r20.3:25.7)140 2436 y(loki_ext.pl)d(-x)k(-c2)f(-r20.3)140 2536 y(loki_ext.pl)d(-x)k(-c2)f(-r:25.7)140 2635 y(loki_ext.pl)d(-x)k (-i2000)140 2735 y(loki_ext.pl)c(-x)k(-i2000:5000)140 2834 y(loki_ext.pl)c(-x)k(-i:5000)140 3031 y Fl(The)29 b(-x)f(option)g(sp)r(eci\014es)g(an)g(extract)g(op)r(eration.)38 b(The)29 b(\014rst)f(example)g(extracts)f(all)i(QTLs)e(link)n(ed)i(to)f (the)135 3131 y(\014rst)23 b(link)-5 b(age)22 b(group)f(\(this)i(is)g (the)g(default\))g(and)g(outputs)f(the)h(relev)-5 b(an)n(t)22 b(columns)h(to)f(stdout.)35 b(The)23 b(-c)f(option)140 3230 y(in)30 b(the)h(second)e(and)h(third)g(examples)f(indicate)h(that) g(QTLs)f(link)n(ed)h(to)g(the)g(second)g(c)n(hromosome)e(should)140 3330 y(b)r(e)j(extracted.)44 b(The)30 b(-r)g(option)g(sp)r(eci\014es)g (a)g(range)f(of)h(c)n(hromosome)e(p)r(ositions)i(to)g(lo)r(ok)f(for)h (QTLs.)44 b(Note)140 3430 y(that)32 b(either)g(or)e(b)r(oth)j(of)e(a)h (starting)e(and)i(stopping)f(lo)r(cation)g(can)h(b)r(e)g(giv)n(en.)48 b(The)32 b(-i)g(option)f(sp)r(eci\014es)h(a)140 3529 y(range)27 b(of)h(iterations)g(to)g(consider.)38 b(As)29 b(with)g(the)f(-r)g(option,)g(either)h(or)e(b)r(oth)i(of)f(a)g (starting)g(and)g(stopping)140 3629 y(iteration)f(ma)n(y)g(b)r(e)h(giv) n(en.)136 3778 y(The)23 b(n)n(um)n(b)r(er)g(of)f(columns)h(output)h (dep)r(ends)f(on)g(whether)f(the)i(sp)r(eci\014ed)f(link)-5 b(age)22 b(group)g(is)h(0)f(\(meaning)h(the)138 3878 y(`unlink)n(ed')i(group\))f(in)h(whic)n(h)f(case)g(no)h(QTL)f(p)r (osition)h(information)f(is)h(output,)h(and)f(whether)f(sex)h(sp)r (eci\014c)135 3977 y(maps)c(are)g(b)r(eing)h(used,)h(in)f(whic)n(h)g (case)f(b)r(oth)h(male)g(and)g(female)f(map)h(p)r(ositions)g(are)e (output.)36 b(F)-7 b(or)21 b(a)h(normal)140 4077 y(c)n(hromosome)30 b(with)i(a)f(sex)g(a)n(v)n(eraged)e(map,)j(the)h(output)f(order)e(is:) 45 b(iteration,)32 b(map)f(p)r(osition,)i(frequency)140 4177 y(of)d(`1')g(allele,e\013ect)g(of)g(`12')g(genot)n(yp)r(e,)g (e\013ect)g(of)h(`22')e(genot)n(yp)r(e,)h(size)g(of)g(QTL,)g(\045)g (genetic)g(v)-5 b(ariance)29 b(due)140 4276 y(to)j(QTL,)f(\045)h(total) g(v)-5 b(ariance)31 b(due)h(to)g(QTL.)f(Note)h(that)g(the)g(total)g(v) -5 b(ariance)31 b(used)g(to)h(calculate)f(the)i(last)140 4376 y(column)28 b(is)f(the)h(v)-5 b(ariance)26 b(after)i(adjusting)f (for)g(an)n(y)g(en)n(vironmen)n(tal)f(co)n(v)-5 b(ariates.)140 4525 y(T)e(o)27 b(extract)g(information)g(ab)r(out)h(co)n(v)-5 b(ariate)25 b(e\013ects)j(the)g(script)f(is)h(in)n(v)n(ok)n(ed)e(as)h (giv)n(en)g(b)r(elo)n(w:)140 4722 y Fk(loki_ext.pl)39 b(-C)140 4822 y(loki_ext.pl)g(-D)139 5018 y Fl(Using)26 b(the)g(-C)g(option,)h(loki)p 1044 5018 25 4 v 29 w(ext)f(simply)h (strips)e(of)i(an)n(y)e(QTL)h(columns)g(and)g(the)g(header)g(from)g Fk(loki.out)p Fl(,)140 5118 y(and)j(outputs)g(the)g(remainder.)39 b(The)29 b(column)g(order)e(is)i(therefore)f(as)g(giv)n(en)g(in)h(the)g (header)f(to)h Fk(loki.out)p Fl(,)138 5218 y(and)c(will)h(c)n(hange)e (dep)r(ending)i(on)f(whic)n(h)g(v)n(ersion)f(of)i(Loki)e(and)i(whic)n (h)f(output)h(t)n(yp)r(e)g(is)f(b)r(eing)g(used.)37 b(Using)136 5317 y(the)23 b(-D)g(option)f(will)h(giv)n(e)f(a)g(`standardized')g (set)h(of)g(columns)f(whic)n(h)h(should)f(b)r(e)i(consisten)n(t)e (across)f(di\013eren)n(t)140 5417 y(v)n(ersions)26 b(and)i(output)g(t)n (yp)r(es.)37 b(As)28 b(b)r(efore,)g(the)g(-i)f(option)h(can)f(b)r(e)h (used)g(to)g(sp)r(ecify)g(a)f(range)f(of)i(iterations.)140 5516 y(The)g(output)g(format)f(for)g(the)h(-D)g(option)f(is)g(as)g (follo)n(ws:)241 5713 y(1.)42 b(Iteration)1831 5962 y(34)p eop end %%Page: 35 35 TeXDict begin 35 34 bop 241 231 a Fl(2.)42 b(No.)36 b(QTL)27 b(in)h(mo)r(del)241 397 y(3.)42 b(No.)36 b(link)n(ed)28 b(QTL.)f(in)h(mo)r(del)241 563 y(4.)42 b(Grand)27 b(mean)241 729 y(5.)42 b(Residual)27 b(v)-5 b(ariance)241 896 y(6.)42 b(T)-7 b(au)241 1062 y(7.)42 b(T)-7 b(otal)27 b(genetic)g(v)-5 b(ariance)241 1228 y(8.)42 b(.)13 b(.)h(.)g(Remainder)27 b(of)h(non)f(QTL)g(data)h(columns)137 1443 y(The)d(output)g(from)g Fk(loki_ext.pl)20 b Fl(can)k(either)h(b)r(e)g(directed)g(to)f(a)g (\014le)h(and)g(further)f(analyzed)g(or)g(view)n(ed)g(b)n(y)140 1543 y(programs)h(suc)n(h)i(as)g Fk(gnuplot)p Fl(.)34 b(Alternativ)n(ely)27 b(the)h(output)g(can)g(b)r(e)g(pip)r(ed)g(in)n (to)f(a)g(program)f(suc)n(h)h(as)g Fk(qavg)140 1643 y Fl(to)g(giv)n(e)g(means)g(and)h(con\014dence)f(limits)h(for)f(the)h (columns.)140 1925 y Fh(8.2)112 b(Estimating)38 b(probabilities)h(of)f (link)-6 b(age)38 b(to)f(c)m(hromosomes:)51 b Fa(count.pl)140 2128 y Fl(The)30 b(p)r(erl)g(script)g Fk(count.pl)d Fl(reads)i(the)i (\014les)f Fk(loki.out)d Fl(and)j Fk(loki.pos)p Fl(,)e(b)r(ecause)i (the)g(latter)g(\014le)g(is)g(not)140 2228 y(pro)r(duced)g(b)n(y)g(v)n (ersions)e(of)i(loki)g(prior)f(to)h(loki)p 1646 2228 25 4 v 30 w(2.3,)g(this)g(scripts)g(only)g(w)n(orks)e(with)j(output)g (pro)r(duced)f(b)n(y)140 2327 y(loki)p 277 2327 V 29 w(2.3)d(or)g(later.)36 b(The)28 b(\014le)f(is)h(in)n(v)n(ok)n(ed)e(as)h (follo)n(ws:)140 2543 y Fk(count.pl)40 b([-q])i([-f)h(outfile])d([-p)i (posfile])e([-i)j(start:stop])c([-b)j(bin-size])e([-c)i(step])140 2759 y Fl(where)c(the)g(-f)h(and)f(-p)g(options)g(allo)n(w)f(the)h(sp)r (eci\014cation)g(of)g(alternativ)n(e)f(input)i(\014les)f(rather)g(than) g(the)140 2859 y(defaults)31 b(of)g Fk(loki.out)d Fl(and)i Fk(loki.pos)p Fl(.)44 b(By)31 b(default)g(the)g(script)g(displa)n(ys)f (on)g(the)i(screen)e(the)h(iteration)135 2958 y(coun)n(t)22 b(it)g(has)g(reac)n(hed,)g(this)g(can)g(b)r(e)h(turned)f(o\013)g(using) g(the)g(-q)g(\(for)g(quiet\))g(option.)35 b(As)22 b(with)h Fk(loki_ext.pl)p Fl(,)140 3058 y(a)33 b(range)g(of)g(iterations)g(can)g (b)r(e)h(sp)r(eci\014ed)g(using)g(the)g(-i)f(option.)55 b(Note)34 b(that)g(unlik)n(e)f Fk(loki_ext.pl)p Fl(,)e(the)135 3157 y(iteration)21 b(coun)n(t)h(is)g(from)g(the)g(\014rst)g(iteration) f(in)h(the)h(\014le,)g(whic)n(h)f(ma)n(y)f(not)h(b)r(e)g(the)h(\014rst) f(sampling)f(iteration.)140 3257 y(The)28 b(output)g(of)f Fk(count.pl)e Fl(lo)r(oks)h(something)h(lik)n(e)h(this:)140 3473 y Fk(----------------)o(---)o(--)o(--)o(---)o(--)o(---)o(--)o(---) o(--)o(--)o(---)o(--)o(-)140 3573 y(Model:)41 b(Q\(1\))h(=)h(QTL)g(+)g (AGE_AT_EXAM)c(+)k(SX)140 3672 y(Iterations:)c(9470)140 3871 y(Linkage)i(group)172 b(Count)129 b(Prop.)41 b(linked)172 b(BF)140 3971 y(----------------)o(---)o(--)o(--)o(---)o(--)o(---)o(--) o(---)o(--)o(--)o(---)o(--)o(-)140 4071 y(unlinked)433 b(9470)216 b(1.00000)f(1.00116)140 4170 y(chrom16)520 b(173)217 b(0.01827)e(0.12015)128 b(132.23)g(24.53cM)140 4270 y(chrom19)477 b(5022)216 b(0.53031)f(4.09343)g(1.02)129 b(90.32cM)140 4469 y(QTL)42 b(number)303 b(0)261 b(1)g(2)g(3)g(4)g(5)h (6)140 4569 y(----------------)o(---)o(--)o(--)o(---)o(--)o(---)o(--)o (---)o(--)o(--)o(---)o(--)o(---)o(--)o(--)o(---)o(--)o(---)o(--)140 4668 y(Overall)302 b(0.0000)41 b(0.0024)g(0.1122)h(0.4181)f(0.3219)g (0.1094)g(0.0314)140 4768 y(unlinked)258 b(0.0000)41 b(0.0720)g(0.2492)h(0.3918)f(0.2270)g(0.0492)g(0.0108)140 4868 y(chrom16)302 b(0.9817)41 b(0.0177)g(0.0005)h(0.0000)f(0.0000)g (0.0000)g(0.0000)140 4967 y(chrom19)302 b(0.4697)41 b(0.5087)g(0.0207)h (0.0010)f(0.0000)g(0.0000)g(0.0000)140 5183 y Fl(The)i(script)h(pro)r (duces)e(information)h(ab)r(out)g(the)h(mo)r(del)f(used)h(and)f(the)h (total)f(n)n(um)n(b)r(er)g(of)g(iterations)140 5283 y(measured)29 b(\(this)i(will)f(b)r(e)h(the)g(total)e(iteration)h(coun)n(t)g(less)f (the)i(iterations)e(discarded)g(at)i(the)f(b)r(eginning\).)140 5382 y(Then)i(follo)n(ws)f(a)h(table)g(giving)f(for)g(eac)n(h)g(link)-5 b(age)32 b(group)f(the)h(n)n(um)n(b)r(er)g(of)f(iterations)h(when)g (that)g(link)-5 b(age)140 5482 y(group)34 b(con)n(tains)h(a)g(QTL,)g (the)h(same)f(as)f(a)h(prop)r(ortion,)h(and)g(an)f(estimate)g(of)h(the) f(Ba)n(y)n(es)f(F)-7 b(actor)35 b(\(BF\))140 5582 y(for)28 b(link)-5 b(age)28 b(to)g(the)g(c)n(hromosome.)37 b(This)28 b(is)h(calculated)e(in)i(the)g(follo)n(wing)e(w)n(a)n(y)-7 b(.)38 b(F)-7 b(or)27 b(eac)n(h)h(link)-5 b(age)27 b(group,)140 5681 y(the)j(prior)e(probabilit)n(y)h Fc(p)g Fl(of)h(link)-5 b(age)29 b(for)g(an)n(y)f(single)h(QTL)h(is)f Fc(m=t)p Fl(,)h(where)f Fc(m)g Fl(is)g(the)h(map)g(length)f(of)h(the)1831 5962 y(35)p eop end %%Page: 36 36 TeXDict begin 36 35 bop 140 231 a Fl(c)n(hromosome)32 b(and)j Fc(t)g Fl(is)f(the)h(total)g(map)f(length)h(of)f(the)h(genome.) 57 b(These)35 b(v)-5 b(alues)34 b(should)g(b)r(e)h(set)g(in)g(the)138 331 y(parameter)23 b(\014le,)j(and)f(are)f(prin)n(ted)h(in)h(the)f (header)f(of)h Fk(loki.out)p Fl(.)33 b(If)26 b(sex)e(sp)r(eci\014c)h (maps)g(are)f(used)h(\(Section)139 431 y(6.16\),)h(then)h Fc(p)f Fl(is)g(calculated)g(as)g(\()p Fc(m)1304 443 y Ff(f)1363 431 y Fl(+)16 b Fc(m)1517 443 y Ff(m)1580 431 y Fl(\))p Fc(=)p Fl(\()p Fc(t)1716 443 y Ff(f)1775 431 y Fl(+)g Fc(t)1886 443 y Ff(m)1949 431 y Fl(\),)27 b(where)f Fc(m)2343 443 y Ff(f)2413 431 y Fl(and)g Fc(m)2646 443 y Ff(m)2736 431 y Fl(are)f(the)i(male)f(and)g(female)133 530 y(c)n(hromosome)17 b(map)i(lengths)g(and)g Fc(t)1235 542 y Ff(f)1298 530 y Fl(and)g Fc(t)1481 542 y Ff(m)1563 530 y Fl(are)f(the)i(male)f(and)g(female)h(total)f(genome)f(lengths.)34 b(F)-7 b(or)19 b(a)g(giv)n(en)134 630 y(iteration,)j(the)f(prior)e (probabilit)n(y)h(that)h(at)g(least)f(1)h(QTL)f(is)h(link)n(ed)g(to)f (a)h(c)n(hromosome)d(is)j(1)5 b Fd(\000)g Fl(\(1)g Fd(\000)g Fc(p)p Fl(\))3309 600 y Ff(n)3353 630 y Fl(,)22 b(where)139 729 y Fc(n)27 b Fl(is)f(the)h(n)n(um)n(b)r(er)g(of)g(QTLs)f(in)h(the)g (mo)r(del)f(at)h(that)g(iteration.)36 b(The)27 b(p)r(osterior)e (probabilit)n(y)h(is)g(either)h(1)f(or)137 829 y(0)e(dep)r(ending)h(on) f(whether)g(or)f(not)h(a)g(QTL)g(is)g(link)n(ed.)36 b(The)24 b(p)r(osterior/prior)d(ratio)j(for)f(eac)n(h)h(link)-5 b(age)23 b(group)137 929 y(is)i(then)g(a)n(v)n(eraged)c(o)n(v)n(er)i (iterations)h(to)g(giv)n(e)g(the)h(Ba)n(y)n(es)d(F)-7 b(actor.)35 b(An)25 b(equiv)-5 b(alen)n(t)25 b(calculation)e(is)i(p)r (erformed)136 1028 y(for)e(the)g(unlink)n(ed)g(region,)g(where)g(its)g (map)g(length)h(is)f(de\014ned)g(as)g(the)g(amoun)n(t)g(of)g(total)g (genome)f(remaining)140 1128 y(after)29 b(subtraction)g(of)h(all)g (\014tted)g(c)n(hromosomes.)41 b(After)30 b(this)g(table)g(is)g(prin)n (ted)f(the)h(distribution)g(of)g(QTL)140 1228 y(n)n(um)n(b)r(er)k(in)g (the)h(mo)r(del,)h(and)e(the)g(same)f(information)h(calculated)f(for)h (eac)n(h)f(link)-5 b(age)34 b(group)f(separately)-7 b(.)136 1327 y(The)23 b(last)f(t)n(w)n(o)g(columns)h(\(or)f(last)h(four)f (columns)h(if)g(a)g(sex)f(sp)r(eci\014c)h(map)g(is)g(b)r(eing)f(used\)) i(giv)n(e)e(the)h(maxim)n(um)140 1427 y(Ba)n(y)n(es)30 b(F)-7 b(actor)31 b(obtained)h(when)g(eac)n(h)f(c)n(hromosome)f(is)i (split)g(in)n(to)g(small)f(bins,)j(and)d(the)i(lo)r(cation)e(of)h(the) 140 1526 y(bin)g(ha)n(ving)f(the)h(maxim)n(um)g(Ba)n(y)n(es)e(F)-7 b(actor.)49 b(The)32 b(bin)g(size)f(defaults)h(to)g(1cM,)g(but)g(this)g (can)g(b)r(e)g(altered)140 1626 y(using)e(the)h(-b)g(option.)46 b(This)30 b(calculation)g(of)h(the)g(Ba)n(y)n(es)d(F)-7 b(actors)30 b(for)g(the)h(small)f(regions)f(is)i(the)g(same)f(as)140 1726 y(p)r(erformed)d(b)n(y)g Fk(dist.pl)e Fl(describ)r(ed)j(b)r(elo)n (w.)140 2007 y Fh(8.3)112 b(Estimating)38 b(probabilities)h(of)f(link) -6 b(age)38 b(to)f(small)i(regions:)50 b Fa(dist.pl)140 2210 y Fl(The)35 b(p)r(erl)g(script)g Fk(dist.pl)d Fl(reads)i(the)h (same)g(output)g(\014les)g(as)g Fk(count.pl)c Fl(\(Section)36 b(8.2\))e(and)h(pro)r(duces)140 2309 y(a)j(table)h(with)h(the)f (estimated)g(Ba)n(y)n(es)e(F)-7 b(actor)38 b(for)g(link)-5 b(age)38 b(at)h(a)f(series)g(of)h(lo)r(cations)f(along)f(the)j (\014tted)139 2409 y(c)n(hromosomes.)35 b(If)27 b Fk(gnuplot)d Fl(is)i(installed,)h(then)h(the)f(script)f(can)h(directly)f(pro)r(duce) h(graphs)e(on)i(the)g(screen)138 2509 y(or)d(pro)r(duce)g(p)r (ostscript)h(v)n(ersions)e(of)h(the)i(graphs.)34 b(F)-7 b(or)25 b(m)n(uc)n(h)f(of)h(what)g(is)g(describ)r(ed)f(b)r(elo)n(w,)h (it)h(is)e(assumed)140 2608 y(that)k Fk(gnuplot)d Fl(is)i(installed)h (and)f(y)n(our)g(P)-7 b(A)g(TH)27 b(is)h(set)f(correctly)g(so)g(it)h (can)f(b)r(e)h(found.)37 b(The)28 b(calculation)e(of)139 2708 y(the)i(Ba)n(y)n(es)d(F)-7 b(actor)26 b(estimate)h(is)g(p)r (erformed)f(in)h(the)g(same)g(w)n(a)n(y)e(as)i(describ)r(ed)f(for)h Fk(count.pl)p Fl(,)d(but)j(instead)140 2807 y(of)g(treating)g(eac)n(h)f (c)n(hromosome)g(in)h(its)h(en)n(tiret)n(y)f(the)g(c)n(hromosome)e(is)j (split)f(in)n(to)h(equally)e(sized)i(bins)f(with)140 2907 y(the)38 b(Ba)n(y)n(es)e(F)-7 b(actor)36 b(b)r(eing)i(estimated)f (separately)f(for)h(eac)n(h)g(bin.)67 b(The)37 b(script)g(has)g(n)n (umerous)g(options)138 3007 y(whic)n(h)25 b(are)f(describ)r(ed)h(b)r (elo)n(w.)36 b(If)26 b(run)f(without)h(options)e(it)i(will)g(pro)r (duce)f(a)f(graph)h(on)g(the)g(screen)g(sho)n(wing)140 3106 y(the)30 b(estimated)f(Ba)n(y)n(es)f(F)-7 b(actors)28 b(along)g(eac)n(h)h(c)n(hromosome)e(in)j(turn)f(using)g(a)g(bin)h(size) f(of)h(1cM.)f(Av)-5 b(ailable)140 3206 y(options)27 b(are:)227 3415 y Fk(-c)43 b(n)479 b(only)42 b(consider)e(the)j(nth)f(linkage)f (group)227 3515 y(-b)i(n)479 b(set)42 b(bin)h(size)f(to)g(n)i(\(cM\)) 227 3615 y(-d)f(name)347 b(use)42 b(name)g(as)h(the)f(base)g(name)g (for)h(temporary)c(files.)85 b(Don't)42 b(delete)881 3714 y(temporary)e(files)h(after)h(use.)227 3814 y(-f)h(file)347 b(select)41 b(which)h(output)f(file)h(to)g(read)g(from)g(\(defaults)e (to)j(loki.out\))227 3914 y(-p)g(file)347 b(select)41 b(which)h(position)e(file)i(to)h(read)e(from)h(\(defaults)e(to)j (loki.pos\))227 4013 y(-o)g(file)347 b(write)41 b(postscript)f(output)h (to)i(file)227 4113 y(-q)566 b(do)43 b(not)f(invoke)f(gnuplot)227 4212 y(-C)566 b(produces)40 b(color)i(postscript)d(plots)j(\(only)f (has)i(effect)e(with)h(-o\))227 4312 y(-i)h(start:stop)83 b(select)41 b(range)h(of)g(iterations)137 4522 y Fl(The)24 b(temp)r(orary)f(\014les,)h(whic)n(h)g(can)g(b)r(e)g(examined)g(b)n(y)g (use)f(of)h(the)h Fk(-d)e Fl(option)h(consist)f(of)h(a)g Fk(gnuplot)d Fl(con)n(trol)140 4621 y(\014le)35 b(and)g(a)g(data)f (\014le.)60 b(If)35 b(the)h(script)e(w)n(as)g(in)n(v)n(ok)n(ed)g(as)g Fk(dist.pl)41 b(-d)i(junk)p Fl(,)35 b(the)g(con)n(trol)f(\014le)h(w)n (ould)g(b)r(e)140 4721 y(called)27 b Fk(junk)f Fl(and)i(the)g(data)f (\014le)h Fk(junk.dat)p Fl(.)33 b(T)n(yping)27 b Fk(gnuplot)41 b(junk)26 b Fl(should)h(repro)r(duce)g(the)h(graphs.)140 5002 y Fh(8.4)112 b(Estimating)38 b(mark)m(er)g(allele)h(frequencies:) 51 b Fa(freq.pl)140 5205 y Fl(This)40 b(script)f(tak)n(es)g(the)h(ra)n (w)f(mark)n(er)f(allele)h(frequency)h(realizations)e(pro)r(duced)h (using)h(the)g(command)140 5304 y(OUTPUT)29 b(FREQUENCY)f("freq\014le") g(\(Sections)h(6.10)f(and)h(7.1.4\),)f(and)h(pro)r(duces)f(an)h(allele) g(frequency)140 5404 y(estimate)40 b(for)f(eac)n(h)f(allele.)73 b(Optionally)38 b(it)i(also)f(calculates)g(con\014dence)g(in)n(terv)-5 b(als)39 b(for)g(the)h(estimates.)140 5504 y(Example)27 b(usages)f(follo)n(w:)140 5713 y Fk(freq.pl)41 b(freqfile)1831 5962 y Fl(36)p eop end %%Page: 37 37 TeXDict begin 37 36 bop 140 231 a Fk(freq.pl)41 b(-p)h(0.025)g (freq.dat)140 444 y Fl(The)28 b(second)f(form)g(w)n(ould)h(instruct)f (the)i(script)e(to)h(pro)r(duce)f(the)h(2.5\045)f(and)h(97.5\045)e (con\014dence)i(limits)g(for)137 543 y(the)c(estimates.)35 b(The)24 b(output)g(from)g(the)g(script)f(is)h(fairly)f(self)h (explanatory;)f(the)i(second)e(form)g(of)h(the)g(script)140 643 y(pro)r(duces)j(output)h(lik)n(e)f(this:)140 855 y Fk(D1S1597)271 955 y(3)348 b(0.2372)41 b(\(0.2048-0.2759\))271 1055 y(4)348 b(0.0029)41 b(\(0.0004-0.0084\))271 1154 y(5)348 b(0.0128)41 b(\(0.0058-0.0219\))271 1254 y(6)348 b(0.4530)41 b(\(0.4121-0.4888\))271 1353 y(7)348 b(0.2512)41 b(\(0.2186-0.2829\))271 1453 y(8)348 b(0.0429)41 b(\(0.0291-0.0579\)) 140 1553 y(D1S1612)271 1652 y(2)348 b(0.0027)41 b(\(0.0003-0.0080\))271 1752 y(4)348 b(0.1368)41 b(\(0.1138-0.1669\))271 1852 y(5)348 b(0.3374)41 b(\(0.3030-0.3754\))271 1951 y(6)348 b(0.1248)41 b(\(0.1018-0.1485\))271 2051 y(7)348 b(0.2568)41 b(\(0.2235-0.2904\))271 2151 y(8)348 b(0.0156)41 b(\(0.0076-0.0261\)) 271 2250 y(9)348 b(0.1190)41 b(\(0.0974-0.1436\))271 2350 y(10)304 b(0.0027)41 b(\(0.0004-0.0068\))271 2449 y(11)304 b(0.0041)41 b(\(0.0009-0.0087\))140 2662 y Fl(Eac)n(h)36 b(mark)n(er)f(is)i(presen)n(ted)f(in)h(turn,)i(follo)n(w)n(ed)d(b)n(y)h (the)g(alleles,)i(frequency)d(estimate)h(and)g(con\014dence)140 2761 y(in)n(terv)-5 b(als)27 b(if)h(requested.)140 3043 y Fh(8.5)112 b(Obtaining)39 b(column)f(a)m(v)m(erages)h(-)f Fa(qavg)140 3246 y Fl(This)j(is)g(a)g(small)f(utilit)n(y)i(program)d (whic)n(h)i(will)g(quic)n(kly)f(calculate)h(a)n(v)n(erages)c(and)k(pro) n(vide)f(summary)138 3346 y(statistics)26 b(ab)r(out)f(column)h(data.) 36 b(If)26 b(in)n(v)n(ok)n(ed)e(with)i(a)g(\014le)f(name)h(it)g(will)g (read)f(the)h(\014le)g(and)f(prin)n(t)h(summary)138 3445 y(information)e(ab)r(out)h(eac)n(h)g(column)g(in)g(the)h(\014le,)g (otherwise)e(it)h(will)h(read)e(from)h(standard)f(input.)37 b(The)25 b(basic)140 3545 y(information)j(it)g(pro)n(vides)f(is)h(the)h (mean,)f(standard)g(deviation,)f(no.)39 b(records)27 b(and)h(range)f(of)h(eac)n(h)f(column.)140 3644 y(An)h(example)f (output)h(follo)n(ws:)140 3857 y Fk(Col)42 b(1)i(-)f(Mean)f(=)h(51000)e (SD)i(=)g(28869.7)e(n)i(=)g(20001)f(Range)f(1000)h(->)h(101000)140 3956 y(Col)f(2)i(-)f(Mean)f(=)h(1.05272)d(SD)j(=)g(0.250372)e(n)i(=)g (20001)f(Range)f(0.202457)f(->)j(1.96742)140 4056 y(Col)f(3)i(-)f(Mean) f(=)h(3.27452)d(SD)j(=)g(0.369947)e(n)i(=)g(20001)f(Range)f(2.11931)g (->)i(4.73246)140 4156 y(Col)f(4)i(-)f(Mean)f(=)h(2.59041)d(SD)j(=)g (0.448593)e(n)i(=)g(20001)f(Range)f(0.48428)g(->)i(4.04446)140 4255 y(Col)f(5)i(-)f(Mean)f(=)h(65.2765)d(SD)j(=)g(1.38383)e(n)i(=)g (20001)f(Range)f(56.5785)g(->)i(72.829)140 4355 y(Col)f(6)i(-)f(Mean)f (=)h(-0.412581)d(SD)i(=)i(0.183528)c(n)j(=)g(20001)f(Range)f(-1.13458)g (->)h(0.364772)140 4455 y(Col)g(7)i(-)f(Mean)f(=)h(-0.317538)d(SD)i(=)i (0.186775)c(n)j(=)g(20001)f(Range)f(-1.07009)g(->)h(0.483818)140 4554 y(Col)g(8)i(-)f(Mean)f(=)h(-1.04013)d(SD)j(=)g(0.178181)d(n)j(=)h (20001)d(Range)h(-1.68759)e(->)j(-0.240899)140 4767 y Fl(If)28 b(the)h(data)e(are)g(log)g(transformed)g(and)h(it)g(is)g (wished)g(that)g(the)h(a)n(v)n(eraging)c(is)i(p)r(erformed)h(on)g(the)g (original)140 4866 y(scale)e(\(for)h(example,)g(if)g(the)h(data)e(are)g (log)h(lik)n(eliho)r(o)r(ds\),)g(then)g(this)h(can)e(b)r(e)i(ac)n(hiev) n(ed)e(using)h(the)g(-l)g(option)140 4966 y Fj(i.e.)p Fl(,)i Fk(qavg)42 b(-l)p Fl(.)140 5115 y(In)54 b(addition,)60 b Fk(qavg)52 b Fl(can)h(giv)n(e)g(empirical)g(con\014dence)g(limits)h (using)f(the)h(-p)g(\015ag;)66 b(the)54 b(command)140 5215 y Fk(qavg)42 b(-p0.025)33 b Fl(will)j(giv)n(e)g(the)g(2.5\045)f (and)h(97.5\045)f(limits.)63 b(This)36 b(option)g(will)g(also)f(mak)n (e)g(the)h(program)137 5315 y(output)25 b(the)g(\014rst,)g(second)f (and)g(third)g(quartiles)g(\(Q1,)h(Q2,)f(Q3\),)g(and)h(an)f(empirical)g (`p-v)-5 b(alue'.)35 b(This)25 b(latter)140 5414 y(is)32 b(calculated)f(as)g(follo)n(ws.)48 b(If)32 b(the)g(mean)g(of)f(a)h (column)f(is)h Fc(>)d Fl(0,)k(then)f(the)g(p-v)-5 b(alue)31 b(is)h(the)g(prop)r(ortion)e(of)140 5514 y(data)e(items)h(whic)n(h)g (are)f Fc(<)p Fl(=)c(0,)29 b(and)f(visa)g(v)n(ersa)f(when)i(the)g(mean) g(is)f Fc(<)d Fl(0.)40 b(This)29 b(measure)e(is)i(in)n(tended)g(as)140 5613 y(a)j(quic)n(k)g(aid)g(to)h(assessing)e(the)i(signi\014cance)e(of) i(co)n(v)-5 b(ariate)30 b(estimates.)52 b(An)33 b(example)f(output)h (using)f(this)140 5713 y(option)27 b(follo)n(ws:)1831 5962 y(37)p eop end %%Page: 38 38 TeXDict begin 38 37 bop 140 231 a Fk(Col)42 b(1)i(-)f(Mean)f(=)h(51000) e(SD)i(=)g(28869.7)e(n)i(=)g(20001)f(Range)f(1000)h(->)h(101000)358 331 y(Q1)g(=)g(26000,)e(Q2)i(=)g(51000,)e(Q3)i(=)g(76000,)e(2.5\045)h (Lim)g(=)h(3500)f(->)h(98500,)e(p)i(=)h(0)140 431 y(Col)e(2)i(-)f(Mean) f(=)h(1.05272)d(SD)j(=)g(0.250372)e(n)i(=)g(20001)f(Range)f(0.202457)f (->)j(1.96742)358 530 y(Q1)g(=)g(0.882824,)d(Q2)i(=)i(1.06423,)c(Q3)j (=)g(1.22872,)d(2.5\045)i(Lim)g(=)i(0.53308)c(->)j(1.51554,)d(p)j(=)h (0)140 630 y(Col)e(3)i(-)f(Mean)f(=)h(3.27452)d(SD)j(=)g(0.369947)e(n)i (=)g(20001)f(Range)f(2.11931)g(->)i(4.73246)358 729 y(Q1)g(=)g(3.0134,) e(Q2)h(=)h(3.25833,)e(Q3)i(=)g(3.52037,)d(2.5\045)i(Lim)g(=)h(2.59481)e (->)i(4.03333,)d(p)j(=)g(0)140 829 y(Col)f(4)i(-)f(Mean)f(=)h(2.59041)d (SD)j(=)g(0.448593)e(n)i(=)g(20001)f(Range)f(0.48428)g(->)i(4.04446)358 929 y(Q1)g(=)g(2.34131,)d(Q2)j(=)g(2.62509,)d(Q3)j(=)g(2.88829,)e (2.5\045)g(Lim)i(=)g(1.60588)e(->)h(3.38831,)f(p)i(=)g(0)140 1028 y(Col)f(5)i(-)f(Mean)f(=)h(65.2765)d(SD)j(=)g(1.38383)e(n)i(=)g (20001)f(Range)f(56.5785)g(->)i(72.829)358 1128 y(Q1)g(=)g(65.0735,)d (Q2)j(=)g(65.3966,)d(Q3)j(=)g(65.6771,)e(2.5\045)g(Lim)i(=)g(61.2552)e (->)h(68.02,)g(p)h(=)g(0)140 1228 y(Col)f(6)i(-)f(Mean)f(=)h(-0.412581) d(SD)i(=)i(0.183528)c(n)j(=)g(20001)f(Range)f(-1.13458)g(->)h(0.364772) 358 1327 y(Q1)h(=)g(-0.537258,)c(Q2)k(=)g(-0.411998,)d(Q3)i(=)i (-0.29009,)39 b(2.5\045)j(Lim)h(=)g(-0.775722)d(->)j(-0.0502515,)c(p)k (=)g(0.0121494)140 1427 y(Col)f(7)i(-)f(Mean)f(=)h(-0.317538)d(SD)i(=)i (0.186775)c(n)j(=)g(20001)f(Range)f(-1.07009)g(->)h(0.483818)358 1526 y(Q1)h(=)g(-0.443942,)c(Q2)k(=)g(-0.318493,)d(Q3)i(=)i(-0.190569,) 39 b(2.5\045)j(Lim)g(=)i(-0.677856)39 b(->)k(0.0481646,)d(p)j(=)g (0.0456977)140 1626 y(Col)f(8)i(-)f(Mean)f(=)h(-1.04013)d(SD)j(=)g (0.178181)d(n)j(=)h(20001)d(Range)h(-1.68759)e(->)j(-0.240899)358 1726 y(Q1)g(=)g(-1.16117,)d(Q2)i(=)i(-1.03919,)c(Q3)i(=)h(-0.919638,)d (2.5\045)i(Lim)g(=)h(-1.38943)e(->)h(-0.691617,)e(p)j(=)g(0)139 1942 y Fl(The)27 b(use)f(of)h(this)g(option)f(requires)g(the)h(program) e(to)h(hold)h(all)f(of)h(the)g(data)f(in)h(memory)f(and)g(sort)g(it)h (whic)n(h)140 2041 y(adds)35 b(to)f(the)i(computational)e(requiremen)n (ts)f(of)i(the)h(script,)g(so)e(it)i(should)e(not)h(b)r(e)h(used)e(on)h (v)n(ery)f(large)140 2141 y(data\014les.)140 2465 y Fo(9)135 b(Ac)l(kno)l(wledgemen)l(ts)140 2697 y Fl(The)42 b(author)f(is)h (grateful)g(to)g(W)-7 b(arwic)n(k)41 b(Da)n(w)g(for)h(testing)g(v)n (ersions)e(and)i(for)f(helpful)i(discussion)f(and)140 2796 y(commen)n(ts.)82 b(This)43 b(w)n(ork)e(w)n(as)h(previously)f (supp)r(orted)i(b)n(y)f(NIH)h(Gran)n(t)g(GM46255)d(and)j(is)f(curren)n (tly)140 2896 y(supp)r(orted)27 b(b)n(y)h(NIH)g(gran)n(t)e(GM58757.)140 3220 y Fo(References)140 3436 y Fl(Heath)40 b(SC)h(\(1997\))d(Mark)n(o) n(v)g(c)n(hain)i(Mon)n(te)g(Carlo)e(segregation)g(and)i(link)-5 b(age)40 b(analysis)f(for)g(oligogenic)269 3535 y(mo)r(dels.)e(Am)28 b(J)f(Hum)i(Genet)f(61:748{760)140 3701 y(Vissc)n(her)e(PM,)h(Haley)g (CS,)h(Heath)f(SC,)g(Muir)h(WJ,)f(Blac)n(kw)n(o)r(o)r(d)e(DHR)j (\(1999\))e(Detecting)i(QTLs)f(for)f(uni-)269 3801 y(and)i(bip)r(ola)f (disorder)f(using)h(a)h(v)-5 b(ariance)26 b(comp)r(onen)n(t)h(metho)r (d.)38 b(Psyc)n(h)26 b(Genet)i(9:75{84)1831 5962 y(38)p eop end %%Trailer userdict /end-hook known{end-hook}if %%EOF loki/docs/loki_doc.tex0100644000076500007650000032711707652170175014255 0ustar heathheath\documentclass[10pt,a4paper]{article} \usepackage{setspace,epsfig,harvard,xspace} \usepackage{amsmath} \citationstyle{dcu} \citationmode{abbr} \pretolerance400 \tolerance800 \emergencystretch2em \doublehyphendemerits5000 \hfuzz0pt \leftskip0pt minus 1pt \rightskip0pt minus 1pt \parskip=6pt \newcommand{\IE}{\textit{i.e.},\xspace} \newcommand{\EG}{\textit{e.g.},\xspace} \newcommand{\GT}{\ensuremath{\mathcal{G}}\xspace} \newcommand{\Th}[1]{#1\textit{th}\xspace} \newcommand{\MCMC}{Markov chain Monte Carlo} \newcommand{\Prep}{\texttt{prep}\xspace} \newcommand{\Loki}{\texttt{loki}\xspace} \newcommand{\Lokiext}{\texttt{loki\_ext}\xspace} \addtolength{\oddsidemargin}{-.5in} \addtolength{\textwidth}{1in} \addtolength{\topmargin}{-.5in} \addtolength{\textheight}{1in} \renewcommand{\refname}{References} \renewcommand{\figurename}{Figure} \parindent=0pt \begin{document} \thispagestyle{empty} \begin{center} \begin{Large} \textbf{Loki 2.4.6}\\[.15in] A package for multipoint linkage analysis on large pedigrees using Reversible jump Markov chain Monte Carlo\\[.25in] \end{Large} \begin{large} April 2003\\[4.5in] \end{large} \end{center} Simon C Heath\\ Centre National de G\'enotypage\\ 2 rue Gaston Cr\'emieux\\ CP 5721, 91057 Evry Cedex France\\[.1in] email: \verb+heath@cng.fr+\\ \newpage \section{Overview} The programs described here are an implementation of the methods described in \citeasnoun{heath_97a} for Markov chain Monte Carlo (MCMC) segregation and linkage analysis of quantitative traits using oligogenic models. The programs are intended for performing multipoint linkage analyses on large, possibly complex, pedigrees. In contrast to `normal' linkage packages, the exact penetrance model and even the number of QTL affecting the trait do not have to be specified \textit{a priori}. Joint estimation of QTL number, position, and effects is possible, avoiding the problems that can arise from mis--specification of these parameters. It should be noted that although the aims are the same as with traditional linkage packages, the operation of the programs and (more importantly) interpretation of the output are very different. This program does \emph{not} produce LOD scores - if you only want LOD scores then you should look elsewhere. One reason for this is that the LOD score approach is less flexible than the one used here, particularly when models with multiple trait loci are considered. The other reason is that LOD scores are computationally costly (and tricky) to reliably estimate using MCMC. The approach used here is to estimate the posterior probability for any given chromosome region of at least 1 trait locus being in that region (and possibly over a given size threshold). It is also possible to perform affected only IBD sharing analyses. Although the same programs are used as for the parametric analyses, the way the output is interpreted is quite different. In addition, it is also possible for Loki to estimate pairwise realized kinship coefficients, that is the kinship coefficients for all pairs in the pedigree at particular genomic positions conditional on linked markers. In fact, the values estimated are twice the kinship coefficients, as this is normally what is required. These values are currently not used by Loki, though in the future it is planned to use this mechanism for implementing variance component approaches for linkage mapping. Loki has been used to produce kinship coefficient matrices for variance component analyses using external programs \cite{visscher_99}. There are two main programs, \Prep and \Loki, which respectively handle data input and the MCMC analysis. The data preparation program, \Prep, reads in data from a wide variety of input formats, tests for consistency of pedigree and marker data, recodes the data, and outputs standardized binary files for the analysis program, \Loki. Also included in the package are several small programs and scripts which help in the interpretation of the output from \Loki. Throughout this document, I will refer to the individual programs as \Prep and \Loki, and the package as a whole as Loki. Also included with the loki\_2.4 distribution is a small collection of short programs and perl scripts which I use to help analyze the output from Loki. These are included in the hope that they might be of use to other people. Feedback on the scripts (and on Loki as a whole) is welcome. If the scripts prove useful then they might be expanded to fit with people's requirements. \section{Installation} It is assumed that you have the latest Loki archive file, it has been untarred, and you are in the top (loki/) directory. The simplest way to compile the package is to type: \begin{verbatim} ./configure make make tests \end{verbatim} The configure script attempts to guess settings that should work with your system. If the compilation does not work you could edit by hand the file ./config.h or the Makefiles (./Makefile, libsrc/Makefile, lokisrc/Makefile). Otherwise, to specify a C compiler to use, and flags for the compiler set the environment variables CC and CFLAGS before calling configure. For example, to tell configure to use the gcc compiler with optimization use \begin{verbatim} CC=gcc CFLAGS='-O3 -g' ./configure \end{verbatim} If the gcc compiler is used then, by default, optimization is turned on. If another compiler is used then CFLAGS should be set with the appropriate flags to turn on optimization with your compiler (normally -O). It is highly recommended that some form of optimization is used as the calculations performed by Loki are very computationally intensive. After successful compilation, \verb+make install+ can be run to move the programs to a bin directory. By default, programs are installed to the bin subdirectory of the the loki/. This behaviour can be altered by giving the --prefix option to configure. For example, to install the programs in /usr/local/bin, invoke configure as: \verb+./configure --prefix=/usr/local+ If \verb+make tests+\ fails then this may or may not be serious because differences can be caused due to differences in floating point implementations between machines. As far as possible this has been avoided, but some problems still remain. In particular, certain machine architectures (such as Intel or Alpha) compute floating point with too much accuracy, i.e., more accurate than specified by the IEEE standards. To avoid this, by default, when loki is compiled with gcc, the compiler flag -ffloat-store is used which instructs the compiler to not use the extra precision. If you use a non-gcc compiler, then it may be possible to find an equivalent switch for your compiler. Of course, if you are not interested in comparing runs on different machines then this will not apply. Note that if you regularly use machines with different architectures, and intend to start analyses with one machine and continue with a different machine, it is imperative that the two machines give the same answers as the test set (more about this later). If the test fails, try running the tests by hand (cd into the test directory and read the README file there) to see if the tests ran but gave different output (possibly due to floating point differences between machines), or if they failed to run at all. In either case, please send me any error outputs you receive. I would like to hear about any problems that you have compiling and running the programs on UNIX machines. The only extensive testing has been on Solaris 5.8 and FreeBSD 4.1, but the programs have been compiled and run on a range on different UNIX boxes including OSF1 V4.0, Irix 6.5, OpenBSD 2.7-3.2 and Linux 2.0.30/2.2.6/2.3.6 (see the file \verb+README.known_systems+ for an up to date list). My ability to help with machine types I do not have access to is obviously limited. If people have tried to get Loki compiled and running on other machines, I would be very interested to hear about any problems and, of course, successes! There are two stages to running an analysis: first \Prep is run on the original datafiles. The appropriate information is read from the datafiles and encoded in a form suitable for the analysis program, \Loki. A control file is required for \Prep, and a parameter file for \Loki. Information on how to write these files is given in the following sections. If control and parameter files for an analysis have been set up then running the analysis can be accomplished by typing: \begin{verbatim} prep control_file loki param_file \end{verbatim} Output from the run is written to the file \verb+loki.out+; interpretation of this output is discussed in the section `Analysis of output'. \section{Data preparation: \Prep} Data preparation is performed by \Prep, which takes as input a control file specifying the data files required and their format (Section \ref{prep_control}. \Prep reads in the appropriate data files, sorts and recodes the data where required, and then outputs the data as a series of files in a format suitable for \Loki. Note that if different machine types are in use, the data files output by \Prep can be freely exchanged between machines. It is, for example, possible to run \Prep on a Sun Sparc workstation, and then run \Loki on an Intel based Linux workstation. There are some restrictions on this: (1) use of a machine with non--standard floating--point routines (either too inaccurate or too accurate); (2) use of machines with different sized `longs'. This last situation, which could arise with a mix of Intel and Alpha based machines, will only cause a problem if the dataset, for reasons of size and complexity, can only be run on the machine with larger longs of the machines. For example, a complex pedigree may run on an Alpha machine but not on an Intel machine due to the smaller size of longs on the Intel machine. Note that in general time and memory requirements prevent this becoming an issue. Genotype data are checked by \Prep for consistency - a logical peeling operation is performed on each locus to determine if the likelihood of the data for that locus is zero. By default, the program stops if an error is detected; if there is no error message produced then the likelihood of the data given the pedigree structure is positive, and is therefore consistent. Note that this is true whether or not the pedigree contains loops. If an error occurs then information about the family where the error was found is normally displayed. It is possible, although rare, for a genotype inconsistency to be detected only at a late stage in the process. In this case it unfortunately may not be possible for the program to pinpoint where the error occurs. This situation can, however, only arise in complex (looped) pedigrees. It is also possible to tell \Prep to try and identify and delete genotypes which appear to be wrong, rather than stopping at the first inconsistency. For more details on this, see the \verb+correct_errors+ flag. When the problem can be localized to a family, \Prep prints out the members of the family with their observed genotypes and inferences made by \Prep about unobserved genotypes in previous stages of the process. This normally makes it straightforward to spot what genotypes(s) are causing the problem. An example error message might look like this (note that `*' is shorthand for any allele): \begin{verbatim} DoFamily(): Inconsistent family data for locus D1GS32 Father: 220 [*,*] (*,*) Mother: 218 [*,*] (7,*) (*,7) -> 114 [7,7] (7,7) -> 330 [7,7] (7,7) -> 378 [7,8] (8,7) (7,8) -> 1854 [1,10] (10,1) (1,10) -> 1988 [7,10] (10,7) (7,10) \end{verbatim} The parents have no genotype information, but from an earlier operation it is known 1 of the mother's alleles has to be a `7'. The five offspring then follow, with their observed genotypes (in square brackets), and their inferred ordered genotypes (in round brackets). Very complex pedigrees (with many interlocking loops) may cause the program to take so long that it appears to have `hung', or to terminate with an error message. Although the peeling calculations could in theory be bypassed at this stage, they are required for the operation of \Loki, so a pedigree too large to be processed by \Prep is too large to be analyzed with \Loki, and must be split up. Datafiles in a wide variety of formats can be read in, the main requirement being that files should contain nothing apart from data \IE datafiles should not also contain commands. The datafile should contain a number of \emph{records} with the format of a record, and the splitting of the file into records, being determined by the control file (described below). Multiple input files can be used (\IE separate pedigree, phenotype data, and genotype data files), with the one restriction being that each record must contain an ID, allowing records to be linked across files. Recoding of the datafiles is \emph{not} necessary, \Prep can handle alpha-numeric codes of (almost) any length for pedigree IDs, allele codes, and discrete environmental factors. This has 2 main benefits - it simplifies the use of \Prep, and allows errors to be reported using the original codes, which makes tracking down of, for example, genotype errors, much simpler. The number of input records, pedigree size etc. are determined by \Prep and do not need to be specified. Limits for the pedigree size, no. of markers etc.\ are determined by available memory, the one exception to this being the maximum number of alleles per marker segregating within a component, which is limited by the number of bits in a long int (typically 32). In many modern systems this can often be extended to 64, but with a possible performance (and portability) penalty. \Prep can handle pedigrees containing loops, as long as the pedigree is not too complex (what constitutes too complex depends on the size of computer and the amount of patience you have). The user does not have to do anything to tell \Prep about loops, it will attempt to deal with them itself. The sampling algorithms used in \Prep required that a single locus peeling (likelihood) calculation is carried out at each locus (marker + trait). Multiple loci are not peeled simultaneously, so \Prep is not affected by the number of loci in the way that traditional linkage packages are. Sometimes a pedigree is too large to be processed by \Prep, not because of time or memory constraints, but because the indexing system used by \Prep to keep track of possible genotypes has to fit into a long int. A pedigree with a small loops can cause prep to fail if a marker with many segregating alleles is analyzed. It is possible to avoid this, in the same way as for the restriction on maximum number of segregating alleles per component, by increasing the size of index. Several compilers (including gcc) support long long int variables, which are commonly 64 bit. Compiling Loki with the flag \verb+-DUSE_LONGLONG+\ will do this. Note that this can cause portability problems with the output files from \Loki and \Prep. It can also have a speed penalty, so only use if strictly necessary. \section{Markov chain Monte Carlo analysis: \Loki} The actual analysis is performed by \Loki, using the output files from \Prep. An MCMC analysis consists of a (normally large) number of \emph{sampling iterations}; each iteration involves updating (or trying to update) every parameter in the model. In the context of the analyses performed by \Loki, parameters are the ordered genotypes (of markers and trait loci), allele frequencies, trait loci positions and effects, number of trait loci, covariate effects, and variance parameters. Inference about any or all of these parameters is possible, but Loki is intended for use as a linkage analysis package so attention is focused on inferring the position and size of trait loci. The output files from \Prep, which are used by \Loki, are a series of (mostly) text files called \verb+loki.opt+, \verb+loki.dat+, \verb+loki.gen+ and \verb+loki.nrm+, the last only if a polygenic effect is being fitted. These files contain information on basic program options (\verb+loki.opt+); phenotype data, model information, and factor recoding data (\verb+loki.dat+); genotype data, allele recoding information, peeling sequences (\verb+loki.gen+); non-zero elements of the inverse of the Numerator Relationship Matrix (NRM). Note that if the FILTER command is used in the control file for \Prep, \verb+loki.dat+, \verb+loki.gen+ and \verb+loki.nrm+ will have been passed through the filter (normally for compression purposes). There is additional information that \Loki needs to perform its analysis such as the map positions of markers, how long to run the analysis for etc., and that information is provided by a parameter file. In fact \emph{only} the marker positions needs to be provided in the parameter file, but if further information about, for example, allele frequencies is available, then this can be given as well. The format of the parameter file for \Loki is given in Section \ref{loki_param}, and analysis of the output files generated by \Loki is discussed in Section \ref{loki_files} \section{Control file for \Prep} \label{prep_control} The order of commands in the control file and the case of the commands are not normally important. New lines are mostly ignored, so long commands can be split over several lines. It should be noted that the entire control file is read in and processed \emph{before} any of the datafiles are read. Commands affecting how files are read in can therefore have an effect no matter where they occur in the control file. Comments can be included anywhere in a control file. If a `\#' occurs (outside of quotes) then the rest of the line is ignored. In addition, C style comments can be used for multiline commenting, for example: \begin{verbatim} /* * Control file for Dataset Ch1z - November 1997 * */ File "phenotypes",id,sx,age,y # read in phenotype data \end{verbatim} \subsection{FILE command} From each input file, \Prep reads in all the records it can find, each record consisting of a (possibly variable) number of fields. To be able to do this, the control file must have information on (a) where to find the files, (b) how to split the files into records, and (c) how to split the records into fields. This information is supplied by the FILE command (although it can be modified by other commands). The format of the FILE command is FILE [optional format clause] "filename",var$_1$,var$_2$,\ldots ,var$_n$. If we ignore the format clause for the moment, the number of variables following the filename determine how many fields \Prep expects to find in a record. \begin{figure}[hb] \caption{\label{fig:1}Test dataset} \begin{verbatim} 1 0 0 2 0 0 3 1 2 4 1 2 \end{verbatim} \end{figure} If our datafile was a triplet file with pedigree information (\IE individual, father, mother) as in Example \ref{fig:1}. then a FILE statement for this file would be: \begin{verbatim} FILE "filename",id,father,mother \end{verbatim} \IE each record has 3 data items (id, father, mother). If the file contains unwanted fields then these can be skipped by either specifying dummy variable names in the FILE statement, or simply by missing out 1 or more variable names corresponding to the unwanted positions. For example, the statement: \begin{verbatim} FILE "filename",id,father,,mother \end{verbatim} would read fields 1,2, and 4 into id, father, and mother respectively, with field 3 being skipped. By default, \Prep assumes that there is 1 record per line. If there are extra fields on a line then they are ignored, if there are too few fields then the variables which could not be read in are marked as missing for that record. This behaviour may be changed by setting the RS (record separator) variable as in the following 3 examples: \begin{verbatim} RS = "\n" RS = ":" FILE [RS = ""] "filename",id,father,mother \end{verbatim} The first example sets RS to be equal to the newline character; this is actually the default setting for RS. The second example is for the case where the input file has records separated by colons. The last example has RS within the format clause for a FILE statement; this sets RS for that FILE statement to be equal to the null string, which causes \Prep to ignore newlines when reading in the data. Note that the first 2 examples change the default value of RS for all files, whereas the last example only affects the particular FILE statement the RS command occurs in. There is an analogous variable, FS, for controlling how \Prep splits records into fields. By default \Prep interprets whitespace (space, tab, and newline characters) as field separators. As with RS, setting FS to a single character allows the use of that character as a field separator (a single space has a special meaning - it gives the default behaviour of using whitespace as a separator). If FS is set to a longer string then this is interpreted as a regular expression. Note that support for regular expressions is not currently available on all platforms. Note that for tab separated fields use \verb+FS="\t"+. Another field separator variable, GS, is used for controlling how genotypes are interpreted. Normally, individuals alleles are located in separate fields, and so this variable is not used. This is not always the case, however, and sometimes the two alleles occur in the same field separated by a space or a slash, \IE 183/185. In this case, GS should be set in a similar way to RS and FS to `/'. To read in the comma separated data file in Figure \ref{fig:2a} where alleles are separated by a slash, the following file command would be used: \verb+FILE [FS=",",GS="/"] id,mark1,mark2+ \begin{figure} \caption{\label{fig:2a}Test dataset} \begin{verbatim} 1,181/183,223/223 2,181/183,200/210 3,,205/210 4,185/187, \end{verbatim} \end{figure} \subsubsection{Fixed format} Occasionally data files come in a form where the starting and ending columns of each field are known, but there might not be any separator between fields. For this type of data the format of the datafile must be specified more precisely. For example, consider the datafile in Figure \ref{fig:2}. \begin{figure} \caption{\label{fig:2}Test dataset} \begin{verbatim} 1 0 0 1 80 2 0 0 2 77 3 0 0 1 64 4 0 0 2 63 6 0 0 1 67 8 0 0 1 56 461 1 2 1 80 462 1 2 2 80 463 3 4 1 72 464 3 4 2 63 678 8 462 2 64 26.23 75.79143.66 42.77267.60 679 6 464 1 53 680 6 464 2 64 40.67 97.68157.29 45.94304.39 681 6 464 1 58 31.98 77.29115.52 42.60197.15 \end{verbatim} \end{figure} This datafile has 10 fields, individual, father, mother, sx, age, and 5 quantitative measurements. The last 5 fields have no intervening spaces, so they have to be read in fixed format. This could be done with the statement: \begin{verbatim} FILE [3(5),1x,1,3,5(6)] "filename", id,father,mother,sx,age,q1,q2,q3,q4,q5 \end{verbatim} Note that long commands can be split - newlines are (mostly) ignored by \Prep. The format clause tells \Prep to read in 3 fields of 5 characters each, skip 1 character, read in 1 field of 1 character, 1 of 3 characters, and 5 of 6 characters each. An empty field is treated as missing data. \subsubsection{Skipping lines} Normally, \Prep will read in every non-blank line in the data file. Sometimes, however, it is desirable that some lines are skipped at the top of the data file (for example, if a header is present). This can be easily done using the FILE command: \begin{verbatim} FILE [skip=1] "filename",id,father,mother,sx,q1,q2 \end{verbatim} \subsubsection{Further processing} To facilitate further processing of the datafile before it is read into \Prep, it is possible to pipe the datafile through external programs (such as sed, awk, or perl). The following example uses zcat to uncompress the datafile `on the fly': \begin{verbatim} FILE SHELL("zcat filename.gz"),x1,x2,x3,x4 \end{verbatim} \subsubsection{Reading in genotype data} \label{genotype_data}. Only codominant markers are supported by \Prep. Genotype data for an individual normally consists of a field for each allele (\IE 2 per marker), however \Prep can also read in data formats where both alleles are in a single field. In a given record, 1 or both alleles may be missing. Allele codes, as with all identifiers in Loki, are alpha-numeric and can be any length. Data for different markers (and even for the 2 alleles at a single marker) may be in separate datafiles. Genotype data for an individual can be duplicated; such duplicated records are checked for consistency. \subsection{PEDIGREE command} The PEDIGREE command is used to specify which variables contain the pedigree information. There are two forms for the command, depending on whether id codes are unique or if different families may use the same id codes (\IE the format used by the LINKAGE package). Example PEDIGREE commands are given below: \begin{verbatim} PEDIGREE id,father,mother PEDIGREE family,id,father,mother \end{verbatim} There \emph{must} be exactly 1 PEDIGREE command in a control file, and a PEDIGREE command \emph{must} have 3 or 4 variables as arguments. A data record may have missing father and mother values, but must have a valid id record (and a family record if used). An individual's pedigree record may occur multiple times; as with genotype data, if this happens the duplicated records are checked for consistency. When a family record is present, whenever the original ids are output from \Prep or \Loki, the family name is also given. How this is done differs depending on the context. For example, consider the following pedigree file. \begin{verbatim} 1 1 0 0 1 2 0 0 1 3 1 2 1 4 1 2 2 1 0 0 2 2 0 0 2 3 0 0 2 4 2 3 2 5 2 1 \end{verbatim} If there is an occasion to output an isolated id (\IE there is a data record error for individual 3 in family 2), it will be output as \verb+[2]:3+ with the family name in square brackets before the id code. If, however, triplet information is output then this will be be as 4 columns - family, id, father, mother. \subsection{SEX command}\label{sex1} The SEX command is used to specify a variable that indicates the sex of individuals. The command is optional, but if included allows for more extensive pedigree checking. If this command is used then information on sex must be available for all pedigree members (note that the sex of parents can be inferred from the pedigree). Examples of this command appear below: \begin{verbatim} SEX sx 1,2 SEX sx ``M'',''F'' \end{verbatim} The last two entries on the line give the factor values for males and females respectively. Only 1 SEX command can appear in a control file. \subsection{GROUP command}\label{group1} The GROUP command is used to specify a variable that indicates which genetic group each founder belongs to, see also Section \ref{group2}. Different genetic groups can have different allele frequencies. This is therefore intended for situations where it is known that certain founders come from different populations. If this option is specified then every founder must have a record for the group factor. If non-founders are given a group designation then this is ignored. Only 1 GROUP command can appear in a control file. The format of the command is simply: \begin{verbatim} GROUP gen_group \end{verbatim} \subsection{MISSING command} In the example datafiles above, `0' has been used (as is common) to mean a missing ID (\IE founder individuals have no parents in the datafile, so their parents IDs are given as 0. This may not always be true, or different missing codes may be used for different variables. Previous versions of \Prep used no default missing code, and only treated blank fields as missing. Versions after 2.4.5 have a default where `0' is the missing code for all categorical variables (pedigree, genotype and other discrete variables). This will be overridden if any Missing command is found. To revert to the previous behaviour with no default Missing codes, see \ref{set_command}. Examples of valid Missing commands are shown below: \begin{verbatim} MISSING "0" MISSING "*",x,y MISSING ["PG"] "0" MISSING ["R"] -99 \end{verbatim} The first example tells \Prep that `0' should be treated as a missing value for all variables. The second example states that, in addition, `*' should be treated as a missing value for variables x and y. If the missing value is not in quotes then a numeric comparison will be made between the missing value and the input data, otherwise a string comparison will be made. An exception to this is that a numeric comparison will always be used for variables which have been explicitly declared to be numeric (using the INTEGER or REAL commands). Note that when comparing two real valued variables, a match is declared if the absolute difference is <1.0e-12, to avoid rounding problems. The third and fourth examples state that `0' should be used as a missing values for pedigree and genotype variables, and `-99' should be used for real valued variables. For this later forms of the missing commands, the possible letter codes are: \begin{itemize} \item P - Pedigree variables \item G - Genotype variables \item F - Factors (discrete variables - includes P and G) \item R - Real variables \item C - Continous variables (same as R) \item I - Integer variables \end{itemize} Each letter code can be preceded by a `!' character to indicate a negation (\IE "!P" would mean everything \emph{apart from} pedigree variables). The default Missing rule (which will not be used if any explicit Missing rule is found) is: \begin{verbatim} MISSING ["F"] "0" \end{verbatim} Note that multiple Missing commands can be given, in which case the results are cumulative. \subsection{MARKER LOCUS command} If the two alleles for a marker occur in separate fields (as is the defaults) then each marker locus needs to be linked with the 2 variables containing the allele information for that locus. This is done using the MARKER LOCUS command, as in the examples below: \begin{verbatim} MARKER LOCUS D1G1[all_1a,all_1b] MARKER LOCUS D1G2[all_2a,all_2b], D1G3[all_3a,all_3b] \end{verbatim} A given marker can not occur multiple times in MARKER LOCUS statements; in addition, a given allele variable can only be used once. If both alleles occur in a single data field then this linking to the allele variables is not required, but it is still necessary to use the Marker Locus command to identify the variables as being markers: \begin{verbatim} MARKER LOCUS D1G1 MARKER LOCUS D1G2,D1G3 \end{verbatim} \subsection{LINK command} This command describes the grouping of markers into linkage groups. A marker \emph{must} occur in a LINK statement to be included in the analysis. Conversely, selectively commenting out LINK statements is an effective way of selecting which markers to run in an analysis. Each linkage group must be given a unique name which allows it to be identified. A marker can not occur in multiple linkage groups. An example LINK command is given below: \begin{verbatim} LINK "chromosome 1",D1G1,D1G2,D1G3,D1G4,D1G5 \end{verbatim} \subsection{TRAIT LOCUS command} This command is used to assign a name to the trait locus so that it can be specified in the MODEL command. Note that you only should specify 1 trait locus; the number of trait loci (or the range of numbers of trait loci) is specified in the control file for \Loki. The command for declaring a trait locus called QTL would be: \begin{verbatim} TRAIT LOCUS QTL \end{verbatim} \subsection{MODEL command} This is where the trait model is specified (note a linear regression model is assumed, and traits have to be continuous). Examples of MODEL commands follow: \begin{verbatim} MODEL y=QTL MODEL y=age+sx+QTL MODEL q=sx+QTL \end{verbatim} In these examples, QTL refers to a trait locus and is declared as such elsewhere in a TRAIT LOCUS statement. It is not necessary to include a trait locus in the model. \subsubsection{Fitting genetic covariates/candidate loci} It is possible to fit individual marker loci as genetic covariates. In this case, an effect of each genotype at the marker locus is estimated. For this reason this option is not recommended with loci that have more than 3-4 alleles. Missing genotype data is sampled as for other loci, conditional on the pedigree structure, neighbouring loci, and the trait data. \subsubsection{Fitting a polygenic random effect} \label{lab_model_poly} A individual animal polygenic effect can by fitted by including the individual id variable in the model. For example: \begin{verbatim} PEDIGREE id,father,mother MODEL y=id+age MODEL y=id+age+QTL \end{verbatim} Note that mixed inheritance models with both polygenic and QTL can be fitted (2nd example above). In many cases there is not a lot of information distinguishing a major gene from a polygenic effect, and there can be strong negative correlation between the polygenic additive genetic variance and the variance due to a QTL. Using the other pedigree variables in the model statement instead of the id has undefined effects. \subsection{LOG command} A report from \Prep is written out to the logfile, if specified in a LOG command, or to standard output otherwise. The format for this command is simply LOG "filename". A new log file is started with each run of \Prep, so if the old logfile exists it is renamed to the original filename\verb/+~/. \subsection{DISCRETE command} This command specifies that certain variables are to be treated as discrete levels rather than continuous data. Note that pedigree variables (those declared in a PEDIGREE command) and marker allele variables are automatically declared as discrete, as is any alpha-numeric data. The format for the command is DISCRETE var$_1$,var$_2$,\ldots ,var$_n$. \subsection{REAL and INTEGER commands} Numeric data is assumed to be real unless it is declared integer with an INTEGER command. These commands allow \Prep to check the type of the data, and give errors if the wrong type of data is found. The format is the same as for the DISCRETE command. \subsection{MULTIPLE and CONSTANT commands} Pedigree variables and genotype data are automatically declared to be constant, \IE they can not change for a given individual. By default, all other variables are also declared constant, but this can be over-ridden for sets of variables using the MULTIPLE command. To set the default for all non-pedigree and genotype data to be MULTIPLE, set the system variable multiple\_records to 1 (with the command SET multiple\_records 1 \ref{set_command}). In this case, the default can be over-ridden using the CONSTANT command. The format for both command are as for the DISCRETE command. If multiple records are present for an individual, then constant variables are checked for consistency across records. More importantly, if there are multiple observations on an individual, a covariate declared constant will apply to all observations on that individual, without having to appear in every record. This allows a logical record on an individual to be created from multiple physical records in different files. For variables declared as multiple, however, variables have to occur in the same input line in the same datafile to be regarded as occurring in the same logical record. This means that if there are 2 datafiles, each with a different sub-set of variables, if the variables are declared as MULTIPLE then \emph{every record will appear to be incomplete, and may be discarded by Loki}. The MULTIPLE command should therefore be used with care. (n.b., the default behaviour of Loki prior to version 2.4.2\_3 was that all non-pedigree and non-genotype data was declared MULTIPLE. This led to some confusion so the default was changed). \subsection{FILTER command} A number of files are created by \Prep for \Loki to read in. Some of these files can be large, particularly when many marker loci are being analyzed. It is possible to instruct \Prep to filter the files through an external command before saving them. The main (only?) use of this would be to filter the files through a compression program such as \verb+gzip+\ or \verb+compress+. An example of this is given below: \begin{verbatim} FILTER "gzip" \end{verbatim} Use of this command with programs other than \verb+gzip+, \verb+compress+\ or \verb+bzip2+\ is not supported. \subsection{USE WHERE command} This command allows for the selection of a subset of data where a particular condition holds. Two examples are given below: \begin{verbatim} USE all_1a,all_1b WHERE(y); USE all_1a,all_1b WHERE(y<40 and sex="M" and ((x-y)>20 or (z-y)<0)); \end{verbatim} The first example restricts all\_1a and all\_1b to where y is not missing. The second example shows that more complex expressions are possible. Note that a subexpression containing a missing variable evaluates to false. Multiple USE WHERE commands can occur, with each new command acting on the subset of data left after the previous command. \subsection{CENSORED command} Loki currently has limited support for analysis of censored data (such as age of onset data). The format is similar to the USE WHERE command, with the WHERE expression determining when a variable has been censored. For example: \begin{verbatim} CENSORED age WHERE (affected="1") \end{verbatim} would mark age as a censored variable when the affected code was equal to "1". Note that if affected has been declared as a numeric type (INTEGER or REAL), then the quotes around the 1 should be omitted. \subsection{AFFECTED command}\label{aff1} Loki also has limited support for affected only analysis using an IBD sharing approach. This required identification of affected individuals, which is done in a similar way to the CENSORED command, for example: \begin{verbatim} AFFECTED WHERE (affected="1") \end{verbatim} Note that currently this only has an affect with IBD sharing analyses, not the parametric analyses. \subsection{RANDOM command} Loki\_2.4 has support for fitting uncorrelated random effects to the model. The effect should be a discrete factor, and is declared using the RANDOM command: \begin{verbatim} RANDOM litter MODEL y=litter+age \end{verbatim} It is not necessary to apply the DISCRETE command to tell Loki the effect is discrete - this is done automatically. This command should \emph{not} be used for polygenic random effects. These are fitted simply by adding the id variable to the model statement (Section \ref{lab_model_poly}). \subsection{OUTPUT command} \Prep has the option of outputting the final pedigree it is working with after pruning and recoding. This can occasionally be useful, though the output file is not directly used by \Loki. This is done by, for example: \begin{verbatim} OUTPUT "output.dat" \end{verbatim} The format of the output file is currently: col 1: Component number col 2,3,4: original id codes for individual, father, mother col 5: sex col 7,8,9: internal id codes for individual, father, mother col 10: affected status (if AFFECTED command used). Note that this is subject to change in later versions. \subsection{SET command} \label{set_command} There are a number of options for \Prep which can be set in the control file which modify the way in which it operates. In many cases, the default values are sensible and can can be left as they are. Each option is set as in the following examples: \begin{verbatim} SET peel_trace 1 SET prune_option 0 \end{verbatim} Note that most of these options are for debugging purposes only, the notable exception being correct\_errors. The various possible options are: \begin{itemize} \item correct\_errors\\ On encountering a genotype error, \Prep will normally print a message and stop. However, by setting this option to 1, \Prep will attempt to identify and remove the offending genotypes. The way this is done is effective, but without any statistical justification. It is very useful with large datasets, but the results should be treated with caution. The procedure does, however, give information on which genotypes were deleted for each marker, which provides valuable information on bad markers or possible pedigree errors. The procedure operates by first identifying families where inconsistencies occur, and deleting genotypes for all family members. After all inconsistent families have been deleted, they are then re--examined in the reverse order to which they were deleted, and genotypes of family members are returned to the analysis where they do not cause an inconsistency. This is a reasonably quick way of identifying a small (but not necessarily the smallest) subset of genotypes which, if removed, would result in no inconsistencies. After processing a marker, \Prep will write out a file named [marker\_name].err, which will have a line for each delete genotype showing the individual id, and the father and mother of the nuclear family in which the problem arose. If \Prep is re--run with the same marker, it will read in this file if it exists, and try this first. This file there provides a way both of seeing which genotypes are causing problems, and to impose a list of genotypes to be deleted on \Prep if this is desired. Note that the original data files are not changed. \item prune\_option\\ By default, pedigrees are pruned before analysis to remove pedigree sections that contribute no information. This option determine how much pedigree pruning is performed. Allowable values are: \begin{itemize} \item 0 - no pruning at all. \item 1 - prune pedigree based on data on all markers and trait information (\IE an individual is considered observed if they have data on any marker or any phenotype data. \item 2 (default) - prune pedigree individually for each trait marker and trait locus. \end{itemize} \item recode\_option\\ Alleles are normally recoded both within pedigree components and within families (`fuzzy recoding'). This can be controlled using this option. Note that this should only be done for testing purposes - the default recoding level which uses fuzzy recoding is generally much faster than the other levels. Allowable values are: \begin{itemize} \item 0 - no recoding of alleles. \item 1 - recode alleles within pedigree components. \item 2 (default) - recode alleles within families (fuzzy recoding). \end{itemize} \item no\_extra\_allele\\ Normally, \Prep allows for the presence of a non--observed allele when setting up the peeling calculations. This is generally correct, however if it is known that all possible alleles have been observed, memory and computational requirements can \emph{sometimes} be reduced using this option. \begin{itemize} \item 0 (default) - allow extra allele. \item 1 - no extra allele allowed. \end{itemize} \item peel\_option Loki distinguished between three classes of peeling operations: (1) nuclear family based, peeling onto a single individual; (2) nuclear family based, peeling onto two individuals; (3) non-nuclear family based (peeling some sub--set of individuals onto another sub--set of individuals). The last class could be used for all peeling operations. However, operations in the other classes, when possible, are much faster. For this reason, by default all possible class 1 operations are performed, then all class 2, and then class 3. For debugging purposes it is possible to turn off the family based peeling using this option. Values for the option are determined by setting the appropriate bits, if you don't understand this then you shouldn't be trying to debug anything{\ldots} \begin{itemize} \item bit 0 - Turn off class 1 and class 2 peeling for marker loci \item bit 1 - Turn off class 1 and class 2 peeling for trait loci \item bit 2 - Turn off class 2 peeling only for all loci \end{itemize} \item trace\_restrict, trace\_censored, trace\_affected, trace\_peel These option turn on different levels of debugging information about the restrict (WHERE,USE), CENSORED and AFFECTED commands, and the peeling operations. Different levels of information are turned on by setting different bits - the higher numbered bits give more information. The levels are not precisely defined as these options are mainly for my benefit, and may change without warning. \item no\_default\_missing Turn off the default missing code (\IE revert to the behaviour of \Prep prior to version 2.4.5). \begin{itemize} \item 0 (default) - use default missing code. \item 1 - no default missing code. \end{itemize} \end{itemize} \subsection{Temporary variables} As well as variables which are read in from datafiles, \Prep also allows the use of temporary variables which exist only while the control file is being scanned. Unlike standard variables, the values of temporary variables are set as \Prep processes the control file, so the order of statements using such variables is important. One use for temporary variables is given below: \begin{verbatim} Directory="../../data/" FILE Directory+"phenotypes",x,y,z FILE Directory+"genotypes",x,a1,a2,a3,a4,a5,a6 \end{verbatim} Note how strings can be concatenated using the `+' operator. Temporary variables can also hold numeric values and can be assigned values using complex expressions, for example: \begin{verbatim} n_markers=45 s=4*(n_markers-5)+n_markers/2.3 \end{verbatim} \subsection{Arrays} Multipoint analysis can involve hundreds of markers, and specifying each of these individually in the control file can become tedious. To reduce this a little, arrays can be used. Arrays must be declared before they are used using the ARRAY command: \begin{verbatim} ARRAY id(3),q(4),allele_a(30),allele_b(30) \end{verbatim} The $i$th array elements is referenced as id($i$). If the array name alone is given then this is treated as a list of variables of length the size of the array. This means that, given the ARRAY statement above, the 2 examples below are equivalent. \begin{verbatim} FILE "filename",id(1),id(2),id(3),q(1),q(2),q(3),q(4) FILE "filename",id,q \end{verbatim} Reference to a range of array elements is also allowed (spot the FORTRAN influence): \begin{verbatim} FILE "filename",id,(q(i),i=1,3) FILE "filename",id(1),(allele_a(i),allele_b(i),i=1,30) \end{verbatim} The first example reads the first 3 fields into id and the next 3 into the first 3 elements of q. The second example is a little more complicated, it reads in a single id variable into q(1), and then 30 pairs of allele\_a(i),allele\_b(i); this last form can be very useful for reading in genotype data. Multidimensional arrays are not supported at present. \subsection{DO WHILE commands} Very limited looping capability is provided; this is intended to help handle large arrays of genotype data. After reading in genotype data on large numbers of makers, it is necessary to link the allele variables to the appropriate markers using the MARKER LOCUS command, as described earlier. This can be done as follows: \begin{verbatim} ARRAY id(3),allele_a(30),allele_b(30),D1G(30) FILE "filename",id(1),(allele_a(i),allele_b(i),i=1,30) i=1 DO MARKER LOCUS D1G(i)[allele_a(i),allele_b(i)] i=i+1 WHILE(i<=30) \end{verbatim} This example reads in 30 pairs of allele data into allele\_a and allele\_b, and then assigns each pair to the corresponding marker in D1G. Note that the indentation for the commands is totally arbitrary. \subsection{Environment variables} It is possible to use environment variables within a control file. The following example shows how this could be used: \begin{verbatim} DataDir="$HOME"+"/data/gaw9/" \end{verbatim} %$ This is intended to simplify having multiple loki runs controlled by a shell script. If this does not make any sense to you, don't worry - you probably won't miss it. \subsection{IBD sharing analyses} To perform and IBD sharing analysis or to estimate kinship coefficient matrices, as discussed earlier, follow the instructions for \Prep as for a parametric analysis, except that it is not necessary to specify a model. For the IBD sharing analysis, it will be necessary to use the AFFECTED command to indicate which individuals are affected. In the parameter file for \Loki, it will also be necessary to use the ESTIMATE IBD command (Section \ref{estibd}), or the ANALYSIS command (Section \ref{analysis1}) to instruct \Loki which analysis to perform. \subsection{Full example} To finish this section, here is a somewhat complex control file I uses to read in the simulated datafiles produced for the GAW9 workshop. The datafiles are the originals, except that they have been compressed to save disk space. For this example, FILE statements for all of the haplotype data files are included, but the LINK statements are commented out for all chromosome apart from chromosome 1. This has the effect that only markers on chromosome 1 will be analyzed and, therefore, only the files which contain genotype data for chromosome 1 markers will be read in. \begin{verbatim} /****************************************************************** * * * Control file for the GAW9 dataset * * * ****************************************************************** * * * Define arrays for haplotypes, markers, traits and ids * * Each file has 15x2 columns of allele data * and there are 30 markers/chromosome * */ Array hap1_left(30), hap1_right(30), hap2_left(30), hap2_right(30), hap3_left(30), hap3_right(30), hap4_left(30), hap4_right(30), hap5_left(30), hap5_right(30), hap6_left(30), hap6_right(30), D1G(30), D2G(30), D3G(30), D4G(30), D5G(30), D6G(30), q(4), id(3) Filter "gzip" # Compress binary output files DataDir = "../data/gaw9" # Where the data files are located Missing "0",id # Define "0" as a missing value for id /* Phenotype datafiles */ file [5x,3(5),15x,2,3,6x,6,4(7)] shell("zcat "+DataDir+"/phenotyp.gz"),id,sx,age,ef,q /* Genotype data files */ file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d1a1-15.gz"), id(1),(hap1_left(i),hap1_right(i),i=1,15) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d1a16-30.gz"), id(1),(hap1_left(i),hap1_right(i),i=16,30) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d2a1-15.gz"), id(1),(hap2_left(i),hap2_right(i),i=1,15) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d2a16-30.gz"), id(1),(hap2_left(i),hap2_right(i),i=16,30) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d3a1-15.gz"), id(1),(hap3_left(i),hap3_right(i),i=1,15) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d3a16-30.gz"), id(1),(hap3_left(i),hap3_right(i),i=16,30) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d4a1-15.gz"), id(1),(hap4_left(i),hap4_right(i),i=1,15) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d4a16-30.gz"), id(1),(hap4_left(i),hap4_right(i),i=16,30) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d5a1-15.gz"), id(1),(hap5_left(i),hap5_right(i),i=1,15) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d5a16-30.gz"), id(1),(hap5_left(i),hap5_right(i),i=16,30) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d6a1-15.gz"), id(1),(hap6_left(i),hap6_right(i),i=1,15) file [5x,5,15(1x,1,1)] shell("zcat "+DataDir+"/d6a16-30.gz"), id(1),(hap6_left(i),hap6_right(i),i=16,30) /* Link haplotypes to the appropriate markers */ i=1 do Marker Locus D1G(i) [ hap1_left(i), hap1_right(i) ], D2G(i) [ hap2_left(i), hap2_right(i) ], D3G(i) [ hap3_left(i), hap3_right(i) ], D4G(i) [ hap4_left(i), hap4_right(i) ], D5G(i) [ hap5_left(i), hap5_right(i) ], D6G(i) [ hap6_left(i), hap6_right(i) ] i=i+1 while(i<=30) /* Only genotype data only where phenotype data is available */ use hap1_left,hap1_right,hap2_left,hap2_right,hap3_left,hap3_right, hap4_left,hap4_right,hap5_left,hap5_right,hap6_left,hap6_right where (q(1)) Trait Locus QTL # Define QTL as 1 or more trait loci pedigree id # Declare pedigree variables log "gaw9.log" # Name for log file sex sx 1,2 # sx determine sex: 1=Male, 2=Female /* Set up model */ model q(1)=age+ef+sx+QTL /* Define linkage groups - just analyze chromosome 1 this time */ Link "Chromosome 1",D1G /* Link "Chromosome 2",D2G Link "Chromosome 3",D3G Link "Chromosome 4",D4G Link "Chromosome 5",D5G Link "Chromosome 6",D6G */ \end{verbatim} \section{Parameter file for \Loki} \label{loki_param} The parameter file for \Loki has many similarities to the control file for \Prep in that the order of commands is generally arbitrary, and the case of commands is ignored. Comments can be added in the same way as for the control file. \subsection{Controlling the sampling run}\label{control_run} The commands described here control how many iterations to run, how often to output data to standard output (normally the screen) and the output file (which is normally the file \verb+loki.out+, unless altered with OUTPUT FILE), and when to start producing the output. The example below sets the number of iterations to 10000, with output starting at iteration 50, and begin produced at every iteration after that, and sets the output file name to \verb+loki.out1+. \begin{verbatim} ITERATIONS 10000 START OUTPUT 50 OUTPUT FREQUENCY 1 OUTPUT FILE "loki.out1" \end{verbatim} Separate starting times and output frequencies can be set for standard output and the output file by specifying a second argument to the relevant commands as in the following example: \begin{verbatim} ITERATIONS 10000 START OUTPUT 50,1 OUTPUT FREQUENCY 2,1 \end{verbatim} In this example, output to file starts at iteration 50 and continues at every second iteration. Printing to standard output, however, starts at the first iteration and carries on at every iteration after that. Specifying a 0 for an output frequency turns off the respective output stream. The default behaviour is to carry on forever, printing output at every iteration starting from iteration 1. The OUTPUT command can also be used to determine which model effects are written out. By default only the overall mean and the trait loci effects are output. If the effects of other covariates or candidate loci are required, then this can be done by: \begin{verbatim} OUTPUT sx,age OUTPUT D1G2 \end{verbatim} Interpretation of which column of output refers to which covariate effect is explained in the Analysis of Output section. The format for the output file has changed from version to version of Loki. It is understood that these changes can cause difficulties for users of earlier versions who have written tools to interpret the output. For this reason, it is possible to instruct Loki to use the output format of previous versions, as in the following example: \begin{verbatim} OUTPUT TYPE 1 \end{verbatim} Output type 0 gives the original output format, as described in the first version of this document for Loki version 2.0. Output type 1 gives the default output for version 2.1, output type 2 gives the default output for version 2.2, and type 3 gives the output for version 2.3/2.4 (this is the system default). Note that the current correspondence between version minor number and output type may not continue. The currently defined types (0,1,2,3) however, should not change in future versions (instead a new type 4 will be defined). This should make switching between versions easier. Note that use of the older output types is deprecated. Efforts should be made to move to the newer output types which contain more information and are, generally, more compact. The scripts distributed with Loki will read all output types, though they can't compensate for information missing in the earlier formats. It is likely that the output format for Loki will continue to change in the future as new features are added. It is suggested, therefore, that use is made of the supplied scripts which will be kept up to date. More details about the scripts is given in Section \ref{scripts}. \subsection{Dumping and restarting} When \Loki exits from a non--error condition (\IE it has finished the required number of operations, or is interrupted with CTRL-C), it tries to dump it's internal state to a file (by default called \verb+loki.dump+). It can then be restarted at a later date by passing the -r flag to \Loki \IE\verb+loki -r parameter_file+. \Loki can also be set to periodically dump its internal state; this is very useful if there is a possibility of the machine crashing or being switched off during a run, or for debugging purposes if \Loki is crashing partway though a long run. The dump frequency and dump file are set as in the following example, which sets \Loki to dump state every 50 iterations to the file \verb+loki.dump+. frequency to 50 \begin{verbatim} DUMP FREQUENCY 50 DUMP FILE "loki.dump1" \end{verbatim} If backups have been enabled then before writing a dumpfile, \Loki checks to see whether one already exists. If so, it renames the old file according to the backup schedule. See \emph{Backup schedules} (Section \ref{bk1}) for details. To restart an old run, either the -r flag can be used, as described before, or the -d filename option, which allows an alternative dumpfile to be specified. By default, the restarted run will create a new output file. To make \Loki append to an existing output file, pass the -a flag to \Loki. For example, to get \Loki to restart using the dumpfile \verb+loki.dump1+, and to append output to the existing outfile, use \verb+loki -adloki.dump1 param_file+. To restart a run, it is necessary to have the files \verb+loki.opt+, \verb+loki.gen+ and \verb+loki.dat+ (and \verb+loki.nrm+ if a polygenic effect is being fitted) in addition to the dumpfile. It is not necessary to keep the seedfile, as the seed state is stored in the dumpfile. Normally all of these files can be exchanged between machines of different types, so a run started on a Sun Sparc machine can be restarted on an Linux Intel based machine, with the same results as if it had been restarted on the same machine. If this feature is to be used, it should be checked as certain machines do not follow the established standards for floating point arithmetic. This behaviour can often be changed using appropriate compiler flags - check your compiler manual. \subsection{Controlling the number of trait loci} By default, the prior on the the number of trait loci is uniform between 0 and 16, with a starting value of 0. The starting number of loci and the prior can be set with the TRAIT LOCI command as below: \begin{verbatim} TRAIT LOCI 0,10 TRAIT LOCI MEAN 2 START TRAIT LOCI 3 \end{verbatim} This example sets the range for trait loci to be between 0 and 10, fits a (truncated) Poisson prior with mean 2 (rather than a uniform prior), and sets the starting number for trait loci to be 3. These numbers are checked by \Loki for consistency. \subsection{Setting the seedfile} Initialisation of the random number generator used by \Loki requires a seedfile. By default this is called \verb+seedfile+, if this is not found then the generator is initialized using a fixed value. If the program finishes or is interrupted then the current state of the generator is written out to the seedfile (a backup of the old seedfile is made first). If \Loki crashes with an error then the seedfile is not updated, allowing the run to be repeated (and hopefully determine what caused the crash). This default behaviour can be changed using the SEEDFILE command, as in the examples below: \begin{verbatim} SEEDFILE "test.seedfile" SEEDFILE "my_seedfile",1 \end{verbatim} The second argument of 1 to the SEEDFILE command in the last example prevent the seedfile from being overwritten when \Loki finishes. Using this form of the command allows a series of runs to be repeated with the same seedfile. \subsection{Setting the random number generator} If multiple runs of \Loki are executed in parallel (on multiple machines for example, of on different processors on the same machine), it is generally desirable to use non-overlapping streams of random numbers for the different jobs. This is difficult to achieve when using the standard random number generator. It is therefore possible to select from a number (currently 60) of independent random number generators using the SET RNG command, for example: \begin{verbatim} SET RNG 0 # The default setting SET RNG 2 # Switch to a different RNG \end{verbatim} If two different \Loki runs use different values for the SET RNG command then the random number streams supplied to the runs should be non-overlapping. The RNG used is stored in the seedfile, and in the absence of a SET RNG command, \Loki will continue to use the RNG that was used in during the creation of the seedfile. \subsection{Backup schedules}\label{bk1} By default, before writing to a dumpfile or outputfile, \Loki checks whether a file of the same name exists and, if it does, renames the old file by adding a `\verb+~+' character onto the end of the filename. This behaviour can be changed using the command \verb+SET backups+\ $n$, where $n$ is an positive integer (for more information about the SET command in \Loki, see Section \ref{set1}). If $n=0$ then backups are turned off, if $n=1$ then the default behaviour, described above, is followed, and if $n>1$ then numbered backups are produced. In this case, a series of $n$ backup files are kept. If the original file was called \verb+loki.dump+\ and $n>=3$, for example, then the three most recent backup versions of this file would be \verb+loki.dump~1~+, \verb+loki.dump~2~+, \verb+loki.dump~3~+, with \verb+loki.dump~1~+ being the most recent. Note that for the seedfile, the default behaviour (when $n=1$) is always followed, irrespective of any \verb+SET backups+ command. \subsection{POSITION command}\label{pos1} The map position of markers is set using the Position command. The format is very simple, as is shown by the examples below (map distances are given in cM): \begin{verbatim} POSITION D1G1 21.3 POSITION D4G(3) 3.3,5.6 \end{verbatim} Marker names are the ones used in the \Prep control file. If a marker specified in a POSITION command is not found then the statement will be silently ignored. If two positions are given \emph{for any marker} (as in the second example above) then it is assumed that a sex specific map is being used, with the male map position coming first. For more details, see Section \ref{sex_spec}. By default, the input map is assumed to be a Haldane map. Kosambi maps can be input using the MAP command (Section \ref{mapfunctions}) \label{loki_mpos1} The START keyword can be added at the beginning of a KEYWORD command to indicate that the position should be taken as a starting value, and that Loki should sample the marker position at each iteration, for example: \begin{verbatim} START POSITION D1G1 21.3 START POSITION D4G(3) 3.3,5.6 \end{verbatim} The order of markers is assumed to be fixed and is \emph{not} sampled. If all markers in a linkage group have positions which can vary, then the position of the first marker is arbitrarily fixed to provide a reference point. If any marker positions are sampled, then Loki will generate an additional output file \verb+loki.mpos+ (Section \ref{loki_mpos}) which contains the sampled positions. The schedule for outputting to this file is the same as for \verb+loki.out+ (Section \ref{control_run}). \subsection{MAP command}\label{map1} The map length of each linkage group can be set using the MAP command; in addition, the total genome length can also be set. These quantities are used to determine the prior probabilities of linkage to a region, which is intended to be proportional to the length of that region. Interpretation of the output from \Loki depends on how these are set. \textbf{\textsc{It is, therefore, very important that these map lengths are set to biologically realistic values}}. For Human linkage analysis, I typically use values for the total map length of around 3000-4000 cM. Examples of the use of MAP commands follow: \begin{verbatim} MAP "chromosome 1" 0.0,54.0 MAP "chromosome 2" 0.0,76.2 TOTAL MAP 3600.0 \end{verbatim} If a MAP command for a linkage group is not present, then the MAP range is set to the range of marker positions within that group. If a TOTAL MAP command is not present (or is less than the sum of the map lengths of linkage groups in the analysis) then the total genome length is set to the sum of the map lengths of analyzed linkage groups. This effectively means that in this case trait loci have to be located in one of the analyzed linkage groups, instead of there being some probability (as is normal) of a trait locus being unlinked to any group. If sex specific maps are required then the following syntax should be used: \begin{verbatim} MALE MAP "chromosome 1" 0.0,54.0 FEMALE MAP "chromosome 1" 0.0,76.2 TOTAL MALE MAP 360.0 TOTAL FEMALE MAP 500.0 \end{verbatim} For more details on sex specific maps, see Section \ref{sex_spec}. \label{mapfunctions} The MAP command can also be used to set the input map function to either Haldane or Kosambi. By default, \Loki assumes that the input map uses the Haldane map function. In either case, the output map always uses the Haldane map function. Note that many maps which are available over the web are Kosambi maps; a good example of this would be the Marshfield genetic maps. To use a Kosambi input map, the following command should be used: \begin{verbatim} MAP FUNCTION KOSAMBI \end{verbatim} \subsection{FREQUENCY command} This command allows the frequency of marker alleles to be set. Frequencies of trait loci can not be set. A Dirichlet$(1,1,\ldots ,1)$ prior (which is `uniform' in some sense) is put on the allele frequencies of alleles with unset frequencies, and the frequencies are integrated over. This default option is often preferable unless very good frequency information is available. Some example FREQUENCY commands are given below: \begin{verbatim} FREQUENCY D1G1 A,0.2 B,0.25 C,0.4 D,0.15 FREQUENCY MK1 113,.6 117,.1 118,.1 119,.1 111,.05 109,.05 \end{verbatim} Note that if there are several genetic groups (Section \ref{group1}) then multiple frequencies will have to be specified for each allele. To indicate which group a particular frequency corresponds to, a GROUP ORDER command (Section \ref{group2}) must appear before the first FREQUENCY command. Not all alleles have to be set, in which case the frequencies of the remaining alleles are integrated over. If frequencies are given for alleles \emph{not} segregating in the dataset being analyzed, then these alleles will be lumped together. If no `extra alleles' are specified then it is assumed that the only alleles segregating in the population are those found in the datafile (but see below). If a frequency is given as \verb+*+ then that frequency is regarded as being unset. Starting values for allele frequencies can be set using the START FREQUENCY command, with the same format as the basic FREQUENCY command. This can be used to allow for `extra alleles' in the analysis without having to know their frequencies. \subsection{Estimating marker allele frequencies} \label{lab.freq1} Normally the estimates of marker allele frequencies are not output. Sometimes, however, it may be useful to have this information. Loki can be told to output the marker frequency information using a new form of the OUTPUT FREQUENCY command as shown below: \begin{verbatim} OUTPUT FREQUENCY "freqfile" \end{verbatim} This will instruct Loki to output all marker allele frequencies to the file freqfile. Estimates will be output using the same schedule as for the main Loki output file. The structure of freqfile, and how to process the results is discussed in Section \ref{lab.freq} \subsection{GROUP ORDER command}\label{group2} If the founder individuals come from multiple genetic groups, as specified by a GROUP command in the control file (Section \ref{group1}), then separate allele frequencies should be specified for each group. This is done by including multiple frequency values for each allele in the FREQUENCY command (see above). Before the FREQUENCY command appears in the parameter file it is necessary to specify the group order for the frequencies. For example, if there are 2 genetic groups, A and B, then each allele should have 2 frequencies specified for it, and the statement: \begin{verbatim} GROUP ORDER A,B \end{verbatim} indicates that the first frequency is for group A and the second for group B. A GROUP ORDER statement will affect all FREQUENCY commands that follow it (until another GROUP ORDER statement appears). \subsection{MEAN and VARIANCE commands} It is possible to fix the values of the overall mean and residual variance, or to set starting values for these parameters. The format of the commands is demonstrated below: \begin{verbatim} MEAN 10.0 RESIDUAL VARIANCE 100.0 \end{verbatim} As with the FREQUENCY command, these can be preceeded by the START keyword to set a starting value for the parameter. \subsection{ESTIMATE IBD command}\label{estibd} If \Loki is being used to estimated IBD relationships (realized kinship coefficients), then this command is used to specify at which map positions estimation should be made. The output format and interpretation is discussed in Section \ref{ibd_estimation}. The format of the command is given below: \begin{verbatim} ESTIMATE IBD 0,10.0,13.2 ESTIMATE IBD Chrom1,0,10.0,13.2 ESTIMATE IBD MARKERS ESTIMATE IBD MARKERS Chrom2 ESTIMATE IBD GRID 0,100,1 ESTIMATE IBD GRID Chrom7 0,80,.5 \end{verbatim} Note that specification of a linkage group is required when there are more than one linkage groups, and optional otherwise. There is no benefit in estimating IBD relationships for multiple chromosomes simultaneously. However, specification of the linkage group is recommended because it provides an easy way to have linkage group specific positions. The MARKERS and GRID keywords provide a shortcut for specifying positions either at each markers position, or at regular grid positions. For the GRID keyword, it is necessary to supply the start and end points of the grid, as well as the grid size. Note - it is strongly recommended that the lm\_ratio is set to a high value when multipoint IBD estimation is being performed \ref{set1}. \subsection{ANALYSIS command}\label{analysis1} The ANALYSIS command is used to instruct \Loki to use a non--standard analysis (normally an IBD sharing analysis). By default \Loki will perform a quantitative trait locus analysis unless the ANALYSIS or ESTIMATE IBD (Section \ref{estibd}) commands are used. Currently, the only usable forms for this commands are: \begin{verbatim} ANALYZE AFFECTED,IBD ANALYZE AFFECTED,IBD,NULL \end{verbatim} Note that the order of the parameters is not significant. The first example above will estimate IBD sharing amongst affecteds (as determined by the AFFECTED command , Section \ref{aff1}). The second example will estimate the null distribution of the sharing statistic. The use of these is explained more in Section \ref{ibd_analysis}. \subsection{SET command}\label{set1} As with \Prep, \Loki has a number of internal variables which can be set to influence the way it runs. Some of these variables are mainly for debugging, but several are for more general operations (for example, see Sections \ref{bk1}, \ref{prior1}). The more useful options are listed below: \begin{itemize} \item backups\\ Set backup schedule - see Section \ref{bk1}. \item tau\_mode, tau\_beta\\ Set prior on trait loci effects - see Section \ref{prior1}. \item no\_overdominant 1\\ \label{lab_nooverdom} Forces the heterozygote effect of all trait loci to be between the homozygote effects. \item lm\_ratio\\ Sets the frequency of M steps \emph{vs.} L steps for the LM sampler. This can greatly improve the mixing of the sampler and the use of high values of the ratio ($>.5$) is recommended. Note that the L sampler is required to guarantee irreducibility, so setting the ratio to high can be counterproductive. Use of this option with the quantitative trait analysis will often significantly slow down the sampler so it may be better to use low values for the ratio ($<.2$) in this case \item debug\_level, peel\_trace\\ Provide debugging information on the internal workings of \Loki. The higher the setting, the more information given (upto a point{\ldots}). These generally have no effect unless \Loki was compiled with the \verb+-DDEBUG+\ and/or \verb+-DTRACE_PEEL+ compiler flags set. See \verb+include/config.h+\ for details. \end{itemize} \subsection{Sex specific maps}\label{sex_spec} If the SEX command (Section \ref{sex1}) was specified in command file for \Prep, then \Loki can use sex specific maps. In this case, a sex specific marker map is specified, and \Loki will then report a male and female map position for each trait locus. A check is made that map orders in both maps are the same. As would be expected, a trait locus will always be in the same interval on both maps! The use of sex specific maps is switched on by using the sex specific forms of either the POSITION or MAP commands (Sections \ref{pos1},\ref{map1}). Note that if some POSITION or MAP statements use the sex specific forms, and others do not, then sex specific maps will still be used. Where only a single figure has been provided for a map length or marker position, then this figure will be used for both male and female maps. \subsection{Setting the prior on trait loci effects}\label{prior1} The trait loci effects have a normal prior which by default is $N(0,\tau)$, where $\tau$ is determined by an interaction between the internal variables \verb+tau_beta+ and \verb+tau_mode+. These default to 2 and 0 respectively, but can be changed using the commands SET tau\_mode and SET tau\_beta (for more details on the SET command, see Section \ref{set1}). Depending on the value of tau\_mode, $\tau$ is set as follows: {\raggedright \begin{itemize} \item $\text{tau\_mode}=0$\ (default): $\tau$ is set equal to tau\_beta $\times$\ the \emph{starting} residual variance. \item $\text{tau\_mode}=1$: $\tau$ is set equal to tau\_beta. \item $\text{tau\_mode}=2$: $\tau$ is set equal to tau\_beta $\times$\ the \emph{current} residual variance at each iteration. \end{itemize}} \subsection{Estimation of Breeding Values} If an unlinked polygenic effect is being fitted, the at each iteration Loki will calculate the polygenic additive effect, or breeding value, for each individual. For some applications these values may be of interest in themselves, so an option is provided to calculate the average value of the breeding values and write them to a file. This option is selected as follows: \begin{verbatim} OUTPUT POLYGENIC "filename" \end{verbatim} The estimates are only written once, at the end of the analysis run (either the scheduled end, or when the run is interrupted. The values are also written to the dump file, so breeding value estimation runs can be restarted. The format of the output file is simply id followed by the mean nad standard deviation of the breeding value for each individual. \section{Analysis of output} \label{loki_files} Normally, output from \Loki is written to the outfiles (by default \verb+loki.out+, \verb+loki.pos+ and \verb+loki.mpos+ if marker positions are allowed to vary, but see OUTPUT FILE command, Section \ref{control_run}). There may be additional output files produced depending on the options set in the parameter file. The form of the output from \Loki depends on which analysis has been chosen and various parameter settings. Unless the ESTIMATE IBD or ANALYSIS commands (Sections \ref{estibd},\ref{analysis1}) have been specified in the parameter file, the default analysis is the quantitative trait locus analysis, which is discussed below. \subsection{Quantitative trait locus analysis} The output consists of a set of realizations of a subset of model parameters from each sampling iteration that output is requested for (controlled by the parameter file given to \Loki). The main output is sent to the file \verb+loki.out+. More detailed information on QTL positions is sent to \verb+loki.pos+, and information on marker positions when they are sampled is sent to \verb+loki.mpos+ (Section \ref{loki_mpos}). These last two files are new to loki\_2.3. \subsubsection{Output file \texttt{loki.out}} At the start of \verb+loki.out+ is a header which gives information about the file format. First is displayed information on the version of Loki used, the date and time the program was run, and the type of output format requested. This makes it possible for utilities such as \Lokiext (Section \ref{scripts}) to process the output file irrespective of which Loki version is used. The exact output format depends on the output type requested, on the model, on the markers included in the analysis, and on various quantities set in the parameter file. The examples given below are for the default output type for loki\_2.4. Previous versions of Loki tended to give less information in the header, but were basically similar. An example of the first two lines would be: \begin{verbatim} Created by loki 2.3.0: Fri Aug 18 07:51:14 2000 Output format: 2 \end{verbatim} After this comes the model being used for the analysis: \begin{verbatim} Model: Q(1) = QTL + AGE_AT_EXAM + SX \end{verbatim} This is followed by information on any marker loci being modelled. Each linkage group is listed in map order, with the name and map position of each marker being displayed. \begin{verbatim} Linkage groups: 1: chrom_1 Map range: (70cM to 130cM) D1S2866 - 98.21 D1S1665 - 102.02 D1S1728 - 109.04 2: chrom_2 Map range: (0cM to 70cM) D2S1400 - 27.60 D2S305 - 38.87 D2S144 - 45.30 D2S1788 - 55.51 Total Map Length: 3500cM \end{verbatim} Note that if sex specific maps are being used (Section \ref{sex_spec}), then each marker will be followed by two numbers, the male and female map positions. After the marker listing comes information on the column identities. This is typically starts with the following two columns: \begin{verbatim} 1: Iteration count 2: Residual variance \end{verbatim} If the residual variance is fixed, then the corresponding column will be omitted. If a polygenic effect and/or additional random effects are fitted, their variances will appear next: \begin{verbatim} 3: Additive variance 4: Additional variance for LITTER \end{verbatim} This is followed by information as to which covariate effects are being output in which columns. The following is the output when a candidate gene CG1 is being fitted along with the two level factor SX. CG1 has three alleles (A,B,C), and SX has two levels (M,F). Note that the first level of each factor effect (A,A for CG1, M for SX) is not output as it is always set equal to zero. In addition to the factor effects, candidate genes have additional columns giving the allele frequencies (for all but 1 of the alleles), and the size of the genes contribution. For more explanation of this, see the section on the QTL effect size below. \begin{verbatim} covariate data: 5: Grand mean 6: CG1 freq. A 7: CG1 freq. B 8: CG1 effect A,B 9: CG1 effect B,B 10: CG1 effect A,C 11: CG1 effect B,C 12: CG1 effect C,C 13: CG1 size 14: SX effect F \end{verbatim} Again, if the grand mean is fixed then the corresponding column will be omitted. The `size' of a candidate locus is an empirical measure (not used by the sampling process), which is an attempt to get get around some of the problems of interpreting the gene effects directly. These problems mainly come when the gene frequency is extreme (near 1 or 0). In these situations there is little or no information about the effects of one of the homozygotes, so the gene effects can fluctuate wildly, making interpretation difficult. It is also useful to have a single measure of gene size. The measure used here is the square root of the variance contributed by the trait locus, and is calculated as below: \begin{equation*} s=\sqrt{(1/n)\sum_in_i(\mu_i-\mu)^2},\quad\mu=(1/n)\sum_in_i\mu_i, \end{equation*} where $n$\ is the total number of individuals observed for the trait, $n_i$ is the number of observed individuals with genotype $i$, and $\mu_i$ is the effect of genotype $i$. The size is also calculated for QTLs (see below). If genetic groups have been specified (Sections \ref{group1},\ref{group2}), and the number of groups>1, then a separate frequency will be output for each group. The relevant section of the header file will then look something like this: \begin{verbatim} covariate data: 6: CG1 [Genetic group 1] freq. A 7: CG1 [Genetic group 1] freq. B 8: CG1 [Genetic group 2] freq. A 9: CG1 [Genetic group 2] freq. B 10: CG1 effect A,B 11: CG1 effect B,B 12: CG1 effect A,C 13: CG1 effect B,C 14: CG1 effect C,C 15: CG1 size 16: SX effect F \end{verbatim} After the covariate effects have been described, there will be a description of the QTL data blocks if any QTL are being fitted. The number of such data blocks depends on the number of QTL in the model at each iteration. The description in the header will look something like this: \begin{verbatim} QTL data blocks: linkage group [position if linked] freq. 2 effect 1,2 effect 2,2 size \end{verbatim} The position field only appears if a QTL is linked. If sex specific maps Section \ref{sex_spec} are used then there will be 2 fields output for the male and female map position. The frequency, effect and size fields are the same as for when a candidate gene is fitted (see above), with the same changes occurring when genetic groups have been specified. At the end of the header there are several lines describing the values for tau\_mode and tau\_beta (Section \ref{prior1}), total number of covariate columns, whether the \verb+no_overdominant+ flag is set\ref{lab_nooverdom}, the LM ratio if it is $>0$ (Section \ref{set1}), the number of genetic groups (Sections \ref{group1},\ref{group2}), and whether sex specific maps are being used (Section \ref{sex_spec}. In addition, if the grand mean and/or the residual variance have been fixed, their values will be printed here. The end of the header is then always marked by a line of at least 2 `\verb+_+' characters \IE \begin{verbatim} Tau Mode: 0 Tau Beta: 376.924 No. covariate columns: 11 No. genetic groups: 1 -------------------- \end{verbatim} After the header comes a series of output records, each record describing a single iteration. Not all iterations may have records, this is controlled using the START OUTPUT and OUTPUT FREQUENCY commands \ref{control_run}. An output record consists of a number of space separated fields where the number of fields depends on (a) how many covariate effects have been fitted, (b) how many trait loci are currently in the model and (c) which output format is being used. The format of each record is as described in the header above. \subsubsection{Output file \texttt{loki.pos}} The file \verb+loki.pos+ has a compact format which is more suitable for being read by a program than by hand. It lists the positions of all QTLs at every iteration (after the first output iteration has been reached as defined by the START OUTPUT command \ref{control_run}). Loki goes through each linkage group in turn (including the special unlinked group 0), and prints out the number of QTL in that group and the positions of each QTL (if not in group 0). At the end of the line is a colon followed by a number; this is the number of iterations where the information in the line did not change. By only reporting when a line changes the output can be greatly compressed. A typical file would look something like this: \begin{verbatim} 0 3:99 0 4:4 0 3 1 1 34.3557:4 0 3 1 1 35.3592:2 \end{verbatim} This says that there were 3 unlinked QTLs for 99 iterations followed by 4 unlinked QTLs for 4 iterations. One of those QTLs became linked to linkage group 1 at position 34.3557 for 4 iterations, and then moved to position 35.3592 for 2 iterations. There are 2 supplied scripts, \verb+count.pl+ and \verb+dist.pl+, which interpret this file (Section \ref{scripts}). \subsubsection{Output file \texttt{loki.mpos}} \label{loki_mpos} This file is produced if marker positions are allowed to vary using the START POSITION command (Section \ref{loki_mpos1}). The file format is very simple. The first line gives the markers whose positions are being samples, and subsequent lines give the iteration number and the marker positions in the same order as the first line. If sex specific maps are being used then two positions (female,male) will be output for each marker. \subsubsection{Marker allele frequency file} \label{lab.freq} The OUTPUT FREQUENCY "freqfile" command will cause estimates of the marker allele frequencies to be output at each output iteration to freqfile (see Section \ref{lab.freq1}. This file has a header which describes the markers and alleles which are being output. Following the header are a series of lines, 1 per output iteration, which have the iteration number and allele frequency realizations. An example of the file follows: \begin{verbatim} Created by loki 2.3.0: Fri Sep 22 11:31:32 2000 0 D1S1597: 6 7 3 1 D1S1612: 5 7 9 6 No. genetic groups: 1 -------------------- 100 0.477894 0.230591 0.291515 0.0398045 0.0172819 0.00242949 0.940484 104 0.478429 0.255159 0.266412 0.0346967 0.0140646 0.00211458 0.949124 \end{verbatim} The line lengths in the file can obviously get very long if many markers are being analyzed. Processing of this script to produce allele frequency estimates can be done using the perl script \verb+freq.pl+ (Sections \ref{lab.freq2}. Note that if there are multiple genetic groups there will be multiple estimates for each allele. The number of columns will therefore be the total number of alleles multiplied by the number of genetic groups. \subsection{IBD sharing analysis}\label{ibd_analysis} Not documented - not in a stable state. \subsection{Estimation of IBD relationship matrices}\label{ibd_estimation} This analysis is designed to estimate the IBD relationship matrices for variance component analysis programs (such as SOLAR). IBD calculations are time consuming and expensive, and for large pedigrees the only feasible way is often to use MCMC methods. \Loki will supply the IBD matrices in various formats, to make it easier to use the output with other analysis programs. The IBD relationship between 2 individuals can be expressed as a vector of 9 probabilities giving the probabilities of the 9 condensed identity states shown in figure \ref{fig:3}. \begin{figure} \begin{center} \psfig{file=docfig1.eps,width=4in} \end{center} \caption{\label{fig:3} The nine condensed identity states for 2 individuals} \end{figure} Let $\Delta_i=p(S_i)$, the probability of identity state $i$, and $\boldsymbol{\Delta}$ be the vector of identity state probabilities. To save space, \Loki does not store estimates of all 9 possible states for each relative pair. Instead it calculates two functions of $\boldsymbol{\Delta}$, twice the kinship coefficient $2\Phi=2(\Delta_1+\frac{1}{2}(\Delta_3+\Delta_5+\Delta_7)+\frac{1}{4}\Delta_8)$ \ and $\Delta_7+\Delta_1$, as these are the quantities required by most variance component programs fitting additive and dominance variance components. Note that these quantities are estimated correctly, even in the case of inbreeding, but (It is not clear, however, if the $\Delta_7+\Delta_1$ value is appropriate for the dominance component in the case of inbreeding, but that is another question{\ldots}) If IBD estimates are requested at many positions (for example, every centimorgan along a chromosome), the accumulation of the IBD sharing statistics can account for a significant proportion of the running time. It can therefore be advantageous to request \Loki to only collect the sharing statistics every $n$ iterations. This has the advantage that the samples that \textit{are}\ collected are less correlated than if collection is performed at every iteration. Obviously if IBD sharing is estimated at only a few positions (or if unlinked markers are being used), the optimum strategy may still be to collect estimates at every iteration. As with the normal \Loki analyses, the starting iteration and collection frequency are specified using the START OUTPUT and OUTPUT FREQUENCY commands. \textbf{N.B.}\ In most cases, pedigree pruning should be turned \emph{off} in \Prep when IBD estimation is performed (\ref{set_command}). If not then individuals may be missing from the output matrices. Pruning, though useful in most other cases, should only be left on with IBD estimation if you know exactly what you are doing! \subsubsection{Output options} In contrast to earlier versions of \Loki, only one set of estimates of the IBD matrices are calculated (at the end of the sampling run). If \Loki is interrupted (by the receipt of a signal), it will generate a set of estimates before quitting. Note that this can take some time (as the files can be very large), and it may not always be possible for \Loki to complete this successfully in time (for example, if the host computer is shutting down). Three output formats are currently offered, the default \Loki format, a MERLIN type format and a SOLAR type format. The \Loki and MERLIN outputs are written to a single file (default name \verb+loki.ibd+), which the SOLAR output is written to a set of files, one file per position estimated. These files are written to a directory (default name \verb+loki_ibd+). Within this directory, the file names obey the SOLAR naming scheme, so the file for position 13.4 on chromosome 11 will be called \verb+mibd.11.13.4.gz+ (if compressed). This naming scheme can not be changed. Note that to properly follow the SOLAR scheme, the chromosome names should be numeric - this is not enforced by \Loki. The default file names can be changed using the following commands: \begin{verbatim} OUTPUT IBD FILE "myibdfile" # For MERLIN format OUTPUT IBD DIR "myibd_dir" # For SOLAR format \end{verbatim} To reduce the size of the output files, \Loki can compress the output (for all formats) using gzip (highly recommended!). This is done using the following command: \begin{verbatim} COMPRESS IBD OUTPUT COMPRESS OUTPUT IBD # Alternate command format \end{verbatim} When this option is used, \verb+.gz+ will be appended to the output file name, unless the specified name already ends in \verb+.gz+. \subsubsection{Output Formats} The output format for the IBD estimates is selected as in the following examples: \begin{verbatim} OUTPUT IBD LOKI # Default output format OUTPUT IBD MERLIN OUTPUT IBD SOLAR \end{verbatim} The main output to the screen consists only of the iterations count. The other output files (notable \verb+loki.out+) are not produced. The trait locus code is not invoked at all. \subsubsection{Default (\Loki) format} An example fragment of the default output format is shown below: \begin{verbatim} Iteration 200 **Linkage group chromosome 1: **Position = 0 1 1 1 1 2 2 1 1 4 1 0.5 0 4 2 0.5 0 4 4 1 1 5 1 0.5 0 5 2 0.5 0 5 4 0.3975 0.15 5 5 1 1 6 6 1 1 7 1 0.5 0 7 2 0.5 0 7 4 0.485 0.23 7 5 0.4425 0.21 7 7 1 1 \end{verbatim} As can be seen, the output starts with a small header giving the iteration number, linkage group and position for which the estimates are for. This is then followed by $2\hat{\Phi}$ and $\hat{\Delta_7}$ for each pair of individuals for whom $\hat{\Phi}>0$. Note that if family ids are used (so the second form of the PEDIGREE command is used with \Prep), then there will be an extra column with the family name before the individual id columns. \subsubsection{MERLIN format} An example fragment MERLIN output format is shown below: \begin{verbatim} 1 1 0 0 0 1 2 1 0 1 0 0 2 2 0 0 0 1 4 1 0 0 1 0 4 2 0 0 1 0 4 4 0 0 0 1 5 1 0 0 1 0 5 2 0 0 1 0 5 4 0 0.24 0.485 0.275 5 5 0 0 0 1 6 1 0 1 0 0 6 2 0 1 0 0 6 4 0 1 0 0 6 5 0 1 0 0 6 6 0 0 0 1 7 1 0 0 1 0 7 2 0 0 1 0 7 4 0 0.165 0.565 0.27 7 5 0 0.265 0.48 0.255 \end{verbatim} This format has no header, and the position is given in the $3_{rd}$ column of the output. If multiple families are present then the estimates for the first family at each position are given, then the second family etc. Unlike the default format, an output line exists for every pair (even unrelated pairs). This can make the output much larger than the default output (even if compressed). Three columns of IBD estimates are given, which in the case of no-inbreeding correspond to $\Delta_9, \Delta_8, \Delta_7$, the probabilities of the pair sharing 0, 1 and 2 genes IBD. In the case of inbreeding, this scheme can not accurately portray the IBD relationships (and MERLIN as of version 0.9.3 does not try to calculate sharing probabilities correctly with inbreeding). In the presence of inbreeding, \Loki will output values such that the last column ($\Delta_7$) is correct, and the other columns are adjusted so that if $\Phi$ is calculated using the formula for non-inbred populations ($\Phi=\frac{1}{2}\Delta_7+\frac{1}{4}\Delta_8$), the correct value for $\Phi$ (allowing for inbreeding) will be given. Yes, this is confusing and no, I don't recommend using this format for inbred families. As before, if family IDs are used, an extra column of output with the family name will be outputted. \subsubsection{SOLAR format} An example fragment of SOLAR output format is shown below: \begin{verbatim} 640 640 1.0000000 1.0000000 641 641 1.0000000 1.0000000 773 640 0.5000000 0.0000000 773 641 0.5000000 0.0000000 773 773 1.0000000 1.0000000 643 643 1.0000000 1.0000000 642 642 1.0000000 1.0000000 774 643 0.5000000 0.0000000 774 642 0.5000000 0.0000000 774 774 1.0000000 1.0000000 908 640 0.5000000 0.0000000 908 641 0.0000000 0.0000000 \end{verbatim} This format has no header, and the position is given in the output filename. The first 2 columns are the SOLAR IBD IDs, or internal IDs for the pair, followed by $2\Phi$\ and $\Delta_7$, as with the default format. The IBD estimates are always printed to the same precision. To know the correspondence between the original IDs and the SOLAR IBD IDs, \Loki needs to read in two output files from SOLAR, \verb+pedindex.cde+\ and \verb+pedindex.out+. These should be put in the current directory. With these, \Loki will be able to automatically translate the IDs for SOLAR. Output lines are only given for related individuals, so the files size tends to be similar to the default output, and smaller than MERLIN output. \section{Analysis Scripts and Utility Programs} \label{scripts} It is not straightforward to look directly at the output from Loki and make conclusions about whether there is linkage to a region, how many QTLs are in the model, what size of QTLs have been found etc. For this reason, several perl scripts and small utility programs in C have been supplied with Loki. These can be used to read the output files from Loki, and produce either a text report, a selection of columns of data or a graphical view of the data. The graphical view of the data requires that \verb+gnuplot+ be installed on the system. This is a widely available data plotting utility which can be downloaded from ftp.dartmouth.edu/pub/gnuplot. A web page for \verb+gnuplot+ can be found at http://www.cs.dartmouth.edu/gnuplot. \subsection{Extracting information on effects: \texttt{loki\_ext.pl}} The perl script \verb+loki_ext.pl+ can be used to extract information from the \verb+loki.out+ file such that it can be used by other programs and/or scripts. Probably the two most useful applications of this script are to extract information about QTLs and to extract information about covariate effects. To do the former, the script is invoked like this: \begin{verbatim} loki_ext.pl -x loki_ext.pl -x -c2 loki_ext.pl -x -c2 -r20.3:25.7 loki_ext.pl -x -c2 -r20.3 loki_ext.pl -x -c2 -r:25.7 loki_ext.pl -x -i2000 loki_ext.pl -x -i2000:5000 loki_ext.pl -x -i:5000 \end{verbatim} The -x option specifies an extract operation. The first example extracts all QTLs linked to the first linkage group (this is the default) and outputs the relevant columns to stdout. The -c option in the second and third examples indicate that QTLs linked to the second chromosome should be extracted. The -r option specifies a range of chromosome positions to look for QTLs. Note that either or both of a starting and stopping location can be given. The -i option specifies a range of iterations to consider. As with the -r option, either or both of a starting and stopping iteration may be given. The number of columns output depends on whether the specified linkage group is 0 (meaning the `unlinked' group) in which case no QTL position information is output, and whether sex specific maps are being used, in which case both male and female map positions are output. For a normal chromosome with a sex averaged map, the output order is: iteration, map position, frequency of `1' allele,effect of `12' genotype, effect of `22' genotype, size of QTL, \% genetic variance due to QTL, \% total variance due to QTL. Note that the total variance used to calculate the last column is the variance after adjusting for any environmental covariates. To extract information about covariate effects the script is invoked as given below: \begin{verbatim} loki_ext.pl -C loki_ext.pl -D \end{verbatim} Using the -C option, loki\_ext simply strips of any QTL columns and the header from \verb+loki.out+, and outputs the remainder. The column order is therefore as given in the header to \verb+loki.out+, and will change depending on which version of Loki and which output type is being used. Using the -D option will give a `standardized' set of columns which should be consistent across different versions and output types. As before, the -i option can be used to specify a range of iterations. The output format for the -D option is as follows: \begin{enumerate} \item Iteration \item No. QTL in model \item No. linked QTL. in model \item Grand mean \item Residual variance \item Tau \item Total genetic variance \item{\ldots}Remainder of non QTL data columns \end{enumerate} The output from \verb+loki_ext.pl+ can either be directed to a file and further analyzed or viewed by programs such as \verb+gnuplot+. Alternatively the output can be piped into a program such as \verb+qavg+ to give means and confidence limits for the columns. \subsection{Estimating probabilities of linkage to chromosomes: \texttt{count.pl}} \label{ref_count} The perl script \verb+count.pl+ reads the files \verb+loki.out+ and \verb+loki.pos+, because the latter file is not produced by versions of loki prior to loki\_2.3, this scripts only works with output produced by loki\_2.3 or later. The file is invoked as follows: \begin{verbatim} count.pl [-q] [-f outfile] [-p posfile] [-i start:stop] [-b bin-size] [-c step] \end{verbatim} where the -f and -p options allow the specification of alternative input files rather than the defaults of \verb+loki.out+ and \verb+loki.pos+. By default the script displays on the screen the iteration count it has reached, this can be turned off using the -q (for quiet) option. As with \verb+loki_ext.pl+, a range of iterations can be specified using the -i option. Note that unlike \verb+loki_ext.pl+, the iteration count is from the first iteration in the file, which may not be the first sampling iteration. The output of \verb+count.pl+ looks something like this: \begin{verbatim} ---------------------------------------------- Model: Q(1) = QTL + AGE_AT_EXAM + SX Iterations: 9470 Linkage group Count Prop. linked BF ---------------------------------------------- unlinked 9470 1.00000 1.00116 chrom16 173 0.01827 0.12015 132.23 24.53cM chrom19 5022 0.53031 4.09343 1.02 90.32cM QTL number 0 1 2 3 4 5 6 -------------------------------------------------------------- Overall 0.0000 0.0024 0.1122 0.4181 0.3219 0.1094 0.0314 unlinked 0.0000 0.0720 0.2492 0.3918 0.2270 0.0492 0.0108 chrom16 0.9817 0.0177 0.0005 0.0000 0.0000 0.0000 0.0000 chrom19 0.4697 0.5087 0.0207 0.0010 0.0000 0.0000 0.0000 \end{verbatim} The script produces information about the model used and the total number of iterations measured (this will be the total iteration count less the iterations discarded at the beginning). Then follows a table giving for each linkage group the number of iterations when that linkage group contains a QTL, the same as a proportion, and an estimate of the Bayes Factor (BF) for linkage to the chromosome. This is calculated in the following way. For each linkage group, the prior probability $p$ of linkage for any single QTL is $m/t$, where $m$ is the map length of the chromosome and $t$ is the total map length of the genome. These values should be set in the parameter file, and are printed in the header of \verb+loki.out+. If sex specific maps are used (Section \ref{sex_spec}), then $p$ is calculated as $(m_f+m_m)/(t_f+t_m)$, where $m_f$ and $m_m$ are the male and female chromosome map lengths and $t_f$ and $t_m$ are the male and female total genome lengths. For a given iteration, the prior probability that at least 1 QTL is linked to a chromosome is $1-(1-p)^n$, where $n$ is the number of QTLs in the model at that iteration. The posterior probability is either $1$ or $0$ depending on whether or not a QTL is linked. The posterior/prior ratio for each linkage group is then averaged over iterations to give the Bayes Factor. An equivalent calculation is performed for the unlinked region, where its map length is defined as the amount of total genome remaining after subtraction of all fitted chromosomes. After this table is printed the distribution of QTL number in the model, and the same information calculated for each linkage group separately. The last two columns (or last four columns if a sex specific map is being used) give the maximum Bayes Factor obtained when each chromosome is split into small bins, and the location of the bin having the maximum Bayes Factor. The bin size defaults to 1cM, but this can be altered using the -b option. This calculation of the Bayes Factors for the small regions is the same as performed by \verb+dist.pl+ described below. \subsection{Estimating probabilities of linkage to small regions: \texttt{dist.pl}} The perl script \verb+dist.pl+ reads the same output files as \verb+count.pl+ (Section \ref{ref_count}) and produces a table with the estimated Bayes Factor for linkage at a series of locations along the fitted chromosomes. If \verb+gnuplot+ is installed, then the script can directly produce graphs on the screen or produce postscript versions of the graphs. For much of what is described below, it is assumed that \verb+gnuplot+ is installed and your PATH is set correctly so it can be found. The calculation of the Bayes Factor estimate is performed in the same way as described for \verb+count.pl+, but instead of treating each chromosome in its entirety the chromosome is split into equally sized bins with the Bayes Factor being estimated separately for each bin. The script has numerous options which are described below. If run without options it will produce a graph on the screen showing the estimated Bayes Factors along each chromosome in turn using a bin size of 1cM. Available options are: \begin{verbatim} -c n only consider the nth linkage group -b n set bin size to n (cM) -d name use name as the base name for temporary files. Don't delete temporary files after use. -f file select which output file to read from (defaults to loki.out) -p file select which position file to read from (defaults to loki.pos) -o file write postscript output to file -q do not invoke gnuplot -C produces color postscript plots (only has effect with -o) -i start:stop select range of iterations \end{verbatim} The temporary files, which can be examined by use of the \verb+-d+ option consist of a \verb+gnuplot+ control file and a data file. If the script was invoked as \verb+dist.pl -d junk+, the control file would be called \verb+junk+ and the data file \verb+junk.dat+. Typing \verb+gnuplot junk+ should reproduce the graphs. \subsection{Estimating marker allele frequencies: \texttt{freq.pl}} \label{lab.freq2} This script takes the raw marker allele frequency realizations produced using the command OUTPUT FREQUENCY "freqfile" (Sections \ref{lab.freq1} and \ref{lab.freq}), and produces an allele frequency estimate for each allele. Optionally it also calculates confidence intervals for the estimates. Example usages follow: \begin{verbatim} freq.pl freqfile freq.pl -p 0.025 freq.dat \end{verbatim} The second form would instruct the script to produce the 2.5\% and 97.5\% confidence limits for the estimates. The output from the script is fairly self explanatory; the second form of the script produces output like this: \begin{verbatim} D1S1597 3 0.2372 (0.2048-0.2759) 4 0.0029 (0.0004-0.0084) 5 0.0128 (0.0058-0.0219) 6 0.4530 (0.4121-0.4888) 7 0.2512 (0.2186-0.2829) 8 0.0429 (0.0291-0.0579) D1S1612 2 0.0027 (0.0003-0.0080) 4 0.1368 (0.1138-0.1669) 5 0.3374 (0.3030-0.3754) 6 0.1248 (0.1018-0.1485) 7 0.2568 (0.2235-0.2904) 8 0.0156 (0.0076-0.0261) 9 0.1190 (0.0974-0.1436) 10 0.0027 (0.0004-0.0068) 11 0.0041 (0.0009-0.0087) \end{verbatim} Each marker is presented in turn, followed by the alleles, frequency estimate and confidence intervals if requested. \subsection{Obtaining column averages - \texttt{qavg}} This is a small utility program which will quickly calculate averages and provide summary statistics about column data. If invoked with a file name it will read the file and print summary information about each column in the file, otherwise it will read from standard input. The basic information it provides is the mean, standard deviation, no. records and range of each column. An example output follows: \begin{verbatim} Col 1 - Mean = 51000 SD = 28869.7 n = 20001 Range 1000 -> 101000 Col 2 - Mean = 1.05272 SD = 0.250372 n = 20001 Range 0.202457 -> 1.96742 Col 3 - Mean = 3.27452 SD = 0.369947 n = 20001 Range 2.11931 -> 4.73246 Col 4 - Mean = 2.59041 SD = 0.448593 n = 20001 Range 0.48428 -> 4.04446 Col 5 - Mean = 65.2765 SD = 1.38383 n = 20001 Range 56.5785 -> 72.829 Col 6 - Mean = -0.412581 SD = 0.183528 n = 20001 Range -1.13458 -> 0.364772 Col 7 - Mean = -0.317538 SD = 0.186775 n = 20001 Range -1.07009 -> 0.483818 Col 8 - Mean = -1.04013 SD = 0.178181 n = 20001 Range -1.68759 -> -0.240899 \end{verbatim} If the data are log transformed and it is wished that the averaging is performed on the original scale (for example, if the data are log likelihoods), then this can be achieved using the -l option \IE \verb+qavg -l+. In addition, \verb+qavg+ can give empirical confidence limits using the -p flag; the command \verb+qavg -p0.025+ will give the 2.5\% and 97.5\% limits. This option will also make the program output the first, second and third quartiles (Q1, Q2, Q3), and an empirical `p-value'. This latter is calculated as follows. If the mean of a column is $>0$, then the p-value is the proportion of data items which are $<=0$, and visa versa when the mean is $<0$. This measure is intended as a quick aid to assessing the significance of covariate estimates. An example output using this option follows: \begin{verbatim} Col 1 - Mean = 51000 SD = 28869.7 n = 20001 Range 1000 -> 101000 Q1 = 26000, Q2 = 51000, Q3 = 76000, 2.5% Lim = 3500 -> 98500, p = 0 Col 2 - Mean = 1.05272 SD = 0.250372 n = 20001 Range 0.202457 -> 1.96742 Q1 = 0.882824, Q2 = 1.06423, Q3 = 1.22872, 2.5% Lim = 0.53308 -> 1.51554, p = 0 Col 3 - Mean = 3.27452 SD = 0.369947 n = 20001 Range 2.11931 -> 4.73246 Q1 = 3.0134, Q2 = 3.25833, Q3 = 3.52037, 2.5% Lim = 2.59481 -> 4.03333, p = 0 Col 4 - Mean = 2.59041 SD = 0.448593 n = 20001 Range 0.48428 -> 4.04446 Q1 = 2.34131, Q2 = 2.62509, Q3 = 2.88829, 2.5% Lim = 1.60588 -> 3.38831, p = 0 Col 5 - Mean = 65.2765 SD = 1.38383 n = 20001 Range 56.5785 -> 72.829 Q1 = 65.0735, Q2 = 65.3966, Q3 = 65.6771, 2.5% Lim = 61.2552 -> 68.02, p = 0 Col 6 - Mean = -0.412581 SD = 0.183528 n = 20001 Range -1.13458 -> 0.364772 Q1 = -0.537258, Q2 = -0.411998, Q3 = -0.29009, 2.5% Lim = -0.775722 -> -0.0502515, p = 0.0121494 Col 7 - Mean = -0.317538 SD = 0.186775 n = 20001 Range -1.07009 -> 0.483818 Q1 = -0.443942, Q2 = -0.318493, Q3 = -0.190569, 2.5% Lim = -0.677856 -> 0.0481646, p = 0.0456977 Col 8 - Mean = -1.04013 SD = 0.178181 n = 20001 Range -1.68759 -> -0.240899 Q1 = -1.16117, Q2 = -1.03919, Q3 = -0.919638, 2.5% Lim = -1.38943 -> -0.691617, p = 0 \end{verbatim} The use of this option requires the program to hold all of the data in memory and sort it which adds to the computational requirements of the script, so it should not be used on very large datafiles. \section{Acknowledgements} The author is grateful to Warwick Daw for testing versions and for helpful discussion and comments. This work was previously supported by NIH Grant GM46255 and is currently supported by NIH grant GM58757. \bibliography{master} \bibliographystyle{ajhg} \end{document} loki/docs/loki_faq.ps0100644000076500007650000022071607566144534014102 0ustar heathheath%!PS-Adobe-2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: loki_faq.dvi %%Pages: 4 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips loki_faq.dvi -o loki_faq.ps %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2002.11.18:1201 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr 1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B /chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ /cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 {2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ 1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X 1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) (LaserWriter 16/600)]{A length product length le{A length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 600 600 (loki_faq.dvi) @start %DVIPSBitmapFont: Fa cmmi10 10 1 /Fa 1 59 df<121C127FEAFF80A5EA7F00121C0909798817>58 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fb cmti10 10 14 /Fb 14 122 df<0107B8FCA3903A000FF000034BEB007F183E141F181E5DA2143FA25D18 1C147FA29238000380A24A130718004A91C7FC5E13015E4A133E167E49B512FEA25EECF8 000107147C163C4A1338A2010F147818E04A13701701011F16C016004A14031880013F15 0718004A5CA2017F151E173E91C8123C177C4915FC4C5A4914070001ED7FF0B8FCA25F38 397BB838>69 D71 D<147F903803FFC090380FC1E090381F0070017E137849133839 01F801F83803F003120713E0120FD81FC013F091C7FC485AA2127F90C8FCA35A5AA45AA3 153015381578007C14F0007EEB01E0003EEB03C0EC0F806CEB3E00380F81F83803FFE0C6 90C7FC1D2677A426>99 DI<147F903803FFC090380FC1E090383F00F0017E13785B 485A485A485A120F4913F8001F14F0383F8001EC07E0EC1F80397F81FF00EBFFF891C7FC 90C8FC5A5AA55AA21530007C14381578007E14F0003EEB01E0EC03C06CEB0F806CEB3E00 380781F83803FFE0C690C7FC1D2677A426>I103 D105 D108 DII<147F903803FFC090380FC1F090381F00F8 017E137C5B4848137E4848133E0007143F5B120F485AA2485A157F127F90C7FCA215FF5A 4814FEA2140115FC5AEC03F8A2EC07F015E0140F007C14C0007EEB1F80003EEB3F00147E 6C13F8380F83F03803FFC0C648C7FC202677A42A>I<9039078007C090391FE03FF09039 3CF0787C903938F8E03E9038787FC00170497EECFF00D9F0FE148013E05CEA01E113C15C A2D80003143FA25CA20107147FA24A1400A2010F5C5E5C4B5A131F5EEC80035E013F495A 6E485A5E6E48C7FC017F133EEC70FC90387E3FF0EC0F8001FEC9FCA25BA21201A25BA212 03A25B1207B512C0A3293580A42A>I116 D<13F0D803FCEB01C0D8071EEB03E0D80E1F1307121C123C0038140F49 14C01270A249131FD8F07E148012E013FEC648133F160012015B5D0003147E5BA215FE00 075C5BA214015DA314035D14070003130FEBF01F3901F87FE038007FF7EB1FC7EB000F5D A2141F003F5C48133F92C7FC147E147C007E13FC387001F8EB03E06C485A383C1F80D80F FEC8FCEA03F0233679A428>121 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fc cmbx10 10 3 /Fc 3 55 df<141E143E14FE1307133FB5FCA313CFEA000FB3B3A6007FB61280A4213779 B630>49 D52 D54 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fd cmsy10 10 1 /Fd 1 16 df15 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fe cmr10 10 72 /Fe 72 124 df11 DI<121C127FEAFF80A213C0A3127F121C1200A412011380A2120313 005A1206120E5A5A5A12600A1979B917>39 D<146014E0EB01C0EB0380EB0700130E131E 5B5BA25B485AA2485AA212075B120F90C7FCA25A121EA2123EA35AA65AB2127CA67EA312 1EA2121F7EA27F12077F1203A26C7EA26C7E1378A27F7F130E7FEB0380EB01C0EB00E014 60135278BD20>I<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C13 3E131EA2131F7FA21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E 133C137C1378A25BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>I<121C12 7FEAFF80A213C0A3127F121C1200A412011380A2120313005A1206120E5A5A5A12600A19 798817>44 DI<121C127FEAFF80A5EA7F00121C0909798817>I< 150C151E153EA2153C157CA2157815F8A215F01401A215E01403A215C01407A21580140F A215005CA2141E143EA2143C147CA2147814F8A25C1301A25C1303A2495AA25C130FA291 C7FC5BA2131E133EA2133C137CA2137813F8A25B1201A25B1203A25B1207A25B120FA290 C8FC5AA2121E123EA2123C127CA2127812F8A25A12601F537BBD2A>IIIII<1538A2157815F8A2140114031407 A2140F141F141B14331473146314C313011483EB030313071306130C131C131813301370 136013C01201EA038013005A120E120C5A123812305A12E0B712F8A3C73803F800AB4A7E 0103B512F8A325397EB82A>I<0006140CD80780133C9038F003F890B5FC5D5D158092C7 FC14FC38067FE090C9FCABEB07F8EB3FFE9038780F803907E007E090388003F0496C7E12 066E7EC87EA28181A21680A4123E127F487EA490C71300485C12E000605C12700030495A 00385C6C1303001E495A6C6C485A3907E03F800001B5C7FC38007FFCEB1FE0213A7CB72A >II<12301238123E003FB612E0A316C05A16801600 0070C712060060140E5D151800E01438485C5D5DC712014A5A92C7FC5C140E140C141C5C A25CA214F0495AA21303A25C1307A2130FA3495AA3133FA5137FA96DC8FC131E233B7BB8 2A>III<121C127FEAFF80A5EA7F 00121CC7FCB2121C127FEAFF80A5EA7F00121C092479A317>I<1538A3157CA315FEA34A 7EA34A6C7EA202077FEC063FA2020E7FEC0C1FA2021C7FEC180FA202387FEC3007A20270 7FEC6003A202C07F1501A2D901807F81A249C77F167FA20106810107B6FCA24981010CC7 121FA2496E7EA3496E7EA3496E7EA213E0707E1201486C81D80FFC02071380B56C90B512 FEA3373C7DBB3E>65 DI<913A01FF800180020FEBE003027F13F890 3A01FF807E07903A03FC000F0FD90FF0EB039F4948EB01DFD93F80EB00FF49C8127F01FE 153F12014848151F4848150FA248481507A2485A1703123F5B007F1601A35B00FF93C7FC AD127F6DED0180A3123F7F001F160318006C7E5F6C7E17066C6C150E6C6C5D0000161801 7F15386D6C5CD91FE05C6D6CEB03C0D903FCEB0F80902701FF803FC7FC9039007FFFFC02 0F13F002011380313D7BBA3C>IIIIIII75 DIIIIIIII<003FB8 12E0A3D9C003EB001F273E0001FE130348EE01F00078160000701770A300601730A400E0 1738481718A4C71600B3B0913807FF80011FB612E0A335397DB83C>IIII< 007FB590383FFFFCA3C601F801071380D97FE0D903FCC7FC013FEC01F06D6C5C5F6D6C5C 6D6C13034CC8FC6D6C1306160E6D6C5B6DEB8018163891387FC0306E6C5A16E06E6C5A91 380FF18015FB6EB4C9FC5D14036E7EA26E7F6F7EA24B7E15DF9138019FF09138038FF815 0F91380607FC91380E03FE140C4A6C7EEC38000230804A6D7E14E04A6D7E49486D7E1303 91C76C7E01066E7E130E010C6E7E011C1401013C8101FE822607FF80010713E0B500E001 3FEBFF80A339397EB83E>II96 DIIIII<147E903803FF 8090380FC1E0EB1F8790383F0FF0137EA213FCA23901F803C091C7FCADB512FCA3D801F8 C7FCB3AB487E387FFFF8A31C3B7FBA19>IIIIIII<2703F00FF0EB1FE000FFD93F FCEB7FF8913AF03F01E07E903BF1C01F83803F3D0FF3800FC7001F802603F70013CE01FE 14DC49D907F8EB0FC0A2495CA3495CB3A3486C496CEB1FE0B500C1B50083B5FCA340257E A445>I<3903F00FF000FFEB3FFCECF03F9039F1C01F803A0FF3800FC03803F70013FE49 6D7EA25BA35BB3A3486C497EB500C1B51280A329257EA42E>II<3903 F01FE000FFEB7FF89038F1E07E9039F3801F803A0FF7000FC0D803FEEB07E049EB03F049 14F849130116FC150016FEA3167FAA16FEA3ED01FCA26DEB03F816F06D13076DEB0FE001 F614C09039F7803F009038F1E07E9038F0FFF8EC1FC091C8FCAB487EB512C0A328357EA4 2E>II<3807E01F00FFEB7FC09038E1E3E09038E387F0380FE707EA03E613EE9038EC 03E09038FC0080491300A45BB3A2487EB512F0A31C257EA421>II<1318A51338A31378A313F81201 12031207001FB5FCB6FCA2D801F8C7FCB215C0A93800FC011580EB7C03017E13006D5AEB 0FFEEB01F81A347FB220>IIIIII<003FB512FCA2EB8003D83E0013F8003CEB07F00038 EB0FE012300070EB1FC0EC3F800060137F150014FE495AA2C6485A495AA2495A495A495A A290387F000613FEA2485A485A0007140E5B4848130C4848131CA24848133C48C7127C48 EB03FC90B5FCA21F247EA325>II E %EndDVIPSBitmapFont %DVIPSBitmapFont: Ff cmtt10 10 50 /Ff 50 125 df<010F133C90381F807EA8013F13FE4A5AA4007FB612F0B712F8A4003F15 F03A007E01F800A5EBFE0301FC5BA6003FB612F0B712F8A46C15F03A01F807E000A30003 130F01F05BA86C486C5A25337DB22C>35 D44 D<007FB6FCB71280A46C150021067B9B2C>I<121FEA3F80EA7FC0EAFFE0A5EA7FC0 EA3F80EA1F000B0B708A2C>I<1507ED0F80151FA2153F16005D157E15FE5D14015D1403 5DA214075D140F5D141F5D143F92C7FC5C147E14FE5CA213015C13035C13075C130F5C13 1F5CA2133F91C8FC5B137E13FE5B12015B12035B12075BA2120F5B121F5B123F90C9FC5A 127E12FE5AA25A127821417BB92C>I I<1307497EA2131FA2133F137F13FF5A1207127FB5FC13DF139FEA7C1F1200B3AE007FB5 12E0B612F0A36C14E01C3477B32C>I<000FB512FE4880A35D0180C8FCADEB83FE90389F FF8090B512E015F8819038FE03FE9038F000FF01C07F49EB3F8090C7121F6C15C0C8120F A2ED07E0A4123C127EB4FC150F16C0A248141F007EEC3F80007FEC7F006C6C5B6D485A39 1FF80FFC6CB55A6C5C000114C06C6C90C7FCEB0FF823347CB22C>53 D<121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F00C7FCAE121FEA3F80EA7FC0EAFFE0 A5EA7FC0EA3F80EA1F000B2470A32C>58 D64 D<14FE497EA4497FA214EFA2130781A214C7A2010F7FA314C390381F83F0A590383F01F8 A490387E00FCA549137E90B512FEA34880A29038F8003FA34848EB1F80A4000715C04913 0FD87FFEEBFFFC6D5AB514FE6C15FC497E27347EB32C>I<007FB512E015F8B612FE6C80 16C03903F0003FED0FE0ED07F01503A2ED01F8A6ED03F0A21507ED0FE0ED1FC0EDFF8090 B612005D5D15FF16C09039F0001FE0ED07F0ED03F81501ED00FCA216FE167EA616FE16FC 1501ED03F8150FED3FF0007FB612E016C0B712806CECFE0015F027337FB22C>I<02FF13 700107EBE0F84913F9013F13FD4913FFEBFF813901FE007F4848131FD807F0130F150748 5A491303485A150148C7FCA25A007EEC00F01600A212FE5AAB7E127EA3007F15F06CEC01 F8A26C7EA26C6C13036D14F06C6C130716E0D803FC131F6C6CEB3FC03A00FF81FF806DB5 12006D5B010F5B6D13F00100138025357DB32C>I<007FB5FCB612C015F0816C803907E0 03FEEC00FFED7F80153FED1FC0ED0FE0A2150716F0150316F81501A4ED00FCACED01F8A3 150316F0A2150716E0150FED1FC0153FED7F80EDFF00EC03FE007FB55AB65A5D15C06C91 C7FC26337EB22C>I<007FB612F0B712F8A37E3903F00001A7ED00F01600A4EC01E04A7E A490B5FCA5EBF003A46E5A91C8FCA5163C167EA8007FB612FEB7FCA36C15FC27337EB22C >I<903901FC038090390FFF87C04913EF017F13FF90B6FC4813073803FC01497E484813 7F4848133F49131F121F5B003F140F90C7FCA2127EED078092C7FCA212FE5AA8913803FF F84A13FCA27E007E6D13F89138000FC0A36C141FA27F121F6D133F120F6D137F6C7E6C6C 13FF6D5A3801FF076C90B5FC6D13EF011F13CF6DEB0780D901FCC7FC26357DB32C>71 D<007FB512F8B612FCA36C14F839000FC000B3B3A5007FB512F8B612FCA36C14F81E3379 B22C>73 D<387FFFE0B57EA36C5BD803F0C8FCB3AE16F0ED01F8A8007FB6FCB7FCA36C15 F025337DB22C>76 DI79 D<007FB512C0B612F88115FF6C15802603F00013C015 3FED0FE0ED07F0A2150316F81501A6150316F01507A2ED0FE0ED3FC015FF90B612801600 15FC5D15C001F0C8FCB0387FFF80B57EA36C5B25337EB22C>I<387FFFFCB67E15E015F8 6C803907E007FE1401EC007F6F7E151FA26F7EA64B5AA2153F4BC7FCEC01FE140790B55A 5D15E081819038E007FCEC01FE1400157F81A8160FEE1F80A5D87FFEEB1FBFB5ECFF0081 5E6C486D5AC8EA01F029347EB22C>82 D<90381FF80790B5EA0F804814CF000714FF5A38 1FF01F383FC003497E48C7FC007E147F00FE143F5A151FA46CEC0F00007E91C7FC127F7F EA3FE0EA1FFCEBFFC06C13FC0003EBFFC06C14F06C6C7F01077F9038007FFEEC07FF0200 1380153FED1FC0A2ED0FE0A20078140712FCA56CEC0FC0A26CEC1F806D133F01E0EB7F00 9038FE01FF90B55A5D00F914F0D8F83F13C0D8700790C7FC23357CB32C>I<007FB612FC B712FEA43AFC007E007EA70078153CC71400B3AF90383FFFFCA2497F6D5BA227337EB22C >I<3B7FFF803FFFC0B56C4813E0A36C496C13C03B03F00001F800B3AF6D130300015DA2 6D130700005D6D130F017F495A6D6C485AECE0FF6DB5C7FC6D5B010313F86D5B9038003F 802B3480B22C>I<007FB6FCB71280A46C150021067B7D2C>95 D<3801FFF0000713FE00 1F6D7E15E048809038C01FF81407EC01FC381F80000006C77EC8127EA3ECFFFE131F90B5 FC1203120F48EB807E383FF800EA7FC090C7FC12FE5AA47E007F14FEEB8003383FE01F6C B612FC6C15FE6C14BF0001EBFE1F3A003FF007FC27247CA32C>97 D<903803FFE0011F13F8017F13FE48B5FC48804848C6FCEA0FF0485A49137E4848131890 C9FC5A127EA25AA8127EA2127F6C140F6DEB1F806C7E6D133F6C6CEB7F003907FE03FF6C B55A6C5C6C6C5B011F13E0010390C7FC21247AA32C>99 DIIIII<1307EB1F C0A2497EA36D5AA20107C7FC90C8FCA7387FFFC080B5FC7EA2EA0007B3A8007FB512FCB6 12FEA36C14FC1F3479B32C>I107 D<387FFFE0B57EA37EEA0003B3B3A5007FB61280B7 12C0A36C158022337BB22C>I<3A7F83F007E09039CFFC1FF83AFFDFFE3FFCD87FFF13FF 91B57E3A07FE1FFC3E01FCEBF83F496C487E01F013E001E013C0A301C01380B33B7FFC3F F87FF0027F13FFD8FFFE6D13F8D87FFC4913F0023F137F2D2481A32C>I<397FF01FE039 FFF87FFC9038F9FFFE01FB7F6CB6FC00019038F03F80ECC01F02807FEC000F5B5BA25BB3 267FFFE0B5FCB500F11480A36C01E0140029247FA32C>II<397FF01FE039FFF8FF F801FB13FE90B6FC6C158000019038F07FC09138801FE091380007F049EB03F85BED01FC 491300A216FE167EA816FE6D14FCA2ED01F86D13036DEB07F0150F9138801FE09138E07F C091B51280160001FB5B01F813F8EC3FC091C8FCAD387FFFE0B57EA36C5B27367FA32C> I114 D<90387FF8700003B512F8120F5A5A387FC00F387E00034813015AA36CEB00F0007F1400 13F0383FFFC06C13FE6CEBFF80000314E0C66C13F8010113FCEB0007EC00FE0078147F00 FC143F151F7EA26C143F6D133E6D13FE9038F007FC90B5FC15F815E000F8148039701FFC 0020247AA32C>I<131E133FA9007FB6FCB71280A36C1500D8003FC8FCB1ED03C0ED07E0 A5EC800F011FEB1FC0ECE07F6DB51280160001035B6D13F89038003FE0232E7EAD2C>I< 3A7FF003FF80486C487FA3007F7F0001EB000FB3A3151FA2153F6D137F3900FE03FF90B7 FC6D15807F6D13CF902603FE07130029247FA32C>I<3A7FFF01FFFCB514FE148314016C 15FC3A03E0000F80A26D131F00011500A26D5B0000143EA26D137E017C137CA2017E13FC 013E5BA2EB3F01011F5BA21483010F5BA214C701075BA214EF01035BA214FF6D90C7FCA2 6D5A147C27247EA32C>II<3A3FFF03 FFF048018713F8A36C010313F03A00FC007E005D90387E01F8013F5BEB1F83EC87E09038 0FCFC0903807EF80EB03FF6D90C7FC5C6D5A147C14FE130180903803EF80903807CFC0EB 0FC7EC83E090381F01F0013F7FEB7E00017C137C49137E0001803A7FFF01FFFC1483B514 FE6C15FC140127247EA32C>I<3A7FFF01FFFCB5008113FE148314816C010113FC3A03E0 000F806C7E151F6D140012005D6D133E137C017E137E013E137CA2013F13FC6D5BA2EB0F 815DA2EB07C1ECC3E0A2EB03E3ECE7C0130114F75DEB00FFA292C7FC80A2143EA2147E14 7CA214FC5CA2EA0C01003F5BEA7F83EB87E0EA7E0F495A387FFF806C90C8FC6C5A6C5AEA 07E027367EA32C>I<003FB612E04815F0A4007EC7EA1FE0ED3FC0ED7F80EDFF004A5A00 3C495AC7485A4A5A4A5A4A5A4A5A4AC7FCEB01FC495AEB0FF0495A495A495A49C8FC4848 EB01E04848EB03F0485A485A485A485A485AB7FCA46C15E024247DA32C>I<127812FCB3 B3B3A9127806416DB92C>124 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fg cmbx12 12 52 /Fg 52 122 df12 D39 D45 DI< EE01C0EE03E01607A2160F17C0161F1780A2163F17005E167EA216FE5E15015EA215035E A215075E150F5EA2151F5E153F93C7FCA25D157E15FE5DA214015D14035DA214075D140F 5DA2141F5D143F92C8FCA25C147EA214FE5C13015CA213035C13075CA2130F5C131F5CA2 133F91C9FC5B137EA213FE5B12015BA212035BA212075B120F5BA2121F5B123F90CAFCA2 5A127E12FE5AA25A12782B647ACA38>I49 DII<163FA25E5E5D5DA25D5D5D5DA25D92B5FCEC01F7EC03E7140715C7EC0F87EC 1F07143E147E147C14F8EB01F0EB03E0130714C0EB0F80EB1F00133E5BA25B485A485A48 5A120F5B48C7FC123E5A12FCB91280A5C8000F90C7FCAC027FB61280A531417DC038>I< 0007150301E0143F01FFEB07FF91B6FC5E5E5E5E5E16804BC7FC5D15E092C8FC01C0C9FC AAEC3FF001C1B5FC01C714C001DF14F09039FFE03FFC9138000FFE01FC6D7E01F06D1380 4915C0497F6C4815E0C8FC6F13F0A317F8A4EA0F80EA3FE0487E12FF7FA317F05B5D6C48 15E05B007EC74813C0123E003F4A1380D81FC0491300D80FF0495AD807FEEBFFFC6CB612 F0C65D013F1480010F01FCC7FC010113C02D427BC038>I<4AB47E021F13F0027F13FC49 B6FC01079038807F8090390FFC001FD93FF014C04948137F4948EBFFE048495A5A140048 5A120FA248486D13C0EE7F80EE1E00003F92C7FCA25B127FA2EC07FC91381FFF8000FF01 7F13E091B512F89039F9F01FFC9039FBC007FE9039FF8003FF17804A6C13C05B6F13E0A2 4915F0A317F85BA4127FA5123FA217F07F121FA2000F4A13E0A26C6C15C06D4913806C01 8014006C6D485A6C9038E01FFC6DB55A011F5C010714C0010191C7FC9038003FF02D427B C038>I<903807FFC0013F13FC48B612804815E0260FF80013F0D81FC0EB3FF848C7EA1F FC4815FE01C0130F486C14FF7FA66C485B6C4814FE000FC7FCC8EA3FFCED7FF8EDFFF04A 13E04A13801600EC07FC4A5A5D4A5A5D4A5A92C7FCA2147E147CA31478AA91C8FCA814F8 EB03FE497E497FA2497FA56D5BA26D90C7FC6D5AEB00F828467AC535>63 D65 DIII< BA12F8A485D8001F90C71201EF003F180F180318011800A2197E193EA3191EA21778A285 A405F890C7FCA316011603161F92B5FCA5ED001F160316011600A2F101E01778A2F103C0 A494C7FC1907A21A80A2190FA2191FA2193FF17F0061601807181F4DB5FCBBFC61A44344 7DC34A>I71 DII75 DII< B64BB512FE8181A281D8003F6D91C7EA780081013D7F81133C6E7E6E7F6E7F6E7F6E7F82 806E7F6E7F6F7E6F7F83816F7F6F7F6F7F6F7F6F7F8382707F707F707F707F8482707F70 7F717E7113807113C019E0837113F07113F87113FC7113FE19FF847213F884848484A284 84197F193F191FA2190F1907B61603190119001A78A24F447CC358>I<923807FFC092B5 12FE0207ECFFC0021F15F091267FFE0013FC902601FFF0EB1FFF01070180010313C04990 C76C7FD91FFC6E6C7E49486F7E49486F7E01FF8348496F7E48496F1380A248496F13C0A2 4890C96C13E0A24819F04982003F19F8A3007F19FC49177FA400FF19FEAD007F19FC6D17 FFA3003F19F8A26D5E6C19F0A26E5D6C19E0A26C6D4B13C06C19806E5D6C6D4B13006C6D 4B5A6D6C4B5A6D6C4B5A6D6C4A5B6D01C001075B6D01F0011F5B010101FE90B5C7FC6D90 B65A023F15F8020715C002004AC8FC030713C047467AC454>II82 DI87 D<903801FFE0011F13FE017F6D7E48B612E03A03FE007FF848 48EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C5AEA00F090C7FCA40203B5FC91B6FC13 07013F13F19038FFFC01000313E0000F1380381FFE00485A5B127F5B12FF5BA35DA26D5B 6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F0007EBFFF86CECE01FC66CEB8007D90F FCC9FC322F7DAD36>97 DIIII< EDFF80020F13E0027F13F049B512F849EB8FFC90390FFE0FFE90381FFC1F14F8133FEB7F F0A2ED0FFCEBFFE0ED03F0ED00C01600ABB612F8A5C601E0C7FCB3B0007FEBFFE0A52746 7DC522>III<137C48B4FC4813804813C0A24813E0A56C13C0A26C13806C1300EA007C 90C7FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520>I107 DI<90277F8007FEEC0FFCB590263FFFC090387FFF8092B5 D8F001B512E002816E4880913D87F01FFC0FE03FF8913D8FC00FFE1F801FFC0003D99F00 9026FF3E007F6C019E6D013C130F02BC5D02F86D496D7EA24A5D4A5DA34A5DB3A7B60081 B60003B512FEA5572D7CAC5E>I<90397F8007FEB590383FFF8092B512E0028114F89139 87F03FFC91388F801F000390399F000FFE6C139E14BC02F86D7E5CA25CA35CB3A7B60083 B512FEA5372D7CAC3E>II< 90397FC00FF8B590B57E02C314E002CF14F89139DFC03FFC9139FF001FFE000301FCEB07 FF6C496D13804A15C04A6D13E05C7013F0A2EF7FF8A4EF3FFCACEF7FF8A318F017FFA24C 13E06E15C06E5B6E4913806E4913006E495A9139DFC07FFC02CFB512F002C314C002C091 C7FCED1FF092C9FCADB67EA536407DAC3E>II<90387F807FB53881FFE0028313F0028F13F8ED8FFC91389F 1FFE000313BE6C13BC14F8A214F0ED0FFC9138E007F8ED01E092C7FCA35CB3A5B612E0A5 272D7DAC2E>I<90391FFC038090B51287000314FF120F381FF003383FC00049133F48C7 121F127E00FE140FA215077EA27F01E090C7FC13FE387FFFF014FF6C14C015F06C14FC6C 800003806C15806C7E010F14C0EB003F020313E0140000F0143FA26C141F150FA27EA26C 15C06C141FA26DEB3F8001E0EB7F009038F803FE90B55A00FC5CD8F03F13E026E007FEC7 FC232F7CAD2C>IIIII121 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fh cmbx12 14.4 31 /Fh 31 118 df12 D<157815FC14031407141F14FF130F0007B5FCB6FCA2147F13 F0EAF800C7FCB3B3B3A6007FB712FEA52F4E76CD43>49 DI<91380FFFC091B512FC0107ECFF80011F15E090263FF8077F9026FF800113FC4848 C76C7ED803F86E7E491680D807FC8048B416C080486D15E0A4805CA36C17C06C5B6C90C7 5AD801FC1680C9FC4C13005FA24C5A4B5B4B5B4B13C04B5BDBFFFEC7FC91B512F816E016 FCEEFF80DA000713E0030113F89238007FFE707E7013807013C018E07013F0A218F8A270 13FCA218FEA2EA03E0EA0FF8487E487E487EB57EA318FCA25E18F891C7FC6C17F0495C6C 4816E001F04A13C06C484A1380D80FF84A13006CB44A5A6CD9F0075BC690B612F06D5D01 1F1580010302FCC7FCD9001F1380374F7ACD43>I<177C17FEA2160116031607160FA216 1F163F167FA216FF5D5DA25D5DED1FBFED3F3F153E157C15FCEC01F815F0EC03E01407EC 0FC01580EC1F005C147E147C5C1301495A495A5C495A131F49C7FC133E5B13FC485A5B48 5A1207485A485A90C8FC123E127E5ABA12C0A5C96C48C7FCAF020FB712C0A53A4F7CCE43 >II66 D68 DI< 932601FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F92B8EA803F0203DA E003EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC494848C9FC4901F8 824949824949824949824949824990CA7E494883A2484983485B1B7F485B481A3FA24849 181FA3485B1B0FA25AA298C8FC5CA2B5FCAE6C057FB712E0A280A36C94C7003FEBC000A3 6C7FA36C7FA27E6C7FA26C7F6C7FA26D7E6D7F6D7F6D6D5E6D7F6D01FC93B5FC6D13FF6D 6C6D5C6E01F0EC07FB020F01FEEC1FF10203903AFFF001FFE0020091B6EAC07F033FEE00 1F030703FC1307DB007F02E01301040149CAFC5B5479D26A>71 D73 D76 DI82 D97 D<913801FFF8021FEBFF8091B612F0010315 FC010F9038C00FFE903A1FFE0001FFD97FFC491380D9FFF05B4817C048495B5C5A485BA2 486F138091C7FC486F1300705A4892C8FC5BA312FFAD127F7FA27EA2EF03E06C7F17076C 6D15C07E6E140F6CEE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01FF0 010390B55A01001580023F49C7FC020113E033387CB63C>99 D<4DB47E0407B5FCA5EE00 1F1707B3A4913801FFE0021F13FC91B6FC010315C7010F9038E03FE74990380007F7D97F FC0101B5FC49487F4849143F484980485B83485B5A91C8FC5AA3485AA412FFAC127FA36C 7EA37EA26C7F5F6C6D5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0F FFC07FCF6D90B5128F0101ECFE0FD9003F13F8020301C049C7FC41547CD24B>I<913803 FFC0023F13FC49B6FC010715C04901817F903A3FFC007FF849486D7E49486D7E4849130F 48496D7E48178048497F18C0488191C7FC4817E0A248815B18F0A212FFA490B8FCA318E0 49CAFCA6127FA27F7EA218E06CEE01F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C 6DEC3F806D6CECFF00D91FFEEB03FE903A0FFFC03FF8010390B55A010015C0021F49C7FC 020113F034387CB63D>II I<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC90C8FCADEB3FF0B5FCA5 12017EB3B3A6B612E0A51B547BD325>105 D107 DIII<913801FFE0021F13FE91B612C00103 15F0010F9038807FFC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F48496D7F4A14 7F48834890C86C7EA24883A248486F7EA3007F1880A400FF18C0AC007F1880A3003F1800 6D5DA26C5FA26C5F6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD93FFE011F90C7 FC903A0FFF807FFC6D90B55A010015C0023F91C8FC020113E03A387CB643>I<903A3FF0 01FFE0B5010F13FE033FEBFFC092B612F002F301017F913AF7F8007FFE0003D9FFE0EB1F FFC602806D7F92C76C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380AC1A0060A361 18FFA2615F616E4A5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC9126FBFE075B02 F8B612E06F1480031F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B>I<90397FE0 03FEB590380FFF80033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3E013FEC6ECC0 7FECE78014EF150014EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AAB612FCA52F36 7CB537>114 D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF81307D81FE013 0148487F4980127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13FF15F86C14FF 16C06C15F06C816C816C81C681013F1580010F15C01300020714E0EC003F030713F01501 0078EC007F00F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001F8EC7F0001FE EB01FE9039FFC00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C387CB635>I<14 3EA6147EA414FEA21301A313031307A2130F131F133F13FF5A000F90B6FCB8FCA426003F FEC8FCB3A9EE07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C 5B021F5B020313802A4D7ECB34>II E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fi cmr12 14.4 25 /Fi 25 119 df<120FEA3FC0EA7FE0EAFFF0A6EA7FE0EA3FC0EA0F000C0C768B21>46 D48 D50 D<160F5EA25E5EA25E5DA25D5DA25D151E151C153C5D157015F04A5A5D14035D4A5A 5C140E5C143C14385C14F05C495A13035C130749C7FC130E131E5B133813785B5B120148 5A5B120748C8FC120E121E5A123812785AB912F0A4C8000190C7FCAF4B7F4B7F020FB612 E0A434507DCF3B>52 D65 D67 D70 D72 D76 D79 D81 D83 D97 DII101 D104 D<1378EA01FE487E487FA66C90C7FC6C5AEA007890C8FCB0EB7F80B5 FCA41203C6FC137FB3B3A43801FFE0B61280A419507CCF21>I107 D<01FFD907FEEC03FFB590261FFFC0010F 13E0037F01F0013F13F8912701F80FFC9038FC07FE913D03C003FE01E001FF0003902607 00019038038000C6010E6D6C48C76C7E6D48DA7F8E6E7E4A159CA24ADA3FF86E7E02605D 14E04A5DA34A5DB3AD2601FFE0DAFFF0EC7FF8B6D8C07F9026FFE03FB512F0A45C347CB3 63>109 D<01FFEB07FCB590383FFF8092B512E0913901F00FF8913903C007FC000349C6 6C7EC6010E13016D486D7E5C143002706E7E146014E05CA35CB3AD2601FFE0903801FFE0 B600C0B612C0A43A347CB341>II<01FFEB1F80B5EB7FF0 913801FFF8913803E1FC91380783FE0003EB0F07C6131EEB7F1C1438143091387003FC91 386000F0160014E05CA45CB3AA8048487EB612F0A427347DB32E>114 D116 D118 D E %EndDVIPSBitmapFont end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%PaperSize: A4 %%EndSetup %%Page: 1 1 1 0 bop 1570 523 a Fi(Loki)38 b(F)-13 b(A)m(Q)39 b(v0.4)1536 672 y(Simon)d(C.)i(Heath)1604 822 y(Octob)s(er)g(2002)515 1096 y Fh(1)134 b(General)515 1294 y Fg(1.1)112 b(Where)37 b(is)g(the)h(home)f(page)h(for)f(Loki?)515 1448 y Ff(http://loki.home)o (un)o(ix)o(.ne)o(t)515 1679 y Fg(1.2)112 b(What)37 b(do)s(es)i(Loki)e (stand)h(for?)515 1833 y Fe(It)26 b(do)r(esn't)g(stand)f(for)h(an)n (ything.)35 b(Loki)25 b(is)h(a)f(name)h(not)g(an)f(acron)n(ym)f(\(and)i (a)g(bad)f(pun\).)515 1932 y(As)i(suc)n(h)h(it)g(should)f(b)r(e)h (written)g(as)f(Loki,)g(not)g(LOKI.)g(Loki)g(is)g(one)h(of)f(the)h (Norse)f(go)r(ds,)515 2032 y(and)i(w)n(as)f(kno)n(wn)g(for)h(his)g (cunning)g(and)g(in)n(telligence)g(\(whic)n(h)g(sounds)g(b)r(etter)g (than)h(the)515 2131 y(alternativ)n(e)c(w)n(a)n(y)g(if)j(putting)f(it)g (whic)n(h)f(is)h(that)g(Loki)f(is)g(the)h(go)r(d)f(of)h(evil.)13 b(.)h(.)g(\).)515 2363 y Fg(1.3)112 b(Ho)m(w)48 b(do)i(I)e(\014nd)i (the)f(answ)m(er)g(to)g(a)g(question)g(whic)m(h)f(isn't)770 2479 y(here?)515 2633 y Fe(Email)31 b(me)g(at)g Ff(heath@cng.fr)p Fe(.)44 b(If)31 b(the)h(question)f(is)g(general)f(enough)h(I)h(will)f (add)g(it)h(to)515 2732 y(the)c(F)-9 b(A)n(Q.)515 2964 y Fg(1.4)112 b(Ho)m(w)37 b(should)g(I)h(refer)f(to)g(Loki)g(in)g(pap)s (ers?)515 3117 y Fe(I)31 b(w)n(ould)f(b)r(e)i(grateful)e(if)i(the)f (follo)n(wing)f(2)g(references)g(w)n(ere)g(cited)i(if)f(Loki)f(is)h (used)g(in)g(a)515 3217 y(study:)639 3380 y Fd(\017)41 b Fe(S.C.Heath)f(\(1997\).)69 b(Mark)n(o)n(v)37 b(c)n(hain)i(Mon)n(te)f (Carlo)g(segregation)f(and)i(link)-5 b(age)722 3480 y(analysis)27 b(for)g(oligogenic)e(mo)r(dels.)37 b Fc(61)p Fe(:748{760.)639 3644 y Fd(\017)k Fe(S.C.Heath,)22 b(G.L.Sno)n(w,)f(E.A.Thompson,)g (C.Tseng)e(and)g(E.M.Wijsman)h(\(1997\).)722 3744 y(MCMC)26 b(segregation)e(and)i(link)-5 b(age)25 b(analysis.)35 b Fb(Genetic)29 b(Epidemiolo)l(gy)37 b Fc(14)p Fe(:1011{)722 3844 y(1015.)515 4007 y(I)27 b(w)n(ould)h(also)e(b)r(e)i(v)n(ery)f(in)n (terested)g(if)h(y)n(ou)f(could)h(email)f(me)h(at)g Ff(heath@cng.fr)23 b Fe(when)k(a)515 4106 y(pap)r(er)c(describing)g(a)h(study)g(whic)n(h)g (uses)g(Loki)f(is)h(published)h(so)e(that)h(I)g(can)g(k)n(eep)g(a)f (trac)n(k)515 4206 y(of)k(who)h(is)f(using)g(Loki)g(for)g(what.)515 4438 y Fg(1.5)112 b(What)42 b(is)f(the)h(b)s(est)h(mac)m(hine/op)s (erating)e(system)g(for)h(run-)770 4554 y(ning)37 b(Loki?)515 4707 y Fe(The)c(fastest)g(y)n(ou)f(ha)n(v)n(e.)52 b(In)33 b(general,)h(large)d(amoun)n(ts)i(of)g(memory)f(are)g(not)h(required,) 515 4807 y(but)k(a)g(fast)f(CPU)h(is.)65 b(The)37 b(fastest)f(system)h (I'v)n(e)f(tried)h(Loki)f(on)h(so)f(far)g(is)h(one)g(with)515 4907 y(dual)d(667MHz)e(alpha)i(EV67)f(pro)r(cessors,)g(though)g(P)n(en) n(tium)h(systems)f(are)g(more)h(cost)515 5006 y(e\013ectiv)n(e)28 b(and)f(w)n(ork)g(v)n(ery)f(w)n(ell.)38 b(As)28 b(for)f(op)r(erating)g (systems)g(-)h(I)g(can)f(only)h(recommend)1926 5255 y(1)p eop %%Page: 2 2 2 1 bop 515 523 a Fe(a)27 b(UNIX)h(v)-5 b(arian)n(t.)35 b(Large)26 b(amoun)n(ts)h(of)g(disk)g(space)f(are)h(useful)g(as)g(the)h (output)f(\014les)g(can)515 623 y(get)g(v)n(ery)g(large)f(v)n(ery)g (quic)n(kly)-7 b(.)515 894 y Fh(2)134 b(Getting)46 b(and)f(compiling)h (Loki)515 1093 y Fg(2.1)112 b(Where)37 b(do)h(I)f(get)g(the)h(latest)e (v)m(ersion?)515 1246 y Fe(The)18 b(latest)g(released)g(v)n(ersion)e (is)j(obtainable)e(from)h Ff(http://www.stat.w)o(as)o(hin)o(gt)o(on.)o (ed)o(u/)o(tho)o(mp)o(son)o(/G)o(en)o(epi)o(/L)o(oki)o(.s)o(htm)o(l)515 1346 y Fe(Dev)n(elopmen)n(t)27 b(v)n(ersions)f(can)h(b)r(e)h(obtained)f (from)h Ff(http://loki.hom)o(eun)o(ix)o(.n)o(et)p Fe(.)515 1575 y Fg(2.2)112 b(What)37 b(do)h(I)f(do)h(no)m(w)f(I)h(ha)m(v)m(e)g (it?)515 1728 y Fe(Y)-7 b(ou)31 b(should)h(\014rst)f(un)n(tar)g(it.)50 b(Y)-7 b(ou)31 b(should)h(receiv)n(e)e(the)i(\014le)g(compressed)e(so)h (y)n(ou)g(m)n(ust)515 1828 y(\014rst)c(uncompress)g(it)h(and)f(then)h (un)n(tar)f(it)h(b)n(y)f(t)n(yping:)558 1980 y Ff(gunzip)41 b(loki.tar.gz)558 2080 y(tar)i(-xf)f(loki.tar)515 2232 y Fe(If)28 b(y)n(ou)f(ha)n(v)n(e)f(GNU)i(tar)f(installed)h(y)n(ou)f (should)g(b)r(e)h(able)f(to)h(do)f(this)h(is)f(one)h(go)e(with:)558 2384 y Ff(tar)43 b(-zxf)f(loki.tar)515 2536 y Fe(In)28 b(the)f(ev)n(en)n(t)h(that)f(the)h(tar)f(y)n(ou)g(ha)n(v)n(e)g(do)r (esn't)g(lik)n(e)h(either)f(of)h(these)f(forms)g(try:)558 2688 y Ff(cat)43 b(loki.tar)d(|)j(tar)f(xf)h(-)515 2841 y Fe(If)28 b(that)g(do)r(esn't)g(w)n(ork)e(then)i(consult)g(y)n(our)e (man)i(pages)f(and/or)f(the)i(lo)r(cal)f(guru.)37 b(After)515 2940 y(un)n(tarring)29 b(the)j(arc)n(hiv)n(e)e(y)n(ou)g(should)h(cd)g (in)n(to)g(the)h(main)f(loki)f(directory)g(and)h(read)g(the)515 3040 y(README)c(\014les)h(that)g(are)e(there.)37 b(After)28 b(that,)g(simply)g(t)n(yping:)558 3192 y Ff(./configure)558 3292 y(make)558 3391 y(make)42 b(install)515 3544 y Fe(should)28 b(b)r(e)i(enough)e(to)h(get)g(y)n(ou)f(going.)39 b(If)30 b(not,)f(read)f(the)h(README)g(\014les)g(again,)f(and)515 3643 y(as)h(a)g(last)h(resort,)f(email)h(me)g(at)f Ff(heath@cng.fr)c Fe(with)31 b(a)e(description)g(of)h(the)h(problem,)515 3743 y(the)d(error)d(messages)h(y)n(ou)h(get,)h(and)f(the)h(output)g (of)g Ff(uname)41 b(-a)p Fe(.)515 3972 y Fg(2.3)112 b(Ho)m(w)37 b(do)h(I)f(run)g(it?)515 4125 y Fe(Read)27 b(the)h(do)r(cumen)n (tation.)14 b(.)f(.)51 b(Sp)r(eci\014cally)28 b(lo)r(ok)f(in)h(the)g Ff(docs/)d Fe(sub)r(directory)-7 b(.)515 4355 y Fg(2.4)112 b(Ho)m(w)37 b(do)h(I)f(compile)e(Loki)i(on)h(a)f(PC?)515 4508 y Fe(Best)29 b(solution)h(-)f(install)h(Lin)n(ux/F)-7 b(reeBSD/Op)r(enBSD/NetBSD)29 b(and)h(follo)n(w)f(the)h(nor-)515 4608 y(mal)j(instructions.)52 b(Otherwise)33 b(y)n(ou're)e(really)h(on) h(y)n(our)f(o)n(wn.)52 b(If)34 b(y)n(ou)e(decide)h(to)g(p)r(ort)515 4707 y(Loki)22 b(to)g(a)g(PC)g(I)h(w)n(ould)f(b)r(e)h(in)n(terested,)g (and)g(w)n(ould)f(b)r(e)h(prepared)e(to)i(help)f(p)r(oin)n(t)h(out)g (the)515 4807 y(areas)c(whic)n(h)h(are)g(lik)n(ely)g(to)g(cause)g (trouble.)34 b(Most)20 b(of)h(the)g(Loki)f(co)r(de)g(follo)n(ws)f(ANSI) j(stan-)515 4907 y(dard)30 b(-)g(there's)g(a)g(small)g(amoun)n(t)g (whic)n(h)g(is)h(POSIX)f(complian)n(t)g(so)f(w)n(orks)g(on)h(mo)r(dern) 515 5006 y(UNIX)e(v)-5 b(arian)n(ts)27 b(but)h(will)g(cause)e(problems) h(on)h(PC's.)1926 5255 y(2)p eop %%Page: 3 3 3 2 bop 515 523 a Fg(2.5)112 b(Ho)m(w)37 b(do)h(I)f(compile)e(Loki)i (on)h(a)f(Mac?)515 676 y Fe(If)26 b(y)n(ou)f(ha)n(v)n(e)g(a)h(recen)n (t)f(Mac)g(running)h(OS-X)g(then)g(Loki)g(should)f(compile)h(and)g(run) g(with)515 776 y(no)h(problems.)36 b(Otherwise,)27 b(see)g(2.4.)515 1050 y Fh(3)134 b(Reading)46 b(in)f(data\014les)515 1249 y Fg(3.1)112 b(Ho)m(w)37 b(do)h(I)f(read)h(in)e(\014les)i(in)e(LINKA)m (GE)g(format?)515 1402 y Fe(The)g(main)g(di\013erence)g(with)h(LINKA)n (GE)e(\014les)h(o)n(v)n(er)f(the)h(`normal')f(Loki)h(\014les)g(is)g (that)515 1502 y(LINKA)n(GE)24 b(\014les)h(ha)n(v)n(e)f(a)g(separate)g (p)r(edigree)g(iden)n(ti\014er)h(\(column)g(1\),)h(and)f(p)r(edigree)f (ids)515 1601 y(can)d(b)r(e)g(re-used)g(in)g(di\013eren)n(t)g(p)r (edigrees.)34 b(F)-7 b(rom)21 b(Loki)g(2.3,)h(LINKA)n(GE)e(\014les)h (can)g(b)r(e)h(read)515 1701 y(in)29 b(directly)g(b)n(y)f(giving)g(4)h (parameters)e(to)i(the)h(PEDIGREE)d(command)i(in)g(the)g(con)n(trol)515 1801 y(\014le,)i(sp)r(ecifying)f(the)g(columns)g(con)n(taining)f(the)i (p)r(edigree)e(id,)i(id,)g(father,)g(mother.)44 b(See)515 1900 y(the)28 b(section)f(on)g(the)h(PEDIGREE)f(command)g(in)h(the)g (do)r(cumen)n(tation.)515 2175 y Fh(4)134 b(Map)45 b(functions)515 2373 y Fg(4.1)112 b(Ho)m(w)37 b(do)h(I)f(use)h(a)f(Kosam)m(bi)g(map)h (in)e(Loki?)515 2527 y Fe(By)31 b(default,)i(Loki)d(assumes)h(that)h (input)g(maps)f(use)g(Haldane's)g(map)g(function.)49 b(Ho)n(w-)515 2626 y(ev)n(er,)30 b(man)n(y)f(published)i(maps)f(use)g (Kosam)n(bi's)f(map)h(function.)46 b(In)31 b(this)f(case,)g(use)h(the) 515 2726 y(command)25 b(MAP)h(FUNCTION)h(K)n(OSAMBI)e(in)i(the)f (parameter)f(\014le,)h(whic)n(h)g(tells)h(Loki)515 2825 y(to)g(con)n(v)n(ert)f(the)i(input)h(map)e(in)n(to)h(a)f(Haldane)g (map.)515 3100 y Fh(5)134 b(IBD)45 b(Estimation)515 3298 y Fg(5.1)112 b(Is)55 b(there)f(a)i(problem)e(with)f(in)m(bred)i(p)s (edigrees)g(and)h(IBD)770 3415 y(estimation?)515 3568 y Fe(There)20 b(is)g(no)g(problem)g(with)h(the)g(estimation)f(pro)r (cedure.)34 b(Ho)n(w)n(ev)n(er,)20 b(the)h(IBD)f(estimates)515 3667 y(are)26 b(generally)h(w)n(an)n(ted)g(so)g(that)h(they)g(can)f(b)r (e)h(used)g(b)n(y)f(other)g(analysis)f(programs)g(that)515 3767 y(ma)n(y)k(ha)n(v)n(e)f(a)h(problem)g(with)h(in)n(breeding.)45 b(Chec)n(k)30 b(the)h(man)n(ual)f(or)f(con)n(tact)h(the)h(dev)n(el-)515 3867 y(op)r(ers)24 b(of)g(the)h(analysis)f(program)e(to)j(see)f(if)h (there)g(is)f(a)g(problem)g(with)i(in)n(bred)e(p)r(edigrees.)515 4099 y Fg(5.2)112 b(Ho)m(w)33 b(long)g(should)h(I)f(run)g(Loki)h(for)f (to)g(get)g(IBD)g(estimates?)515 4252 y Fe(Dep)r(ends)e(on)g(the)g(p)r (edigree)f(size,)h(amoun)n(t)g(of)f(missing)h(data)f(and)g(\(v)n(ery)g (imp)r(ortan)n(tly\))515 4352 y(the)37 b(mark)n(er)f(spacing.)65 b(Tigh)n(tly)37 b(link)n(ed)g(mark)n(ers)e(\(1cM)i(or)g(less\))g(can)f (require)h(man)n(y)515 4452 y(sample)c(iterations)f(to)i(get)f(stable)g (estimates.)54 b(If)34 b(y)n(ou)f(w)n(an)n(t)f(a)h(ball)h(park)e (estimate,)j(I)515 4551 y(generally)26 b(use)h(at)h(least)f(100000)e (iterations.)36 b(See)27 b(next)h(question.)13 b(.)h(.)1926 5255 y(3)p eop %%Page: 4 4 4 3 bop 515 523 a Fg(5.3)112 b(Ho)m(w)42 b(can)g(I)g(tell)e(if)h(I)h (ha)m(v)m(e)h(run)f(Loki)g(long)g(enough)h(to)e(get)770 639 y(IBD)c(estimates?)515 793 y Fe(A)25 b(reasonable)e(w)n(a)n(y)h(to) h(go)f(ab)r(out)h(assessing)e(the)i(qualit)n(y)g(of)g(the)g(estimates)g (is)g(to)f(rep)r(eat)515 892 y(m)n(ultiple)31 b(times)g(\(with)g (di\013eren)n(t)f(random)g(n)n(um)n(b)r(er)g(seeds.)14 b(.)f(.)60 b(\),)32 b(and)e(see)g(ho)n(w)g(closely)515 992 y(the)g(results)f(matc)n(h.)42 b(I)30 b(will)f(b)r(e)h(dev)n (eloping)f(scripts)g(to)g(mak)n(e)g(this)h(easier)e(so)h(email)g(me)515 1091 y(if)f(y)n(ou)f(are)f(in)n(terested.)515 1324 y Fg(5.4)112 b(Can)38 b(I)f(restart)g(a)h(Loki)f(IBD)g(estimation)e (analysis?)515 1477 y Fe(No.)k(The)29 b(IBD)g(estimates)f(are)f(not)i (stored)f(in)g(the)h(dump)g(\014le.)40 b(This)29 b(ma)n(y)f(b)r(e)g (\014xed)h(if)g(I)515 1577 y(ha)n(v)n(e)d(time.)515 1809 y Fg(5.5)112 b(What)47 b(run)m(time)e(options)i(should)g(I)f(use)i(for) f(IBD)f(estima-)770 1925 y(tion?)515 2079 y Fe(If)32 b(using)g(m)n(ultiple)h(mark)n(ers)e(I)h(w)n(ould)g(alw)n(a)n(ys)e(set) j(the)f(lm)p 2432 2079 25 4 v 31 w(ratio)f(to)h(b)r(e)h(0)p Fa(:)p Fe(5)e(or)h(higher.)515 2178 y(This)c(greatly)g(impro)n(v)n(es)f (mixing)h(in)h(man)n(y)g(cases.)39 b(It)29 b(is)f(also)g(often)h(w)n (orth)n(while)f(to)g(use)515 2278 y(the)23 b(OUTPUT)g(FREQUENCY)g (command)g(so)f(that)i(IBD)f(estimates)g(are)f(not)h(collected)515 2377 y(at)31 b(ev)n(ery)f(iteration)h(\(as)g(the)g(collection)g(can)g (b)r(e)h(v)n(ery)e(costly\).)48 b(Alw)n(a)n(ys)30 b(compress)g(the)515 2477 y(output)e(\014les)f(with)h(the)g(COMPRESS)f(IBD)h(OUTPUT)f (command.)515 2709 y Fg(5.6)112 b(Ho)m(w)37 b(do)h(I)f(generate)h(MIBD) f(\014les)g(for)g(SOLAR?)515 2863 y Fe(First)18 b(load)g(the)g(p)r (edigree)g(in)n(to)g(SOLAR)h(to)f(generate)f(the)i Ff(pedindex.cde)13 b Fe(and)19 b Ff(pedindex.out)515 2962 y Fe(\014les.)36 b(Cop)n(y)23 b(the)i(\014les)g(to)f(the)h(directory)e(y)n(ou)h(are)g (running)g(Loki)g(from.)35 b(Run)25 b(Loki)f(using)515 3062 y(the)e(original)f(ID)h(co)r(des)g(that)g(w)n(en)n(t)g(in)n(to)f (SOLAR.)i(Put)f(the)g(follo)n(wing)f(in)h(the)h(parameter)515 3162 y(\014le:)515 3328 y Ff(OUTPUT)41 b(IBD)h(SOLAR)515 3427 y(COMPRESS)e(IBD)i(OUTPUT)515 3527 y(ESTIMATE)e(IBD)i(GRID)g (0,100,1)f(#)i(Or)g(whatever)d(grid)i(you)g(want)515 3627 y(SET)g(lm_ratio)e(0.5)515 3793 y Fe(When)28 b(Loki)f(has)g (\014nished,)h(all)f(of)h(the)g(MIBD)g(\014les)f(will)h(b)r(e)g(in)g (the)g(directory)e(loki)p 3196 3793 V 29 w(ib)r(d.)1926 5255 y(4)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF loki/docs/loki_faq.tex0100644000076500007650000001616007566144534014254 0ustar heathheath\documentclass[10pt]{article} \usepackage{setspace,epsfig,harvard,xspace} \usepackage{amsmath} \citationstyle{dcu} \citationmode{abbr} \newcommand{\IE}{\textit{i.e.},\xspace} \newcommand{\EG}{\textit{e.g.},\xspace} \parindent=0pt \begin{document} \begin{center} \Large{Loki FAQ v0.4}\\ Simon C. Heath\\ October 2002 \end{center} \section{General} \subsection{Where is the home page for Loki?} \verb+http://loki.homeunix.net+ \subsection{What does Loki stand for?} It doesn't stand for anything. Loki is a name not an acronym (and a bad pun). As such it should be written as Loki, not LOKI. Loki is one of the Norse gods, and was known for his cunning and intelligence (which sounds better than the alternative way if putting it which is that Loki is the god of evil{\ldots}). \subsection{How do I find the answer to a question which isn't here?} Email me at \verb+heath@cng.fr+. If the question is general enough I will add it to the FAQ. \subsection{How should I refer to Loki in papers?} I would be grateful if the following 2 references were cited if Loki is used in a study: \begin{itemize} \item S.C.Heath (1997). Markov chain Monte Carlo segregation and linkage analysis for oligogenic models. \textbf{61}:748--760. \item S.C.Heath, G.L.Snow, E.A.Thompson, C.Tseng and E.M.Wijsman (1997). MCMC segregation and linkage analysis. \emph{Genetic Epidemiology} \textbf{14}:1011--1015. \end{itemize} I would also be very interested if you could email me at \verb+heath@cng.fr+ when a paper describing a study which uses Loki is published so that I can keep a track of who is using Loki for what. \subsection{What is the best machine/operating system for running Loki?} The fastest you have. In general, large amounts of memory are not required, but a fast CPU is. The fastest system I've tried Loki on so far is one with dual 667MHz alpha EV67 processors, though Pentium systems are more cost effective and work very well. As for operating systems - I can only recommend a UNIX variant. Large amounts of disk space are useful as the output files can get very large very quickly. \section{Getting and compiling Loki} \subsection{Where do I get the latest version?} The latest released version is obtainable from \verb+http://www.stat.washington.edu/thompson/Genepi/Loki.shtml+ Development versions can be obtained from \verb+http://loki.homeunix.net+. \subsection{What do I do now I have it?} You should first untar it. You should receive the file compressed so you must first uncompress it and then untar it by typing: \begin{verbatim} gunzip loki.tar.gz tar -xf loki.tar \end{verbatim} If you have GNU tar installed you should be able to do this is one go with: \begin{verbatim} tar -zxf loki.tar \end{verbatim} In the event that the tar you have doesn't like either of these forms try: \begin{verbatim} cat loki.tar | tar xf - \end{verbatim} If that doesn't work then consult your man pages and/or the local guru. After untarring the archive you should cd into the main loki directory and read the README files that are there. After that, simply typing: \begin{verbatim} ./configure make make install \end{verbatim} should be enough to get you going. If not, read the README files again, and as a last resort, email me at \verb+heath@cng.fr+ with a description of the problem, the error messages you get, and the output of \verb+uname -a+. \subsection{How do I run it?} Read the documentation{\ldots} Specifically look in the \verb+docs/+ subdirectory. \subsection{How do I compile Loki on a PC?} \label{pc_quest} Best solution - install Linux/FreeBSD/OpenBSD/NetBSD and follow the normal instructions. Otherwise you're really on your own. If you decide to port Loki to a PC I would be interested, and would be prepared to help point out the areas which are likely to cause trouble. Most of the Loki code follows ANSI standard - there's a small amount which is POSIX compliant so works on modern UNIX variants but will cause problems on PC's. \subsection{How do I compile Loki on a Mac?} If you have a recent Mac running OS-X then Loki should compile and run with no problems. Otherwise, see \ref{pc_quest}. \section{Reading in datafiles} \subsection{How do I read in files in LINKAGE format?} The main difference with LINKAGE files over the `normal' Loki files is that LINKAGE files have a separate pedigree identifier (column 1), and pedigree ids can be re-used in different pedigrees. From Loki 2.3, LINKAGE files can be read in directly by giving 4 parameters to the PEDIGREE command in the control file, specifying the columns containing the pedigree id, id, father, mother. See the section on the PEDIGREE command in the documentation. \section{Map functions} \subsection{How do I use a Kosambi map in Loki?} By default, Loki assumes that input maps use Haldane's map function. However, many published maps use Kosambi's map function. In this case, use the command MAP FUNCTION KOSAMBI in the parameter file, which tells Loki to convert the input map into a Haldane map. \section{IBD Estimation} \subsection{Is there a problem with inbred pedigrees and IBD estimation?} There is no problem with the estimation procedure. However, the IBD estimates are generally wanted so that they can be used by other analysis programs that may have a problem with inbreeding. Check the manual or contact the developers of the analysis program to see if there is a problem with inbred pedigrees. \subsection{How long should I run Loki for to get IBD estimates?} Depends on the pedigree size, amount of missing data and (very importantly) the marker spacing. Tightly linked markers (1cM or less) can require many sample iterations to get stable estimates. If you want a ball park estimate, I generally use at least 100000 iterations. See next question{\ldots} \subsection{How can I tell if I have run Loki long enough to get IBD estimates?} A reasonable way to go about assessing the quality of the estimates is to repeat multiple times (with different random number seeds{\ldots} ), and see how closely the results match. I will be developing scripts to make this easier so email me if you are interested. \subsection{Can I restart a Loki IBD estimation analysis?} No. The IBD estimates are not stored in the dump file. This may be fixed if I have time. \subsection{What runtime options should I use for IBD estimation?} If using multiple markers I would always set the lm\_ratio to be $0.5$ or higher. This greatly improves mixing in many cases. It is also often worthwhile to use the OUTPUT FREQUENCY command so that IBD estimates are not collected at every iteration (as the collection can be very costly). Always compress the output files with the COMPRESS IBD OUTPUT command. \subsection{How do I generate MIBD files for SOLAR?} First load the pedigree into SOLAR to generate the \verb+pedindex.cde+\ and \verb+pedindex.out+\ files. Copy the files to the directory you are running Loki from. Run Loki using the original ID codes that went into SOLAR. Put the following in the parameter file: \begin{verbatim} OUTPUT IBD SOLAR COMPRESS IBD OUTPUT ESTIMATE IBD GRID 0,100,1 # Or whatever grid you want SET lm_ratio 0.5 \end{verbatim} When Loki has finished, all of the MIBD files will be in the directory loki\_ibd. \end{document} loki/include/0040755000076500007650000000000010060041266012414 5ustar heathheathloki/include/bin_tree.h0100644000076500007650000000051707646743055014401 0ustar heathheath#ifndef _BIN_TREE_H_ #define _BIN_TREE_H_ #ifndef BIN_TREE_H #define BIN_TREE_H 1 struct bin_node { struct bin_node *left,*right; void *data; int balance; }; struct bin_node *rotate_left(struct bin_node *); struct bin_node *rotate_right(struct bin_node *); void free_bin_tree(struct bin_node *,void (*)(void *)); #endif #endif loki/include/config.h.in0100644000076500007650000000666407646743055014475 0ustar heathheath/* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if using alloca.c. */ #undef C_ALLOCA /* Define to empty if the keyword does not work. */ #undef const /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ #undef CRAY_STACKSEG_END /* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA /* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF /* Define if --enable-dmalloc selected */ #undef ENABLE_DMALLOC /* Define to `int' if doesn't define. */ #undef mode_t /* Define to `long' if doesn't define. */ #undef off_t /* Define to `int' if doesn't define. */ #undef pid_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef socklen_t /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you have the atexit function. */ #undef HAVE_ATEXIT /* Define if you have the bcopy function. */ #undef HAVE_BCOPY /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE /* Define if you have the on_exit function. */ #undef HAVE_ON_EXIT /* Define if you have the popen function. */ #undef HAVE_POPEN /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF /* Define if you have the regcomp function. */ #undef HAVE_REGCOMP /* Define if you have the strtod function. */ #undef HAVE_STRTOD /* Define if you have the strtol function. */ #undef HAVE_STRTOL /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_LIMITS_H /* Define if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the header file. */ #undef HAVE_VALUES_H /* Define if you have the m library (-lm). */ #undef HAVE_LIBM #if !HAVE_MEMCPY #define memcpy(dest,src,n) bcopy(src,dest,n) #endif #if !HAVE_MEMMOVE #define memmove(dest,src,n) bcopy(src,dest,n) #endif #if !HAVE_ATEXIT #if HAVE_ON_EXIT #define atexit(a) on_exit(a,0) #else #define at_exit(a) #endif #endif /* define if you want to use 64 bit longs on 32 bit systems with recent gcc compilers. Speed cost + not well tested. */ /* # undef USE_LONGLONG */ /* define if you want to add debugging code. Some speed cost */ /* # undef DEBUG */ /* define if you want to add trace code. Some speed cost */ /* # undef PEEL_TRACE */ #ifdef __GNUC__ #define _U_ __attribute__((unused)) #else #define _U_ #endif loki/include/getopt.h0100644000076500007650000000626307646743055014120 0ustar heathheath/* $OpenBSD: getopt.h,v 1.1 2002/12/03 20:24:29 millert Exp $ */ /* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef _GETOPT_H_ #define _GETOPT_H_ /* #include */ /* * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 struct option { /* name of long option */ const char *name; /* * one of no_argument, required_argument, and optional_argument: * whether option takes an argument */ int has_arg; /* if not NULL, set *flag to val when option found */ int *flag; /* if flag not NULL, value to set *flag to; else return value */ int val; }; int getopt_long(int, char * const *, const char *, const struct option *, int *); int getopt_long_only(int, char * const *, const char *, const struct option *, int *); #ifndef _GETOPT_DEFINED_ #define _GETOPT_DEFINED_ int getopt(int, char * const *, const char *); int getsubopt(char **, char * const *, char **); extern char *optarg; /* getopt(3) external variables */ extern int opterr; extern int optind; extern int optopt; extern int optreset; extern char *suboptarg; /* getsubopt(3) external variable */ #endif #endif /* !_GETOPT_H_ */ loki/include/libhdr.h0100644000076500007650000000150107646743055014050 0ustar heathheath#ifndef _LIBHDR_H_ #define _LIBHDR_H_ #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif extern int child_open(const int,const char *,const char *); extern int child_open1(const int,const char *,const char *,const char *); #ifndef HAVE_POPEN FILE *popen(const char *,const char *); #endif extern int getseed(const char *,const int); int writeseed(const char *,const int); int dumpseed(FILE *,const int); int mkbackup(const char *,int); int bindumpseed(FILE *); int binreadseed(FILE *,char *); char *my_strsep(char **,const char *); extern double cumchic(double,int); extern double cumchn(double,int,double); extern double critchi(double,int); extern double critchn(double,int,double); #define cumchi(x,df) (1.0-cumchic(x,df)) #define cnorm(x) (.5*(1+erf(x/sqrt(2.0)))) #endif loki/include/lk_long.h0100644000076500007650000000054707750164171014232 0ustar heathheath#ifndef _LK_LONG_H_ #define _LK_LONG_H_ #ifdef USE_LONGLONG typedef long long lk_long; typedef unsigned long long lk_ulong; #define LK_LONG_BIT 64 #define LK_LONG_MAX 0x7fffffffffffffff #define LK_ONE 1ULL #else typedef long lk_long; typedef unsigned long lk_ulong; #define LK_LONG_BIT LONG_BIT #define LK_LONG_MAX LONG_MAX #define LK_ONE 1UL #endif #endif loki/include/loki_struct.h0100644000076500007650000000406607747751241015155 0ustar heathheath#ifndef _LOKI_STRUCT_H_ #define _LOKI_STRUCT_H_ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * loki_struct.h: * * * ****************************************************************************/ #define ST_DATA 1 #define ST_ID 2 #define ST_SIRE 4 #define ST_DAM 8 #define ST_MARKER 0x10 #define ST_HAPLO 0x20 #define ST_LINKED 0x40 #define ST_FACTOR 0x80 #define ST_MODEL 0x100 #define ST_TRAITLOCUS 0x200 #define ST_RANDOM 0x400 #define ST_TRAIT 0x800 #define ST_RESTRICT 0x1000 #define ST_REQUIRED 0x4000 #define ST_STRING 0x8000 #define ST_REAL 0x10000 #define ST_INTEGER 0x20000 #define ST_REALTYPE 0x40000 #define ST_INTTYPE 0x80000 #define ST_ARRAY 0x100000 #define ST_SCALAR 0x200000 #define ST_CONSTANT 0x400000 #define ST_FLAG 0x800000 #define ST_CENSORED 0x1000000 #define ST_GROUP 0x2000000 #define ST_SEX 0x4000000 #define ST_FAMILY 0x8000000 #define ST_MULTIPLE 0x10000000 #define ST_NOT_REALLY_REQUIRED 0x20000000 #define ST_PED (ST_ID|ST_SIRE|ST_DAM|ST_FAMILY) #define LINK_AUTO 0 #define LINK_X 1 #define LINK_Y 2 #define UNLINKED 3 typedef union { long value; double rvalue; } iddat; struct id_data { iddat data; int flag; }; #define REMSIZE 256 struct remember { struct remember *next; void *mem[REMSIZE]; int pos; }; extern struct remember *AddRemem(void *p,struct remember *rblock); extern void FreeRemem(struct remember *rblock); #endif loki/include/min_deg.h0100644000076500007650000000052507747747302014214 0ustar heathheath#ifndef _MIN_DEG_H_ #define _MIN_DEG_H_ struct mat_elem { struct mat_elem *next; int x; }; struct deg_list { struct deg_list *next,*last,*abs_list; int node; }; struct pair_wt { int pair_node; double wt; }; int *min_deg(int,int *,int *,int *,int); int *greedy(int,int *,int *,int *,double *,struct pair_wt *,int,double *); #endif loki/include/ranlib.h0100644000076500007650000000250607646743055014061 0ustar heathheath#ifndef _RANLIB_H_ #define _RANLIB_H_ /* Prototypes for all user accessible RANLIB routines */ /* #define ranf genrand*/ #define ranf genrand #define safe_ranf safe_genrand #define init_ranf sgenrand extern double genrand(void); extern unsigned int genint(void); extern double safe_genrand(void); extern double test_genrand(void); extern int set_mt_idx(int); extern void sgenrand(unsigned int sd); double ppnd(double,int *); double trunc_normal(const double,const double,const int,int *); extern void advnst(int k); extern double genbet(const double,const double); extern double genchi(const double); extern double genexp(double const); extern double genf(const double,const double); extern double gengam(const double,const double); extern void genmul(const int,const double *,const int,int *); extern double gennch(const double,const double); extern double gennf(const double,const double,const double); extern double gennor(const double,const double); extern void genprm(int *,const int); extern double genunf(const double,const double); extern int ignbin(const int,const double); extern int ignnbn(const int,const double); extern int ignpoi(const double); extern int ignuin(const int,const int); extern int mltmod(const int,const int,const int); extern double sgamma(const double); extern double sexpo(void); extern double snorm(void); #endif loki/include/shared_peel.h0100644000076500007650000000400007646743055015054 0ustar heathheath#ifndef _SHARED_PEEL_H_ #define _SHARED_PEEL_H_ #define HAD_M 4096 #define HAD_P 8192 #define HAP_DAT 16384 #define HAP_JNT 32768 #define IN_RF 65536 #define X_MAT 0 #define X_PAT 1 #define X_MM_PM 0 #define X_MM_PP 1 #define X_MP_PM 2 #define X_MP_PP 3 #define PEEL_SIMPLE 1 #define PEEL_COMPLEX 2 #define PEEL_INITIAL 3 #define FENRIS_PEEL_SIMPLE 8 #define TL_NAME "#traitlocus#" union Peelseq_Pointer { struct Complex_Element *complex; struct Simple_Element *simple; struct Initial_Element *initial; struct Fenris_Simple_Element *fsimple; }; struct Peelseq_Head { union Peelseq_Pointer ptr; int type; }; #define INITIAL_TRIPLET 1 #define INITIAL_DUPLET 2 #define INITIAL_DATA 3 #define INITIAL_FOUNDER 4 struct Initial_Element { struct Peelseq_Head next; int involved[3]; /* ids of above (i>0 - maternal allele of i, i<0 - paternal allele of -i) */ int flags[3]; /* Flags for involved alleles */ int rf_idx; /* Included R-function (from simple peeling) */ int type; int n_involved; /* No. alleles involved in the operation */ int out_index; /* Index of output R-Function */ }; struct Simple_Element { struct Peelseq_Head next; int *off; int sire; int dam; int n_off; int pivot; int out_index; }; struct Fenris_Simple_Element { struct Peelseq_Head next; int *off; int *rf; int sire; int dam; int n_off; int pivot; int out_index; }; struct Complex_Element { struct Peelseq_Head next; int *involved; /* ids of above (i>0 - maternal allele of i, i<0 - paternal allele of -i) */ int *flags; /* Flags for involved alleles */ int *index; /* Indices for R-Functions */ int n_peel; /* No. alleles to be peeled */ int n_involved; /* No. alleles involved in the operation */ int out_index; /* Index of output R-Function */ int n_rfuncs; /* How many R-Functions to be combined */ }; void free_peelseq(struct Peelseq_Head *pp); extern int num_bits(const int n_all); #endif loki/include/sparse.h0100644000076500007650000000232207646743055014103 0ustar heathheath#ifndef _SPARSE_H_ #define _SPARSE_H_ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March/April 1997 * * * * sparse.h: * * * * Structures for sparse matrix calculation and storage * * * ****************************************************************************/ struct SparseMatRec { double val; int x; }; struct Off { struct Off *Next; double val; int col; }; struct Diag { struct Off *First; double val; int count; }; #endif loki/include/utils.h0100644000076500007650000000234107747720675013754 0ustar heathheath#ifndef _UTILS_H_ #define _UTILS_H_ #include #ifndef WORD_BIT #define WORD_BIT (sizeof(int)<<3) #endif #ifndef LONG_BIT #define LONG_BIT (sizeof(long)<<3) #endif #define READ 0 #define WRITE 1 #define DEFAULT_FILE_PREFIX "loki" #define UTL_NULL_POINTER 1 #define UTL_NO_MEM 2 #define UTL_BAD_STAT 3 #define UTL_BAD_DIR 4 #define UTL_BAD_PERM 5 #define UTL_MAX_ERR 5 typedef struct { time_t start_time; double extra_time,extra_stime,extra_utime; } loki_time; const char *FMsg,*IntErr,*MMsg,*AbMsg; int from_abt; void abt(const char *, const int, const char *, ...); char *copy_string(const char *); char *make_file_name( const char *); void print_start_time(const char *,const char *,char *,loki_time *); void print_end_time(void); int mystrcmp(const char *, const char *); void qstrip(char *); char **tokenize(char *,const int); void gen_perm(int *,int); void gnu_qsort(void *const,size_t,size_t,int(*)(const void *,const void *)); int txt_print_double(double,FILE *); int txt_get_double(char *,char **,double *); int set_file_prefix(const char *); int set_file_dir(const char *); const char *utl_error(int); char *add_file_dir(const char *); #define ABT_FUNC(msg) abt(__FILE__,__LINE__,"%s(): %s",FUNC_NAME,msg) #endif loki/include/version.h0100644000076500007650000000043510060041254014246 0ustar heathheath#ifndef _VERSION_H_ #define _VERSION_H_ #define VERSION "2.4.7_4" #define LOKI_NAME "loki " VERSION #define PREP_NAME "prep " VERSION #define HET_VERSION "0.1" #define HET_NAME "check_het " HET_VERSION #define FENRIS_VERSION "0.1" #define FENRIS_NAME "fenris " FENRIS_VERSION #endif loki/libsrc/0040755000076500007650000000000010060041201012234 5ustar heathheathloki/libsrc/bin_tree.c0100644000076500007650000000524307646742767014241 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Evry * * * * October 2002 * * * * bin_tree.c: * * * * Routines for binary tree stuff * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include "bin_tree.h" struct bin_node *rotate_left(struct bin_node *node) { struct bin_node *l,*gc; l=node->left; if(l->balance==-1) { node->left=l->right; l->right=node; node->balance=l->balance=0; node=l; } else { gc=l->right; l->right=gc->left; gc->left=l; node->left=gc->right; gc->right=node; switch(gc->balance) { case -1: node->balance=1; l->balance=0; break; case 0: node->balance=l->balance=0; break; case 1: node->balance=0; l->balance=-1; } gc->balance=0; node=gc; } return node; } struct bin_node *rotate_right(struct bin_node *node) { struct bin_node *r,*gc; r=node->right; if(r->balance==1) { node->right=r->left; r->left=node; node->balance=r->balance=0; node=r; } else { gc=r->left; r->left=gc->right; gc->right=r; node->right=gc->left; gc->left=node; switch(gc->balance) { case -1: node->balance=0; r->balance=1; break; case 0: node->balance=r->balance=0; break; case 1: node->balance=-1; r->balance=0; } gc->balance=0; node=gc; } return node; } void free_bin_tree(struct bin_node *node,void (*free_node)(void *)) { if(node->left) free_bin_tree(node->left,free_node); if(node->right) free_bin_tree(node->right,free_node); if(node->data) free_node(node->data); free(node); } loki/libsrc/genrand.c0100644000076500007650000001657107747732430014062 0ustar heathheath#include #include #include #include "libhdr.h" #include "ranlib.h" #include "utils.h" #define N 624 #define M 397 #define umask 0x80000000U #define lmask 0x7FFFFFFFU #define mixBits(u,v) (((u)&umask)|((v)&lmask)) #define twist(u,v) ((mixBits(u,v)>>1)^((v)&1U?aa:0U)) static unsigned int rgen[][3]={ {0x9908B0DFU,0x9D2C5680U,0xEFC60000U}, /* Original MT19937 param */ {0x8c400000U,0xbb56ef00U,0xddd58000U}, /* Set of independent 2^19937 RNG parameters */ {0xb0b70001U,0x4e753a80U,0xf7d48000U}, {0x92db0002U,0xab55b780U,0x76538000U}, {0x852b0003U,0x9ddc6d80U,0xef558000U}, {0xd6db0004U,0x26eef680U,0xeec58000U}, {0xc36d0005U,0xdd4eec80U,0xefd38000U}, {0x938c0006U,0xcd757780U,0xee778000U}, {0xd6810007U,0xf2976c80U,0x6fcb8000U}, {0x872d0008U,0xbb54ee80U,0xddd58000U}, {0xf8950009U,0x65bd7380U,0xef4d8000U}, {0x8451000aU,0x38d4ed00U,0xddd78000U}, {0x97f4000bU,0x99e47580U,0xef458000U}, {0xd6d4000cU,0xbbd5be80U,0xf5d48000U}, {0xbea1000dU,0x39913a80U,0xf7d58000U}, {0xbcd0000eU,0x9dd4b500U,0xf7d58000U}, {0xae1d000fU,0x9d627680U,0xeff78000U}, {0x94df0010U,0x39573b80U,0xf7958000U}, {0xaf580011U,0xd9b77b80U,0xf7558000U}, {0xbaf2003cU,0xf735bf80U,0xba958000U}, {0xcd870013U,0x39b53a80U,0xf7d48000U}, {0x949f0014U,0x9b76bb80U,0xf7d18000U}, {0xaf1e0015U,0x9d727680U,0xeff78000U}, {0xf6100016U,0xec75bb80U,0xbb578000U}, {0x83d4003aU,0x6e557b80U,0xf7758000U}, {0xfe690018U,0xeed5bb80U,0x77558000U}, {0x88c00019U,0x6ea57b00U,0xf7f18000U}, {0xd751001aU,0x9dd47380U,0xef7d8000U}, {0xff4f001bU,0x9d8d7780U,0xed7d8000U}, {0xb8e0001cU,0xd674ea80U,0xefd48000U}, {0xf947001dU,0x2a753680U,0xf7d28000U}, {0x9b9d001eU,0xbb25bf80U,0xf6b58000U}, {0xad97001fU,0xb914ee80U,0xddd58000U}, {0x9e9d0020U,0xdf96ee80U,0xedd58000U}, {0xac830021U,0x93b4bb80U,0xf7568000U}, {0x88250022U,0xf3376f80U,0xdd558000U}, {0xed200023U,0xb7b57680U,0xddd58000U}, {0xf2300024U,0xb956ee00U,0xedd58000U}, {0xe08b0025U,0xab7d6d80U,0xdb578000U}, {0xde240026U,0xef55bb80U,0x77958000U}, {0xb0660027U,0x5b553b00U,0xf7d58000U}, {0xc4e00028U,0xb954ee80U,0xddd58000U}, {0x9ffc0029U,0x3b553b00U,0xf7d78000U}, {0x9fe5002aU,0x8f567600U,0xedd58000U}, {0xe52c002bU,0xf3d56d80U,0x6f5d8000U}, {0xd9b4002cU,0xbcb3b780U,0xf6578000U}, {0x958f002dU,0xf6f77e80U,0xdad58000U}, {0x8e91002fU,0x9d757680U,0xeef78000U}, {0xbc890031U,0xf5977680U,0xddf58000U}, {0xd8650032U,0xf5957780U,0xed558000U}, {0x87210033U,0xef55bb00U,0x77d58000U}, {0x9e000034U,0xcf557780U,0xed758000U}, {0xa1e60035U,0xf677bb80U,0xbb558000U}, {0xbe030036U,0x9b72bb80U,0xf7d78000U}, {0xca290037U,0x75b77780U,0xed558000U}, {0xd47d0038U,0x65ad7380U,0xef558000U}, {0x90110039U,0x9994bb80U,0xf7558000U}, {0,0,0} }; static unsigned int state[N+1],set; static unsigned int *next,maskB,maskC,aa; static int left=-1,shift0,gen_idx=0; int set_mt_idx(int idx) { int i,err=-1; if(idx>=0) { i=0; while(rgen[i][0]) i++; if(i>idx && rgen[idx][1]) { shift0=idx?12:11; aa=rgen[idx][0]; maskB=rgen[idx][1]; maskC=rgen[idx][2]; if(set && idx!=gen_idx) err=1; else err=0; gen_idx=idx; } } set=1; return err; } void sgenrand(unsigned int seed) { int j; if(!set) set_mt_idx(0); state[0]=seed&0xffffffffU; for(j=1;j>30))+j); state[j]&=0xffffffffU; } left=0; } static void next_state(void) { unsigned int *p=state; int j; left=N-1; next=state; for(j=N-M+1;--j;p++) *p=p[M]^twist(p[0],p[1]); for(j=M;--j;p++) *p=p[M-N]^twist(p[0],p[1]); *p=p[M-N]^twist(p[0],state[0]); } unsigned int genint(void) { unsigned int y; if(--left<0) next_state(); y=*next++; y^=(y>>shift0); y^=(y<<7)&maskB; y^=(y<<15)&maskC; return (y^(y >> 18)); } double genrand(void) { unsigned int y; if(--left<0) next_state(); y=*next++; y^=(y>>shift0); y^=(y<<7)&maskB; y^=(y<<15)&maskC; return (y^(y >> 18))*(1.0/4294967295.0); } double safe_genrand(void) { unsigned int y; if(--left<0) next_state(); y=*next++; y^=(y>>shift0); y^=(y<<7)&maskB; y^=(y<<15)&maskC; return ((double)(y^(y >> 18))+.5)*(1.0/4294967296.0); } int getseed(const char *fname,const int silent) { int flag=0,i,j,err=0; unsigned int sd; char buf[256],*fname1; FILE *fptr; if(!fname) { if(!silent) (void)fputs("getseed(): NULL filename\n",stderr); return -1; } fname1=add_file_dir(fname); if(!fname1) { if(!silent) (void)fputs("getseed(): Couldn't make filename\n",stderr); return -1; } fptr=fopen(fname1,"r"); if(fptr) { if(fgets(buf,256,fptr)) { free(fname1); flag=sscanf(buf,"mt19937b_seed = %u\n",&sd); if(flag!=1) { if(sscanf(buf,"mt19937b_idx = %d\n",&left)==1) { if(fscanf(fptr,"mt19937b_gen = %d\n",&i)!=1) i=0; j=set_mt_idx(i); if(j==-1) { if(!silent) { (void)fprintf(stderr,"getseed(): Bad random number generator (%d)\n",i); (void)fclose(fptr); set_mt_idx(0); } return -1; } if(j==1) { (void)fprintf(stderr,"getseed(): Warning - changing random number generator to %d\n",i); } if(left>=0 && left<=N) { for(i=0;i0 && gen_idx) err=fprintf(fptr,"mt19937b_gen = %d\n",gen_idx); if(err>0) for(i=0;i * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) static char *rcsid = "$OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include #include #include "getopt.h" int optopt = '?'; /* character checked for validity */ int optreset; /* reset getopt */ char *optarg; /* argument associated with option */ #define PRINT_ERROR ((opterr) && (*options != ':')) #define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */ #define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */ #define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */ /* return values */ #define BADCH (int)'?' #define BADARG ((*options == ':') ? (int)':' : (int)'?') #define INORDER (int)1 #define EMSG "" static int getopt_internal(int, char * const *, const char *, const struct option *, int *, int); static int parse_long_options(char * const *, const char *, const struct option *, int *, int); static int gcd(int, int); static void permute_args(int, int, int, char * const *); static char *place = EMSG; /* option letter processing */ /* XXX: set optreset to 1 rather than these two */ static int nonopt_start = -1; /* first non option argument (for permute) */ static int nonopt_end = -1; /* first option after non options (for permute) */ /* Error messages */ static const char recargchar[] = "option requires an argument -- %c"; static const char recargstring[] = "option requires an argument -- %s"; static const char ambig[] = "ambiguous option -- %.*s"; static const char noarg[] = "option doesn't take an argument -- %.*s"; static const char illoptchar[] = "unknown option -- %c"; static const char illoptstring[] = "unknown option -- %s"; static void warnx(const char *fmt, ...) { va_list ap; va_start(ap, fmt); if(fmt != NULL) (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, "\n"); va_end(ap); } /* * Compute the greatest common divisor of a and b. */ static int gcd(int a, int b) { int c; c = a % b; while (c != 0) { a = b; b = c; c = a % b; } return (b); } /* * Exchange the block from nonopt_start to nonopt_end with the block * from nonopt_end to opt_end (keeping the same order of arguments * in each block). */ static void permute_args(int panonopt_start, int panonopt_end, int opt_end, char * const *nargv) { int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; char *swap; /* * compute lengths of blocks and number and size of cycles */ nnonopts = panonopt_end - panonopt_start; nopts = opt_end - panonopt_end; ncycle = gcd(nnonopts, nopts); cyclelen = (opt_end - panonopt_start) / ncycle; for (i = 0; i < ncycle; i++) { cstart = panonopt_end+i; pos = cstart; for (j = 0; j < cyclelen; j++) { if (pos >= panonopt_end) pos -= nnonopts; else pos += nopts; swap = nargv[pos]; /* LINTED const cast */ ((char **) nargv)[pos] = nargv[cstart]; /* LINTED const cast */ ((char **)nargv)[cstart] = swap; } } } /* * parse_long_options -- * Parse long options in argc/argv argument vector. * Returns -1 if short_too is set and the option does not match long_options. */ static int parse_long_options(char * const *nargv, const char *options, const struct option *long_options, int *idx, int short_too) { char *current_argv, *has_equal; size_t current_argv_len; int i, match; current_argv = place; match = -1; optind++; if ((has_equal = strchr(current_argv, '=')) != NULL) { /* argument found (--option=arg) */ current_argv_len = has_equal - current_argv; has_equal++; } else current_argv_len = strlen(current_argv); for (i = 0; long_options[i].name; i++) { /* find matching long option */ if (strncmp(current_argv, long_options[i].name, current_argv_len)) continue; if (strlen(long_options[i].name) == current_argv_len) { /* exact match */ match = i; break; } /* * If this is a known short option, don't allow * a partial match of a single character. */ if (short_too && current_argv_len == 1) continue; if (match == -1) /* partial match */ match = i; else { /* ambiguous abbreviation */ if (PRINT_ERROR) warnx(ambig, (int)current_argv_len, current_argv); optopt = 0; return (BADCH); } } if (match != -1) { /* option found */ if (long_options[match].has_arg == no_argument && has_equal) { if (PRINT_ERROR) warnx(noarg, (int)current_argv_len, current_argv); /* * XXX: GNU sets optopt to val regardless of flag */ if (long_options[match].flag == NULL) optopt = long_options[match].val; else optopt = 0; return (BADARG); } if (long_options[match].has_arg == required_argument || long_options[match].has_arg == optional_argument) { if (has_equal) optarg = has_equal; else if (long_options[match].has_arg == required_argument) { /* * optional argument doesn't use next nargv */ optarg = nargv[optind++]; } } if ((long_options[match].has_arg == required_argument) && (optarg == NULL)) { /* * Missing argument; leading ':' indicates no error * should be generated. */ if (PRINT_ERROR) warnx(recargstring, current_argv); /* * XXX: GNU sets optopt to val regardless of flag */ if (long_options[match].flag == NULL) optopt = long_options[match].val; else optopt = 0; --optind; return (BADARG); } } else { /* unknown option */ if (short_too) { --optind; return (-1); } if (PRINT_ERROR) warnx(illoptstring, current_argv); optopt = 0; return (BADCH); } if (idx) *idx = match; if (long_options[match].flag) { *long_options[match].flag = long_options[match].val; return (0); } else return (long_options[match].val); } /* * getopt_internal -- * Parse argc/argv argument vector. Called by user level routines. */ static int getopt_internal(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx, int flags) { char *oli; /* option letter list index */ int optchar, short_too; static int posixly_correct = -1; if (options == NULL) return (-1); /* * Disable GNU extensions if POSIXLY_CORRECT is set or options * string begins with a '+'. */ if (posixly_correct == -1) posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); if (posixly_correct || *options == '+') flags &= ~FLAG_PERMUTE; else if (*options == '-') flags |= FLAG_ALLARGS; if (*options == '+' || *options == '-') options++; /* * XXX Some GNU programs (like cvs) set optind to 0 instead of * XXX using optreset. Work around this braindamage. */ if (optind == 0) optind = optreset = 1; optarg = NULL; if (optreset) nonopt_start = nonopt_end = -1; start: if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= nargc) { /* end of argument vector */ place = EMSG; if (nonopt_end != -1) { /* do permutation, if we have to */ permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } else if (nonopt_start != -1) { /* * If we skipped non-options, set optind * to the first of them. */ optind = nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } if (*(place = nargv[optind]) != '-' || (place[1] == '\0' && strchr(options, '-') == NULL)) { place = EMSG; /* found non-option */ if (flags & FLAG_ALLARGS) { /* * GNU extension: * return non-option as argument to option 1 */ optarg = nargv[optind++]; return (INORDER); } if (!(flags & FLAG_PERMUTE)) { /* * If no permutation wanted, stop parsing * at first non-option. */ return (-1); } /* do permutation */ if (nonopt_start == -1) nonopt_start = optind; else if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); nonopt_start = optind - (nonopt_end - nonopt_start); nonopt_end = -1; } optind++; /* process next argument */ goto start; } if (nonopt_start != -1 && nonopt_end == -1) nonopt_end = optind; /* * Check for "--" or "--foo" with no long options * but if place is simply "-" leave it unmolested. */ if (place[1] != '\0' && *++place == '-' && (place[1] == '\0' || long_options == NULL)) { optind++; place = EMSG; /* * We found an option (--), so if we skipped * non-options, we have to permute. */ if (nonopt_end != -1) { permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; } nonopt_start = nonopt_end = -1; return (-1); } } /* * Check long options if: * 1) we were passed some * 2) the arg is not just "-" * 3) either the arg starts with -- we are getopt_long_only() */ if (long_options != NULL && place != nargv[optind] && (*place == '-' || (flags & FLAG_LONGONLY))) { short_too = 0; if (*place == '-') place++; /* --foo long option */ else if (*place != ':' && strchr(options, *place) != NULL) short_too = 1; /* could be short option too */ optchar = parse_long_options(nargv, options, long_options, idx, short_too); if (optchar != -1) { place = EMSG; return (optchar); } } if ((optchar = (int)*place++) == (int)':' || (oli = strchr(options, optchar)) == NULL) { /* * If the user didn't specify '-' as an option, * assume it means -1 as POSIX specifies. */ if (optchar == (int)'-') return (-1); /* option letter unknown or ':' */ if (!*place) ++optind; if (PRINT_ERROR) warnx(illoptchar, optchar); optopt = optchar; return (BADCH); } if (long_options != NULL && optchar == 'W' && oli[1] == ';') { /* -W long-option */ if (*place) /* no space */ /* NOTHING */; else if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) warnx(recargchar, optchar); optopt = optchar; return (BADARG); } else /* white space */ place = nargv[optind]; optchar = parse_long_options(nargv, options, long_options, idx, 0); place = EMSG; return (optchar); } if (*++oli != ':') { /* doesn't take argument */ if (!*place) ++optind; } else { /* takes (optional) argument */ optarg = NULL; if (*place) /* no white space */ optarg = place; /* XXX: disable test for :: if PC? (GNU doesn't) */ else if (oli[1] != ':') { /* arg not optional */ if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR) warnx(recargchar, optchar); optopt = optchar; return (BADARG); } else optarg = nargv[optind]; } place = EMSG; ++optind; } /* dump back option letter */ return (optchar); } #ifdef REPLACE_GETOPT /* * getopt -- * Parse argc/argv argument vector. * * [eventually this will replace the BSD getopt] */ int getopt(int nargc, char * const *nargv, const char *options) { /* * We dont' pass FLAG_PERMUTE to getopt_internal() since * the BSD getopt(3) (unlike GNU) has never done this. * * Furthermore, since many privileged programs call getopt() * before dropping privileges it makes sense to keep things * as simple (and bug-free) as possible. */ return (getopt_internal(nargc, nargv, options, NULL, NULL, 0)); } #endif /* REPLACE_GETOPT */ /* * getopt_long -- * Parse argc/argv argument vector. */ int getopt_long(nargc, nargv, options, long_options, idx) int nargc; char * const *nargv; const char *options; const struct option *long_options; int *idx; { return (getopt_internal(nargc, nargv, options, long_options, idx, FLAG_PERMUTE)); } /* * getopt_long_only -- * Parse argc/argv argument vector. */ int getopt_long_only(nargc, nargv, options, long_options, idx) int nargc; char * const *nargv; const char *options; const struct option *long_options; int *idx; { return (getopt_internal(nargc, nargv, options, long_options, idx, FLAG_PERMUTE|FLAG_LONGONLY)); } loki/libsrc/io_stuff.c0100644000076500007650000001055107646742770014260 0ustar heathheath#include #include #include #if HAVE_UNISTD_H #include #endif #include #include #if HAVE_FCNTL_H #include #endif #include "libhdr.h" #define STDIN 0 #define STDOUT 1 #define READ 0 #define WRITE 1 static pid_t childpid = 0; static void dupto (const int from,const int to,const char *msg) { int err; if(from!=to) { if(errno) perror("aa:"); err=close(to); if (err<0 && errno != EBADF) { perror("dupto(): Cannot close file descriptor"); exit(EXIT_FAILURE); } if(errno) perror("AA:"); err=dup(from); if(errno) perror("BB:"); if (err!=to) { (void)fprintf(stderr,"dupto(): Cannot dup %s\n",msg); exit(EXIT_FAILURE); } if(close(from)<0) { (void)fprintf(stderr,"dupto(): cannot close file descriptor\n"); exit(EXIT_FAILURE); } if(errno) perror("CC:"); } } int child_open1(const int read_flag,const char *fname,const char *filterprog,const char *arg) { int ppipe[2]={-1,-1},fd= -1,fd1; struct stat sbuf; if(!fname) return fd; if(read_flag==READ) if(stat(fname,&sbuf)) return fd; if(pipe(ppipe)<0) { (void)fprintf(stderr,"child_open(): Can't open pipe\n"); return fd; } childpid=fork(); if(childpid<0) { (void)fprintf(stderr, "child_open(): cannot fork\n"); return fd; } if(childpid>0) { if(read_flag==READ) { fd=ppipe[READ]; if(close(ppipe[WRITE])<0) { (void)fprintf(stderr, "child_open(): cannot close pipe\n"); exit(EXIT_FAILURE); } } else { fd=ppipe[WRITE]; if(close(ppipe[READ])<0) { (void)fprintf(stderr, "child_open(): cannot close pipe\n"); exit(EXIT_FAILURE); } } } else { if(read_flag==READ) { dupto(ppipe[WRITE], STDOUT,"(child) pipr to stdout"); if(close(ppipe[READ])<0) { (void)fprintf(stderr, "child_open(): cannot close pipe\n"); exit(EXIT_FAILURE); } if(fname) { fd1=open(fname,O_RDONLY,0666); if(fd1<0) { (void)fprintf(stderr, "child_open(): cannot open file %s\n",fname); exit(EXIT_FAILURE); } dupto(fd1,STDIN,"file to stdin"); } } else { dupto (ppipe[READ], STDIN, "(child) pipe to stdin"); if(close(ppipe[WRITE])<0) { (void)fprintf(stderr, "child_open(): cannot close pipe\n"); exit(EXIT_FAILURE); } if(fname) { fd1=creat(fname,0666); if(fd1<0) { (void)fprintf(stderr, "child_open(): cannot open file %s\n",fname); exit(EXIT_FAILURE); } dupto(fd1,STDOUT,"file to stdout"); } } if(read_flag==READ) (void)execlp(filterprog,filterprog,arg,(char *)0); else (void)execlp(filterprog,filterprog,arg,(char *) 0); (void)fprintf(stderr, "child_open(): cannot exec %s\n",filterprog); _exit(EXIT_FAILURE); } return fd; } int child_open(const int read_flag,const char *fname,const char *filterprog) { int fd; if(read_flag==READ) fd=child_open1(read_flag,fname,filterprog,"-d"); else fd=child_open1(read_flag,fname,filterprog,0); return fd; } #if !HAVE_POPEN FILE *popen(const char *command,const char *type) { int ppipe[2]={-1,-1},read_flag,fd; FILE *fptr=0; if(!command) return fptr; if(!strcmp("r",type)) read_flag=READ; else if(!strcmp("w",type)) read_flag=WRITE; else return fptr; if(pipe(ppipe)<0) { (void)fprintf(stderr,"lk_popen(): Can't open pipe\n"); return fptr; } childpid=fork(); if(childpid<0) { (void)fprintf(stderr, "lk_popen(): cannot fork\n"); return fptr; } if(childpid>0) { if (read_flag==READ) { fd = ppipe[READ]; if(close(ppipe[WRITE])<0) { (void)fprintf(stderr, "lk_popen(): cannot close pipe\n"); exit(EXIT_FAILURE); } } else { fd = ppipe[WRITE]; if(close(ppipe[READ])<0) { (void)fprintf(stderr, "lk_popen(): cannot close pipe\n"); exit(EXIT_FAILURE); } } fptr=fdopen(fd,type); if(!fptr) { (void)fprintf(stderr, "lk_popen(): fdopen() failed\n"); exit(EXIT_FAILURE); } } else { if(read_flag==READ) { dupto (ppipe[WRITE], STDOUT, "(child) pipe to stdout"); if(close(ppipe[READ])<0) { (void)fprintf(stderr, "lk_popen(): cannot close pipe\n"); exit(EXIT_FAILURE); } } else { dupto (ppipe[READ], STDIN, "(child) pipe to stdin"); if(close(ppipe[WRITE])<0) { (void)fprintf(stderr, "lk_popen(): cannot close pipe\n"); exit(EXIT_FAILURE); } } (int)execl("/bin/sh","sh","-c",command,(char *)0); (void)fprintf(stderr, "lk_popen(): cannot exec %s\n",command); _exit(EXIT_FAILURE); } return fptr; } #endif loki/libsrc/Makefile.in0100644000076500007650000000137607646743323014343 0ustar heathheathSHELL = /bin/sh CC = @CC@ MY_CFLAGS = @CFLAGS@ @extra_cflags@ RANLIB = @RANLIB@ AR = @AR@ INCLUDES = -I../include/ #DMALLOC_INC = @DMALLOC_INC@ #DMALLOC_FLAGS = @DMALLOC_FLAGS@ CFLAGS = $(MY_CFLAGS) $(INCLUDES) $(DMALLOC_FLAGS) LIB_SRC = io_stuff.c ranlib.c genrand.c ran_xtra.c mkbackup.c strsep.c \ utils.c remember.c peel_utils.c qsort.c min_deg.c bin_tree.c getopt_long.c LIB_OBJ = ${LIB_SRC:.c=.o} all: libgen.a libgen.a: $(LIB_OBJ) ../include/config.h $(AR) cr $@ $(LIB_OBJ) $(RANLIB) $@ clean: rm -f *~ *.o *.a *.bak a.out core seedfile depend distclean: clean rm -f Makefile install: depend: $(LIB_SRC) @MAKEDEPEND@ $(INCLUDES) $(DMALLOC_FLAGS) $(DMALLOC_INC) $(LIB_SRC) touch depend # DO NOT DELETE THIS LINE -- make depend depends on it. loki/libsrc/min_deg.c0100644000076500007650000003311307747747264014050 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * July 1997 * * * * min_deg.c * * * * Produce a min-degree ordering for factoring of a sparse matrix * * components on a marker by marker basis. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki_struct.h" #include "min_deg.h" #define BSIZE 1024 static struct mat_elem *free_node_list,**mat; static struct remember *MinDegBlock,*FirstRemBlock; static double *score; static int *degree,*fill_in; static int calc_degree(int i,int *inv,int *flag,int *nn,struct deg_list *dlist,int fg) { int j,k,x,x1,n=0,n1; struct mat_elem *p,*p1; struct deg_list *deg,*deg1; p=mat[i]; if(p) { inv[n++]=i; while(p) { inv[n++]=p->x; p=p->next; } for(j=1;jx; if(k==n) { if(x1==i) p1=p1->next; break; } if(inv[k]==x) k++; if(x1!=i && x1!=inv[k++]) break; p1=p1->next; if(!p1 && kabs_list) deg1=deg1->abs_list; deg1->abs_list=dlist[i].abs_list; dlist[i].abs_list=deg; } } } n1=0; for(k=(fg&1)?0:1;kabs_list; } } } *nn=n; return n1;; } static double calc_score(int i,double *wt,struct pair_wt *wt1,int *inv,int *inv1,int *flag,int *nn,double *sc,struct deg_list *alist) { int j,k,k1,k2,k3,x,x1,n=0,n1; struct mat_elem *p,*p1; struct deg_list *deg,*deg1; double w=0.0; p=mat[i]; if(p) { inv[n++]=i; while(p) { inv[n++]=p->x; p=p->next; } for(j=1;jx; if(k==n) { if(x1==i) p1=p1->next; break; } if(inv[k]==x) k++; if(x1!=i && x1!=inv[k++]) break; p1=p1->next; if(!p1 && kabs_list) deg1=deg1->abs_list; deg1->abs_list=alist[i].abs_list; alist[i].abs_list=deg; } } } n1=0; w=wt[i]; deg=alist[i].abs_list; while(deg) { w+=wt[deg->node]; deg=deg->abs_list; } for(k=1;knode; deg=deg->abs_list; } } } w=0.0; for(k=0;k=0) { for(k3=0;k3last) p->last->next=p->next; else first[deg]=p->next; if(p->next) p->next->last=p->last; } static void add_nd(struct deg_list *p,struct deg_list **first,int deg) { p->next=first[deg]; if(p->next) p->next->last=p; p->last=0; first[deg]=p; } static void delete_node(int x,int y) { struct mat_elem **p,*p1; p=mat+y; while(*p) { if((*p)->x==x) break; p=&(*p)->next; } if(*p) { p1=*p; *p=p1->next; p1->next=free_node_list; free_node_list=p1; } } static void delete_row_col(int y) { struct mat_elem *p,*p1; p=p1=mat[y]; while(p) { delete_node(y,p->x); p1=p; p=p->next; } if(p1) { p1->next=free_node_list; free_node_list=mat[y]; } mat[y]=0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_new_nodes" static struct mat_elem *alloc_new_nodes(int n) { struct mat_elem *p; int i; #ifdef DEBUG if(!n) ABT_FUNC("Internal error - called with zero argument\n"); #endif if(!(p=malloc(sizeof(struct mat_elem)*n))) ABT_FUNC(MMsg); MinDegBlock=AddRemem(p,MinDegBlock); /* Link blocks together */ for(i=0;inext; return p; } static void add_node(int x,int y) { struct mat_elem **p,*p1; p=mat+y; while(*p) { if((*p)->x>=x) break; p=&(*p)->next; } p1=*p; if(!p1 || p1->x!=x) { *p=new_node(); (*p)->next=p1; (*p)->x=x; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "min_deg" int *min_deg(int n,int *mm,int *order,int *group,int fg) { int i,j,k,k1,k2,k3,k4,k5,n_nodes; int *deg,*flag,*inv,*inv1,ct=0; struct deg_list *dlist,**first,*nd,*nd1,*nd2,*pp; struct mat_elem *p; if(n<1 || !mm) { if(FirstRemBlock) { FreeRemem(FirstRemBlock); FirstRemBlock=0; } return 0; } if(!FirstRemBlock) { if(!(FirstRemBlock=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); MinDegBlock=FirstRemBlock; MinDegBlock->pos=0; MinDegBlock->next=0; free_node_list=0; } if(!(mat=malloc(sizeof(void *)*n))) return 0; for(i=0;i=0;i--) if(!flag[i]) { k=deg[i]; add_nd(dlist+i,first,k); n_nodes++; } while(n_nodes) { for(i=0;iabs_list; k2=0; while(nd2) { k2++; nd2=nd2->abs_list; } nd1=nd->next; while(nd1) { k3=0; nd2=nd1->abs_list; while(nd2) { k3++; nd2=nd2->abs_list; } if(((fg&2)?k3-k2:k2-k3)>0) { nd=nd1; k2=k3; } nd1=nd1->next; } j=nd->node; #ifdef DEBUG if(flag[j]) ABT_FUNC("Internal error - flagged node picked\n"); #endif flag[j]=1; n_nodes--; if(group) group[ct]=1; order[ct++]=j; pp=nd->abs_list; if(pp) { while(pp) { k=pp->node; flag[k]=1; if(group) group[ct]=0; order[ct++]=k; pp=pp->abs_list; } } p=mat[j]; k=0; while(p) { k1=p->x; #ifdef DEBUG if(flag[k1]) ABT_FUNC("Internal error\n"); #endif inv[k++]=k1; p=p->next; } delete_row_col(j); delete_nd(nd,first,i); for(k1=1;k1x2) return 1; i1=degree[*((const int *)s1)]; i2=degree[*((const int *)s2)]; if(i1i2) return 1; i1=fill_in[*((const int *)s1)]; i2=fill_in[*((const int *)s2)]; if(i1i2) return -1; return 0; } static int cmp_scores_1(const void *s1,const void *s2) { double x1,x2; int i1,i2; i1=degree[*((const int *)s1)]; i2=degree[*((const int *)s2)]; if(i1i2) return 1; x1=score[*((const int *)s1)]; x2=score[*((const int *)s2)]; if(x1x2) return 1; i1=fill_in[*((const int *)s1)]; i2=fill_in[*((const int *)s2)]; if(i1i2) return -1; return 0; } static int cmp_scores_2(const void *s1,const void *s2) { double x1,x2; int i1,i2; i1=degree[*((const int *)s1)]; i2=degree[*((const int *)s2)]; if(i1i2) return 1; i1=fill_in[*((const int *)s1)]; i2=fill_in[*((const int *)s2)]; if(i1i2) return -1; x1=score[*((const int *)s1)]; x2=score[*((const int *)s2)]; if(x1x2) return 1; return 0; } static int cmp_scores_3(const void *s1,const void *s2) { double x1,x2; int i1,i2; i1=degree[*((const int *)s1)]; i2=degree[*((const int *)s2)]; if(i1i2) return 1; i1=fill_in[*((const int *)s1)]; i2=fill_in[*((const int *)s2)]; if(i1i2) return -1; x1=score[*((const int *)s1)]; x2=score[*((const int *)s2)]; if(x1x2) return -1; return 0; } static int check_fill_in(int *inv,int *inv1,int *flag,int j,struct deg_list *alist) { int k,k1,k2,k3,fill=0; struct mat_elem *p; struct deg_list *deg; for(k3=0,k=1;knode; deg=deg->abs_list; } } } for(k=0;kx==inv1[k1]) break; if(k1==k3) fill++; p=p->next; } } return fill; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "greedy" int *greedy(int n,int *mm,int *order,int *group,double *wt,struct pair_wt *wt1,int fg,double *cost) { int i,j,k,k1,k2,k3,k4,k5,n_nodes; int *flag,*inv,*inv1,*inv2,*perm,ct=0; struct mat_elem *p; struct deg_list *alist,*deg; int (*cmp_func[])(const void *,const void *)={cmp_scores_0,cmp_scores_1,cmp_scores_2,cmp_scores_3}; double z; if(n<1 || !mm) { if(FirstRemBlock) { FreeRemem(FirstRemBlock); FirstRemBlock=0; } return 0; } *cost=0; if(!FirstRemBlock) { if(!(FirstRemBlock=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); MinDegBlock=FirstRemBlock; MinDegBlock->pos=0; MinDegBlock->next=0; free_node_list=0; } if(!(mat=malloc(sizeof(void *)*n))) return 0; for(i=0;inode; if(group) group[ct]=0; order[ct++]=k; inv1[k1++]=k; deg=deg->abs_list; } p=mat[j]; k=0; while(p) { inv[k++]=p->x; inv1[k1++]=p->x; deg=alist[p->x].abs_list; while(deg) { inv1[k1++]=deg->node; deg=deg->abs_list; } p=p->next; } z=0.0; for(k2=0;k2=0) { for(k5=0;k5=0.0) for(k1=1;k1 #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include #include "libhdr.h" struct bkfile { char *name; int num; }; static int cmp_func(const void *s1,const void *s2) { int i,j,k; i=((struct bkfile *)s1)->num; j=((struct bkfile *)s2)->num; if(ij) k=-1; else k=0; return k; } int mkbackup(const char *fname,int nback) { int i=0,j,k,k1,k2; char *buf,*p,*p1; struct stat sbuf; struct bkfile *bkfiles; glob_t globbuf; if(!fname) { (void)fprintf(stderr,"mkbackup(): NULL filename\n"); return -1; } if(nback<1) { (void)fprintf(stderr,"mkbackup(): invalid backup number\n"); return -1; } if(nback==1) { if(!stat(fname,&sbuf)) { i=1; j=(int)strlen(fname); buf=(char *)malloc((size_t)j+2); if(buf) { (void)strcpy(buf,fname); buf[j]='~'; buf[j+1]='\0'; i=rename(fname,buf); free(buf); } if(i) (void)fprintf(stderr,"mkbackup(): Couldn't rename old seedfile\n"); } } else { j=(int)strlen(fname); buf=malloc((size_t)j+2); i=1; if(buf) { (void)strcpy(buf,fname); buf[j]='*'; buf[j+1]='\0'; globbuf.gl_offs=2; (void)glob(buf,0,NULL,&globbuf); free(buf); if(globbuf.gl_pathc) { bkfiles=malloc(sizeof(struct bkfile)*globbuf.gl_pathc); if(bkfiles) { for(k=k1=0;k<(int)globbuf.gl_pathc;k++) { p=globbuf.gl_pathv[k]; if(p[j]=='~') { k2=(int)strtol(p+j+1,&p1,10); if(k2>0 && k2 #include #ifdef USE_DMALLOC #include #endif #include #include "shared_peel.h" int num_bits(const int n_all) { int nb; nb=(int)(0.99999+log((double)n_all)/log(2.0)); return nb; } void free_peelseq(struct Peelseq_Head *pp) { struct Simple_Element *simple_em; struct Fenris_Simple_Element *fsimple_em; struct Complex_Element *complex_em; void *old_ptr=0; while(pp->type) { switch(pp->type) { case PEEL_SIMPLE: simple_em=pp->ptr.simple; if(old_ptr) free(old_ptr); pp= &simple_em->next; if(simple_em->off) free(simple_em->off); old_ptr=(void *)simple_em; break; case FENRIS_PEEL_SIMPLE: fsimple_em=pp->ptr.fsimple; if(old_ptr) free(old_ptr); pp= &fsimple_em->next; if(fsimple_em->off) free(fsimple_em->off); old_ptr=(void *)fsimple_em; break; case PEEL_COMPLEX: complex_em=pp->ptr.complex; if(old_ptr) free(old_ptr); pp= &complex_em->next; free(complex_em->involved); old_ptr=(void *)complex_em; break; } } if(old_ptr) free(old_ptr); } loki/libsrc/qsort.c0100644000076500007650000002012207646742770013605 0ustar heathheath/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Douglas C. Schmidt (schmidt@ics.uci.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifdef HAVE_ALLOCA_H #include #endif extern void gnu_qsort(void *const,size_t,size_t,int(*)(const void *,const void *)); /* Byte-wise swap two items of size SIZE. */ #define SWAP(a, b, size) \ do \ { \ register size_t __size = (size); \ register char *__a = (a), *__b = (b); \ do \ { \ char __tmp = *__a; \ *__a++ = *__b; \ *__b++ = __tmp; \ } while (--__size != 0); \ } while (0) /* Discontinue quicksort algorithm when partition gets below this size. This particular magic number was chosen to work best on a Sun 4/260. */ #define MAX_THRESH 4 /* Stack node declarations used to store unfulfilled partition obligations. */ typedef struct { char *lo; char *hi; } stack_node; /* The next 4 #defines implement a very fast in-line stack abstraction. */ #define STACK_SIZE (8 * sizeof(unsigned long int)) #define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top)) #define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi))) #define STACK_NOT_EMPTY (stack < top) /* Order size using quicksort. This implementation incorporates four optimizations discussed in Sedgewick: 1. Non-recursive, using an explicit stack of pointer that store the next array partition to sort. To save time, this maximum amount of space required to store an array of MAX_INT is allocated on the stack. Assuming a 32-bit integer, this needs only 32 * sizeof(stack_node) == 136 bits. Pretty cheap, actually. 2. Chose the pivot element using a median-of-three decision tree. This reduces the probability of selecting a bad pivot value and eliminates certain extraneous comparisons. 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving insertion sort to order the MAX_THRESH items within each partition. This is a big win, since insertion sort is faster for small, mostly sorted array segments. 4. The larger of the two sub-partitions is always pushed onto the stack first, with the algorithm then concentrating on the smaller partition. This *guarantees* no more than log (n) stack size is needed (actually O(1) in this case)! */ void gnu_qsort (void *const pbase, size_t total_elems, size_t size, int (*cmp)(const void *,const void *)) { register char *base_ptr = (char *) pbase; /* Allocating SIZE bytes for a pivot buffer facilitates a better algorithm below since we can do comparisons directly on the pivot. */ char *pivot_buffer = (char *) alloca (size); const size_t max_thresh = MAX_THRESH * size; if (total_elems == 0) /* Avoid lossage with unsigned arithmetic below. */ return; if (total_elems > MAX_THRESH) { char *lo = base_ptr; char *hi = &lo[size * (total_elems - 1)]; /* Largest size needed for 32-bit int!!! */ stack_node stack[STACK_SIZE]; stack_node *top = stack + 1; while (STACK_NOT_EMPTY) { char *left_ptr; char *right_ptr; char *pivot = pivot_buffer; /* Select median value from among LO, MID, and HI. Rearrange LO and HI so the three values are sorted. This lowers the probability of picking a pathological pivot value and skips a comparison for both the LEFT_PTR and RIGHT_PTR. */ char *mid = lo + size * ((hi - lo) / size >> 1); if ((*cmp) ((void *) mid, (void *) lo) < 0) SWAP (mid, lo, size); if ((*cmp) ((void *) hi, (void *) mid) < 0) SWAP (mid, hi, size); else goto jump_over; if ((*cmp) ((void *) mid, (void *) lo) < 0) SWAP (mid, lo, size); jump_over:; (void)memcpy (pivot, mid, size); pivot = pivot_buffer; left_ptr = lo + size; right_ptr = hi - size; /* Here's the famous ``collapse the walls'' section of quicksort. Gotta like those tight inner loops! They are the main reason that this algorithm runs much faster than others. */ do { while ((*cmp) ((void *) left_ptr, (void *) pivot) < 0) left_ptr += size; while ((*cmp) ((void *) pivot, (void *) right_ptr) < 0) right_ptr -= size; if (left_ptr < right_ptr) { SWAP (left_ptr, right_ptr, size); left_ptr += size; right_ptr -= size; } else if (left_ptr == right_ptr) { left_ptr += size; right_ptr -= size; break; } } while (left_ptr <= right_ptr); /* Set up pointers for next iteration. First determine whether left and right partitions are below the threshold size. If so, ignore one or both. Otherwise, push the larger partition's bounds on the stack and continue sorting the smaller one. */ if ((size_t) (right_ptr - lo) <= max_thresh) { if ((size_t) (hi - left_ptr) <= max_thresh) /* Ignore both small partitions. */ POP (lo, hi); else /* Ignore small left partition. */ lo = left_ptr; } else if ((size_t) (hi - left_ptr) <= max_thresh) /* Ignore small right partition. */ hi = right_ptr; else if ((right_ptr - lo) > (hi - left_ptr)) { /* Push larger left partition indices. */ PUSH (lo, right_ptr); lo = left_ptr; } else { /* Push larger right partition indices. */ PUSH (left_ptr, hi); hi = right_ptr; } } } /* Once the BASE_PTR array is partially sorted by quicksort the rest is completely sorted using insertion sort, since this is efficient for partitions below MAX_THRESH size. BASE_PTR points to the beginning of the array to sort, and END_PTR points at the very last element in the array (*not* one beyond it!). */ #define min(x, y) ((x) < (y) ? (x) : (y)) { char *const end_ptr = &base_ptr[size * (total_elems - 1)]; char *tmp_ptr = base_ptr; char *thresh = min(end_ptr, base_ptr + max_thresh); register char *run_ptr; /* Find smallest element in first threshold and place it at the array's beginning. This is the smallest array element, and the operation speeds up insertion sort's inner loop. */ for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size) if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0) tmp_ptr = run_ptr; if (tmp_ptr != base_ptr) SWAP (tmp_ptr, base_ptr, size); /* Insertion sort, running from left-hand-side up to right-hand-side. */ run_ptr = base_ptr + size; while ((run_ptr += size) <= end_ptr) { tmp_ptr = run_ptr - size; while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0) tmp_ptr -= size; tmp_ptr += size; if (tmp_ptr != run_ptr) { char *trav; trav = run_ptr + size; while (--trav >= run_ptr) { char c = *trav; char *hi, *lo; for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo) *hi = *lo; *hi = c; } } } } } loki/libsrc/ran_xtra.c0100644000076500007650000000230107646742770014252 0ustar heathheath#include #include #include #include "ranlib.h" #define A0 2.50662823884 #define A1 -18.61500062529 #define A2 41.39119773534 #define A3 -25.44106049637 #define B1 -8.47351093090 #define B2 23.08336743743 #define B3 -21.06224101826 #define B4 3.13082909833 #define C0 -2.78718931138 #define C1 -2.29796479134 #define C2 4.85014127135 #define C3 2.32121276858 #define D1 3.54388924762 #define D2 1.63706781897 #define SPLIT 0.42 double ppnd(double p,int *fault) { double q,r; *fault=0; q=p-0.5; if(fabs(q)0.0)?1.0-p:p; if(r<=0.0) { *fault=1; return 0.0; } r=sqrt(-log(r)); p=(((C3*r+C2)*r+C1)*r+C0)/((D2*r+D1)*r+1.0); return (q<0.0)?-p:p; } #undef A0 #undef A1 #undef A2 #undef A3 #undef B1 #undef B2 #undef B3 #undef B4 #undef C0 #undef C1 #undef C2 #undef C3 #undef D1 #undef D2 #undef SPLIT double trunc_normal(const double a,const double b,const int flag,int *err) { double u,t,t1,p; u=(double)ranf(); t=flag==1?0.0:.5*(1.0+erf(a/sqrt(2.0))); t1=flag==2?1.0:.5*(1.0+erf(b/sqrt(2.0))); p=ppnd(t+u*(t1-t),err); return p; } loki/libsrc/ranlib.c0100644000076500007650000016076407646775775013740 0ustar heathheath#include #include #include #include #include #include "ranlib.h" #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define min(a,b) ((a) <= (b) ? (a) : (b)) #define max(a,b) ((a) >= (b) ? (a) : (b)) /************************************************************************ FTNSTOP: Prints msg to standard error and then exits * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ************************************************************************/ static void ftnstop(char* msg) { if (msg != NULL) (void)fprintf(stderr,"%s\n",msg); exit(EXIT_SUCCESS); } static double fsign( const double num, const double sign) { return ((sign>DBL_EPSILON && numDBL_EPSILON))?-num:num; } double genbet(const double aa,const double bb) /********************************************************************** double genbet(double aa,double bb) GeNerate BETa random deviate Function Returns a single random deviate from the beta distribution with parameters A and B. The density of the beta is x^(a-1) * (1-x)^(b-1) / B(a,b) for 0 < x < 1 Arguments aa --> First parameter of the beta distribution bb --> Second parameter of the beta distribution Method R. C. H. Cheng Generating Beta Variatew with Nonintegral Shape Parameters Communications of the ACM, 21:317-322 (1978) (Algorithms BB and BC) ********************************************************************** */ { /* JJV changed expmax (log(1.0E38)==87.49823), and added minlog */ #define expmax 87.49823 #define infnty 1.0E38 #define minlog 1.0E-37 static double olda = -1.0E37; static double oldb = -1.0E37; static double genbet,a,alpha,b,beta,delta,gamma,k1,k2,r,s,t,u1,u2,v,w,y,z; static int qsame; qsame = fabs(olda-aa) 1.0)) goto S100; /* Alborithm BB Initialize */ if(qsame) goto S30; a = min(aa,bb); b = max(aa,bb); alpha = a+b; beta = sqrt((alpha-2.0)/(2.0*a*b-alpha)); gamma = a+1.0/beta; S30: S40: u1 = safe_ranf(); /* Step 1 */ u2 = safe_ranf(); v = beta*log(u1/(1.0-u1)); /* JJV altered this */ if(v > expmax) goto S55; /* * JJV added checker to see if a*exp(v) will overflow * JJV S50 _was_ w = a*exp(v); also note here a > 1.0 */ w = exp(v); if(w > infnty/a) goto S55; w *= a; goto S60; S55: w = infnty; S60: z = pow(u1,2.0)*u2; r = gamma*v-1.3862944; s = a+r-w; /* Step 2 */ if(s+2.609438 >= 5.0*z) goto S70; /* Step 3 */ t = log(z); if(s > t) goto S70; /* * Step 4 * * JJV added checker to see if log(alpha/(b+w)) will * JJV overflow. If so, we count the log as -INF, and * JJV consequently evaluate conditional as true, i.e. * JJV the algorithm rejects the trial and starts over * JJV May not need this here since alpha > 2.0 */ if(alpha/(b+w) < minlog) goto S40; if(r+alpha*log(alpha/(b+w)) < t) goto S40; S70: /* Step 5 */ if(!(aa == a)) goto S80; genbet = w/(b+w); goto S90; S80: genbet = b/(b+w); S90: goto S230; S100: /* Algorithm BC Initialize */ if(qsame) goto S110; a = max(aa,bb); b = min(aa,bb); alpha = a+b; beta = 1.0/b; delta = 1.0+a-b; k1 = delta*(1.38889E-2+4.16667E-2*b)/(a*beta-0.777778); k2 = 0.25+(0.5+0.25/delta)*b; S110: S120: u1 = safe_ranf(); /* Step 1 */ u2 = safe_ranf(); if(u1 >= 0.5) goto S130; /* Step 2 */ y = u1*u2; z = u1*y; if(0.25*u2+z-y >= k1) goto S120; goto S170; S130: /* Step 3 */ z = pow(u1,2.0)*u2; if(!(z <= 0.25)) goto S160; v = beta*log(u1/(1.0-u1)); /* * JJV instead of checking v > expmax at top, I will check * JJV if a < 1, then check the appropriate values */ if(a > 1.0) goto S135; /* JJV a < 1 so it can help out if exp(v) would overflow */ if(v > expmax) goto S132; w = a*exp(v); goto S200; S132: w = v + log(a); if(w > expmax) goto S140; w = exp(w); goto S200; S135: /* JJV in this case a > 1 */ if(v > expmax) goto S140; w = exp(v); if(w > infnty/a) goto S140; w *= a; goto S200; S140: w = infnty; goto S200; /* * JJV old code * if(!(v > expmax)) goto S140; * w = infnty; * goto S150; *S140: * w = a*exp(v); *S150: * goto S200; */ S160: if(z >= k2) goto S120; S170: /* Step 4 Step 5 */ v = beta*log(u1/(1.0-u1)); /* JJV same kind of checking as above */ if(a > 1.0) goto S175; /* JJV a < 1 so it can help out if exp(v) would overflow */ if(v > expmax) goto S172; w = a*exp(v); goto S190; S172: w = v + log(a); if(w > expmax) goto S180; w = exp(w); goto S190; S175: /* JJV in this case a > 1.0 */ if(v > expmax) goto S180; w = exp(v); if(w > infnty/a) goto S180; w *= a; goto S190; S180: w = infnty; /* * JJV old code * if(!(v > expmax)) goto S180; * w = infnty; * goto S190; *S180: * w = a*exp(v); */ S190: /* * JJV here we also check to see if log overlows; if so, we treat it * JJV as -INF, which means condition is true, i.e. restart */ if(alpha/(b+w) < minlog) goto S120; if(alpha*(log(alpha/(b+w))+v)-1.3862944 < log(z)) goto S120; S200: /* Step 6 */ if(!(a == aa)) goto S210; genbet = w/(b+w); goto S220; S210: genbet = b/(b+w); S230: S220: return genbet; #undef expmax #undef infnty #undef minlog } double genchi(const double df) /********************************************************************** double genchi(double df) Generate random value of CHIsquare variable Function Generates random deviate from the distribution of a chisquare with DF degrees of freedom random variable. Arguments df --> Degrees of freedom of the chisquare (Must be positive) Method Uses relation between chisquare and gamma. ********************************************************************** */ { static double genchi; if(!(df <= 0.0)) goto S10; (void)fputs(" DF <= 0 in GENCHI - ABORT\n",stderr); (void)fprintf(stderr," Value of DF: %16.6E\n",df); exit(EXIT_FAILURE); S10: /* * JJV changed the code to call SGAMMA directly * genchi = 2.0*gengam(1.0,df/2.0); <- OLD */ genchi = 2.0*sgamma(df/2.0); return genchi; } double genexp(double const av) /* ********************************************************************** double genexp(double av) GENerate EXPonential random deviate Function Generates a single random deviate from an exponential distribution with mean AV. Arguments av --> The mean of the exponential distribution from which a random deviate is to be generated. JJV (av >= 0) Method Renames SEXPO from TOMS as slightly modified by BWB to use RANF instead of SUNIF. For details see: Ahrens, J.H. and Dieter, U. Computer Methods for Sampling From the Exponential and Normal Distributions. Comm. ACM, 15,10 (Oct. 1972), 873 - 882. ********************************************************************** */ { static double genexp; /* JJV added check that av >= 0 */ if(av >= 0.0) goto S10; (void)fputs(" AV < 0 in GENEXP - ABORT\n",stderr); (void)fprintf(stderr," Value of AV: %16.6E\n",av); exit(EXIT_FAILURE); S10: genexp = sexpo()*av; return genexp; } double genf(const double dfn,const double dfd) /* ********************************************************************** double genf(double dfn,double dfd) GENerate random deviate from the F distribution Function Generates a random deviate from the F (variance ratio) distribution with DFN degrees of freedom in the numerator and DFD degrees of freedom in the denominator. Arguments dfn --> Numerator degrees of freedom (Must be positive) dfd --> Denominator degrees of freedom (Must be positive) Method Directly generates ratio of chisquare variates ********************************************************************** */ { static double genf,xden,xnum; if(!(dfn <= 0.0 || dfd <= 0.0)) goto S10; (void)fputs(" Degrees of freedom nonpositive in GENF - abort!\n",stderr); (void)fprintf(stderr," DFN value: %16.6E DFD value: %16.6E\n",dfn,dfd); exit(EXIT_FAILURE); S10: /* * JJV changed this to call SGAMMA directly * * GENF = ( GENCHI( DFN ) / DFN ) / ( GENCHI( DFD ) / DFD ) * xnum = genchi(dfn)/dfn; <- OLD * xden = genchi(dfd)/dfd; <- OLD */ xnum = 2.0*sgamma(dfn/2.0)/dfn; xden = 2.0*sgamma(dfd/2.0)/dfd; /* * JJV changed constant to prevent underflow at compile time. * if(!(xden <= 9.999999999998E-39*xnum)) goto S20; */ if(!(xden <= 1.0E-37*xnum)) goto S20; (void)fputs(" GENF - generated numbers would cause overflow\n",stderr); (void)fprintf(stderr," Numerator %16.6E Denominator %16.6E\n",xnum,xden); /* * JJV changed next 2 lines to reflect constant change above in the * JJV truncated value returned. * (void)fputs(" GENF returning 1.0E38\n",stderr); * genf = 1.0E38; */ (void)fputs(" GENF returning 1.0E37\n",stderr); genf = 1.0E37; goto S30; S20: genf = xnum/xden; S30: return genf; } double gengam(const double a,const double r) /* ********************************************************************** double gengam(double a,double r) GENerates random deviates from GAMma distribution Function Generates random deviates from the gamma distribution whose density is (A**R)/Gamma(R) * X**(R-1) * Exp(-A*X) Arguments a --> Location parameter of Gamma distribution JJV (a > 0) r --> Shape parameter of Gamma distribution JJV (r > 0) Method Renames SGAMMA from TOMS as slightly modified by BWB to use RANF instead of SUNIF. For details see: (Case R >= 1.0) Ahrens, J.H. and Dieter, U. Generating Gamma Variates by a Modified Rejection Technique. Comm. ACM, 25,1 (Jan. 1982), 47 - 54. Algorithm GD JJV altered following to reflect argument ranges (Case 0.0 < R < 1.0) Ahrens, J.H. and Dieter, U. Computer Methods for Sampling from Gamma, Beta, Poisson and Binomial Distributions. Computing, 12 (1974), 223-246/ Adapted algorithm GS. ********************************************************************** */ { static double gengam; /* JJV added argument checker */ if(a > 0.0 && r > 0.0) goto S10; (void)fputs(" A or R nonpositive in GENGAM - abort!\n",stderr); (void)fprintf(stderr," A value: %16.6E R value: %16.6E\n",a,r); exit(EXIT_FAILURE); S10: gengam = sgamma(r); gengam /= a; return gengam; } void genmul(const int n,const double *p,const int ncat,int *ix) /* ********************************************************************** void genmul(int n,double *p,int ncat,int *ix) GENerate an observation from the MULtinomial distribution Arguments N --> Number of events that will be classified into one of the categories 1..NCAT P --> Vector of probabilities. P(i) is the probability that an event will be classified into category i. Thus, P(i) must be [0,1]. Only the first NCAT-1 P(i) must be defined since P(NCAT) is 1.0 minus the sum of the first NCAT-1 P(i). NCAT --> Number of categories. Length of P and IX. IX <-- Observation from multinomial distribution. All IX(i) will be nonnegative and their sum will be N. Method Algorithm from page 559 of Devroye, Luc Non-Uniform Random Variate Generation. Springer-Verlag, New York, 1986. ********************************************************************** */ { static double prob,ptot,sum; static int i,icat,ntot; if(n < 0) ftnstop("N < 0 in GENMUL"); if(ncat <= 1) ftnstop("NCAT <= 1 in GENMUL"); ptot = 0.0F; for(i=0; i 1.0F) ftnstop("Some P(i) > 1 in GENMUL"); ptot += *(p+i); } if(ptot > 0.99999F) ftnstop("Sum of P(i) > 1 in GENMUL"); /* Initialize variables */ ntot = n; sum = 1.0F; for(i=0; i Degrees of freedom of the chisquare (Must be >= 1.0) xnonc --> Noncentrality parameter of the chisquare (Must be >= 0.0) Method Uses fact that noncentral chisquare is the sum of a chisquare deviate with DF-1 degrees of freedom plus the square of a normal deviate with mean XNONC and standard deviation 1. ********************************************************************** */ { static double gennch; if(!(df < 1.0 || xnonc < 0.0)) goto S10; (void)fputs("DF < 1 or XNONC < 0 in GENNCH - ABORT\n",stderr); (void)fprintf(stderr,"Value of DF: %16.6E Value of XNONC: %16.6E\n",df,xnonc); exit(EXIT_FAILURE); /* JJV changed code to call SGAMMA, SNORM directly */ S10: if(df >= 1.000001) goto S20; /* * JJV case df == 1.0 * gennch = pow(gennor(sqrt(xnonc),1.0),2.0); <- OLD */ gennch = pow(snorm()+sqrt(xnonc),2.0); goto S30; S20: /* * JJV case df > 1.0 * gennch = genchi(df-1.0)+pow(gennor(sqrt(xnonc),1.0),2.0); <- OLD */ gennch = 2.0*sgamma((df-1.0)/2.0)+pow(snorm()+sqrt(xnonc),2.0); S30: return gennch; } double gennf(const double dfn,const double dfd,const double xnonc) /* ********************************************************************** double gennf(double dfn,double dfd,double xnonc) GENerate random deviate from the Noncentral F distribution Function Generates a random deviate from the noncentral F (variance ratio) distribution with DFN degrees of freedom in the numerator, and DFD degrees of freedom in the denominator, and noncentrality parameter XNONC. Arguments dfn --> Numerator degrees of freedom (Must be >= 1.0) dfd --> Denominator degrees of freedom (Must be positive) xnonc --> Noncentrality parameter (Must be nonnegative) Method Directly generates ratio of noncentral numerator chisquare variate to central denominator chisquare variate. ********************************************************************** */ { static double gennf,xden,xnum; static int qcond; /* JJV changed qcond, error message to allow dfn == 1.0 */ qcond = dfn < 1.0 || dfd <= 0.0 || xnonc < 0.0; if(!qcond) goto S10; (void)fputs("In GENNF - Either (1) Numerator DF < 1.0 or\n",stderr); (void)fputs(" (2) Denominator DF <= 0.0 or\n",stderr); (void)fputs(" (3) Noncentrality parameter < 0.0\n",stderr); (void)fprintf(stderr, "DFN value: %16.6E DFD value: %16.6E XNONC value: \n%16.6E\n",dfn,dfd, xnonc); exit(EXIT_FAILURE); S10: /* * JJV changed the code to call SGAMMA and SNORM directly * GENNF = ( GENNCH( DFN, XNONC ) / DFN ) / ( GENCHI( DFD ) / DFD ) * xnum = gennch(dfn,xnonc)/dfn; <- OLD * xden = genchi(dfd)/dfd; <- OLD */ if(dfn >= 1.000001) goto S20; /* JJV case dfn == 1.0, dfn is counted as exactly 1.0 */ xnum = pow(snorm()+sqrt(xnonc),2.0); goto S30; S20: /* JJV case df > 1.0 */ xnum = (2.0*sgamma((dfn-1.0)/2.0)+pow(snorm()+sqrt(xnonc),2.0))/dfn; S30: xden = 2.0*sgamma(dfd/2.0)/dfd; /* * JJV changed constant to prevent underflow at compile time. * if(!(xden <= 9.999999999998E-39*xnum)) goto S40; */ if(!(xden <= 1.0E-37*xnum)) goto S40; (void)fputs(" GENNF - generated numbers would cause overflow\n",stderr); (void)fprintf(stderr," Numerator %16.6E Denominator %16.6E\n",xnum,xden); /* * JJV changed next 2 lines to reflect constant change above in the * JJV truncated value returned. * (void)fputs(" GENNF returning 1.0E38\n",stderr); * gennf = 1.0E38; */ (void)fputs(" GENNF returning 1.0E37\n",stderr); gennf = 1.0E37; goto S50; S40: gennf = xnum/xden; S50: return gennf; } double gennor(const double av,const double sd) /* ********************************************************************** double gennor(double av,double sd) GENerate random deviate from a NORmal distribution Function Generates a single random deviate from a normal distribution with mean, AV, and standard deviation, SD. Arguments av --> Mean of the normal distribution. sd --> Standard deviation of the normal distribution. JJV (sd >= 0) Method Renames SNORM from TOMS as slightly modified by BWB to use RANF instead of SUNIF. For details see: Ahrens, J.H. and Dieter, U. Extensions of Forsythe's Method for Random Sampling from the Normal Distribution. Math. Comput., 27,124 (Oct. 1973), 927 - 937. ********************************************************************** */ { static double gennor; /* JJV added argument checker */ if(sd >= 0.0) goto S10; (void)fputs(" SD < 0 in GENNOR - ABORT\n",stderr); (void)fprintf(stderr," Value of SD: %16.6E\n",sd); exit(EXIT_FAILURE); S10: gennor = sd*snorm()+av; return gennor; } void genprm(int *iarray,const int larray) /* ********************************************************************** void genprm(int *iarray,int larray) GENerate random PeRMutation of iarray Arguments iarray <--> On output IARRAY is a random permutation of its value on input larray <--> Length of IARRAY ********************************************************************** */ { static int i,itmp,iwhich,D1,D2; for(i=1,D1=1,D2=(larray-i+D1)/D1; D2>0; D2--,i+=D1) { iwhich = ignuin(i,larray); itmp = *(iarray+iwhich-1); *(iarray+iwhich-1) = *(iarray+i-1); *(iarray+i-1) = itmp; } } double genunf(const double low,const double high) /* ********************************************************************** double genunf(double low,double high) GeNerate Uniform Real between LOW and HIGH Function Generates a real uniformly distributed between LOW and HIGH. Arguments low --> Low bound (exclusive) on real value to be generated high --> High bound (exclusive) on real value to be generated ********************************************************************** */ { static double genunf; if(!(low > high)) goto S10; (void)fprintf(stderr,"LOW > HIGH in GENUNF: LOW %16.6E HIGH: %16.6E\n",low,high); (void)fputs("Abort\n",stderr); exit(EXIT_FAILURE); S10: genunf = low+(high-low)*safe_ranf(); return genunf; } int ignbin(const int n,const double pp) /* ********************************************************************** int ignbin(int n,double pp) GENerate BINomial random deviate Function Generates a single random deviate from a binomial distribution whose number of trials is N and whose probability of an event in each trial is P. Arguments n --> The number of trials in the binomial distribution from which a random deviate is to be generated. JJV (N >= 0) pp --> The probability of an event in each trial of the binomial distribution from which a random deviate is to be generated. JJV (0.0 <= PP <= 1.0) ignbin <-- A random deviate yielding the number of events from N independent trials, each of which has a probability of event P. Method This is algorithm BTPE from: Kachitvichyanukul, V. and Schmeiser, B. W. Binomial Random Variate Generation. Communications of the ACM, 31, 2 (February, 1988) 216. ********************************************************************** SUBROUTINE BTPEC(N,PP,ISEED,JX) BINOMIAL RANDOM VARIATE GENERATOR MEAN .LT. 30 -- INVERSE CDF MEAN .GE. 30 -- ALGORITHM BTPE: ACCEPTANCE-REJECTION VIA FOUR REGION COMPOSITION. THE FOUR REGIONS ARE A TRIANGLE (SYMMETRIC IN THE CENTER), A PAIR OF PARALLELOGRAMS (ABOVE THE TRIANGLE), AND EXPONENTIAL LEFT AND RIGHT TAILS. BTPE REFERS TO BINOMIAL-TRIANGLE-PARALLELOGRAM-EXPONENTIAL. BTPEC REFERS TO BTPE AND "COMBINED." THUS BTPE IS THE RESEARCH AND BTPEC IS THE IMPLEMENTATION OF A COMPLETE USABLE ALGORITHM. REFERENCE: VORATAS KACHITVICHYANUKUL AND BRUCE SCHMEISER, "BINOMIAL RANDOM VARIATE GENERATION," COMMUNICATIONS OF THE ACM, FORTHCOMING WRITTEN: SEPTEMBER 1980. LAST REVISED: MAY 1985, JULY 1987 REQUIRED SUBPROGRAM: RAND() -- A UNIFORM (0,1) RANDOM NUMBER GENERATOR ARGUMENTS N : NUMBER OF BERNOULLI TRIALS (INPUT) PP : PROBABILITY OF SUCCESS IN EACH TRIAL (INPUT) ISEED: RANDOM NUMBER SEED (INPUT AND OUTPUT) JX: RANDOMLY GENERATED OBSERVATION (OUTPUT) VARIABLES PSAVE: VALUE OF PP FROM THE LAST CALL TO BTPEC NSAVE: VALUE OF N FROM THE LAST CALL TO BTPEC XNP: VALUE OF THE MEAN FROM THE LAST CALL TO BTPEC P: PROBABILITY USED IN THE GENERATION PHASE OF BTPEC FFM: TEMPORARY VARIABLE EQUAL TO XNP + P M: INTEGER VALUE OF THE CURRENT MODE FM: doubleING POINT VALUE OF THE CURRENT MODE XNPQ: TEMPORARY VARIABLE USED IN SETUP AND SQUEEZING STEPS P1: AREA OF THE TRIANGLE C: HEIGHT OF THE PARALLELOGRAMS XM: CENTER OF THE TRIANGLE XL: LEFT END OF THE TRIANGLE XR: RIGHT END OF THE TRIANGLE AL: TEMPORARY VARIABLE XLL: RATE FOR THE LEFT EXPONENTIAL TAIL XLR: RATE FOR THE RIGHT EXPONENTIAL TAIL P2: AREA OF THE PARALLELOGRAMS P3: AREA OF THE LEFT EXPONENTIAL TAIL P4: AREA OF THE RIGHT EXPONENTIAL TAIL U: A U(0,P4) RANDOM VARIATE USED FIRST TO SELECT ONE OF THE FOUR REGIONS AND THEN CONDITIONALLY TO GENERATE A VALUE FROM THE REGION V: A U(0,1) RANDOM NUMBER USED TO GENERATE THE RANDOM VALUE (REGION 1) OR TRANSFORMED INTO THE VARIATE TO ACCEPT OR REJECT THE CANDIDATE VALUE IX: INTEGER CANDIDATE VALUE X: PRELIMINARY CONTINUOUS CANDIDATE VALUE IN REGION 2 LOGIC AND A doubleING POINT IX IN THE ACCEPT/REJECT LOGIC K: ABSOLUTE VALUE OF (IX-M) F: THE HEIGHT OF THE SCALED DENSITY FUNCTION USED IN THE ACCEPT/REJECT DECISION WHEN BOTH M AND IX ARE SMALL ALSO USED IN THE INVERSE TRANSFORMATION R: THE RATIO P/Q G: CONSTANT USED IN CALCULATION OF PROBABILITY MP: MODE PLUS ONE, THE LOWER INDEX FOR EXPLICIT CALCULATION OF F WHEN IX IS GREATER THAN M IX1: CANDIDATE VALUE PLUS ONE, THE LOWER INDEX FOR EXPLICIT CALCULATION OF F WHEN IX IS LESS THAN M I: INDEX FOR EXPLICIT CALCULATION OF F FOR BTPE AMAXP: MAXIMUM ERROR OF THE LOGARITHM OF NORMAL BOUND YNORM: LOGARITHM OF NORMAL BOUND ALV: NATURAL LOGARITHM OF THE ACCEPT/REJECT VARIATE V X1,F1,Z,W,Z2,X2,F2, AND W2 ARE TEMPORARY VARIABLES TO BE USED IN THE FINAL ACCEPT/REJECT TEST QN: PROBABILITY OF NO SUCCESS IN N TRIALS REMARK IX AND JX COULD LOGICALLY BE THE SAME VARIABLE, WHICH WOULD SAVE A MEMORY POSITION AND A LINE OF CODE. HOWEVER, SOME COMPILERS (E.G.,CDC MNF) OPTIMIZE BETTER WHEN THE ARGUMENTS ARE NOT INVOLVED. ISEED NEEDS TO BE DOUBLE PRECISION IF THE IMSL ROUTINE GGUBFS IS USED TO GENERATE UNIFORM RANDOM NUMBER, OTHERWISE TYPE OF ISEED SHOULD BE DICTATED BY THE UNIFORM GENERATOR ********************************************************************** *****DETERMINE APPROPRIATE ALGORITHM AND WHETHER SETUP IS NECESSARY */ { /* JJV changed initial values to ridiculous values */ static double psave = -1.0E37; static int nsave = -214748365; static int ignbin,i,ix,ix1,k,m,mp,T1; static double al,alv,amaxp,c,f,f1,f2,ffm,fm,g,p,p1,p2,p3,p4,q,qn,r,u,v,w,w2,x,x1, x2,xl,xll,xlr,xm,xnp,xnpq,xr,ynorm,z,z2; if(pp != psave) goto S10; if(n != nsave) goto S20; if(xnp < 30.0) goto S150; goto S30; S10: /* *****SETUP, PERFORM ONLY WHEN PARAMETERS CHANGE JJV added checks to ensure 0.0 <= PP <= 1.0 */ if(pp < 0.0F) ftnstop("PP < 0.0 in IGNBIN"); if(pp > 1.0F) ftnstop("PP > 1.0 in IGNBIN"); psave = pp; p = min(psave,1.0-psave); q = 1.0-p; S20: /* JJV added check to ensure N >= 0 */ if(n < 0L) ftnstop("N < 0 in IGNBIN"); xnp = n*p; nsave = n; if(xnp < 30.0) goto S140; ffm = xnp+p; m = (int)ffm; fm = (double)m; xnpq = xnp*q; p1 = (int) (2.195*sqrt(xnpq)-4.6*q)+0.5; xm = fm+0.5; xl = xm-p1; xr = xm+p1; c = 0.134+20.5/(15.3+fm); al = (ffm-xl)/(ffm-xl*p); xll = al*(1.0+0.5*al); al = (xr-ffm)/(xr*q); xlr = al*(1.0+0.5*al); p2 = p1*(1.0+c+c); p3 = p2+c/xll; p4 = p3+c/xlr; S30: /* *****GENERATE VARIATE */ u = safe_ranf()*p4; v = safe_ranf(); /* TRIANGULAR REGION */ if(u > p1) goto S40; ix = (int)(xm-p1*v+u); goto S170; S40: /* PARALLELOGRAM REGION */ if(u > p2) goto S50; x = xl+(u-p1)/c; v = v*c+1.0-ABS(xm-x)/p1; if(v > 1.0 || v <= 0.0) goto S30; ix = (int)x; goto S70; S50: /* LEFT TAIL */ if(u > p3) goto S60; ix = (int)(xl+log(v)/xll); if(ix < 0) goto S30; v *= ((u-p2)*xll); goto S70; S60: /* RIGHT TAIL */ ix = (int)(xr-log(v)/xlr); if(ix > n) goto S30; v *= ((u-p3)*xlr); S70: /* *****DETERMINE APPROPRIATE WAY TO PERFORM ACCEPT/REJECT TEST */ k = ABS(ix-m); if(k > 20 && k < xnpq/2-1) goto S130; /* EXPLICIT EVALUATION */ f = 1.0; r = p/q; g = (n+1)*r; T1 = m-ix; if(T1 < 0) goto S80; else if(T1 == 0) goto S120; else goto S100; S80: mp = m+1; for(i=mp; i<=ix; i++) f *= (g/i-r); goto S120; S100: ix1 = ix+1; for(i=ix1; i<=m; i++) f /= (g/i-r); S120: if(v <= f) goto S170; goto S30; S130: /* SQUEEZING USING UPPER AND LOWER BOUNDS ON ALOG(F(X)) */ amaxp = k/xnpq*((k*(k/3.0+0.625)+0.1666666666666)/xnpq+0.5); ynorm = -(k*k/(2.0*xnpq)); alv = log(v); if(alv < ynorm-amaxp) goto S170; if(alv > ynorm+amaxp) goto S30; /* STIRLING'S FORMULA TO MACHINE ACCURACY FOR THE FINAL ACCEPTANCE/REJECTION TEST */ x1 = ix+1.0; f1 = fm+1.0; z = n+1.0-fm; w = n-ix+1.0; z2 = z*z; x2 = x1*x1; f2 = f1*f1; w2 = w*w; if(alv <= xm*log(f1/x1)+(n-m+0.5)*log(z/w)+(ix-m)*log(w*p/(x1*q))+(13860.0- (462.0-(132.0-(99.0-140.0/f2)/f2)/f2)/f2)/f1/166320.0+(13860.0-(462.0- (132.0-(99.0-140.0/z2)/z2)/z2)/z2)/z/166320.0+(13860.0-(462.0-(132.0- (99.0-140.0/x2)/x2)/x2)/x2)/x1/166320.0+(13860.0-(462.0-(132.0-(99.0 -140.0/w2)/w2)/w2)/w2)/w/166320.0) goto S170; goto S30; S140: /* INVERSE CDF LOGIC FOR MEAN LESS THAN 30 */ qn = pow(q,(double)n); r = p/q; g = r*(n+1); S150: ix = 0; f = qn; u = safe_ranf(); S160: if(u < f) goto S170; if(ix > 110) goto S150; u -= f; ix += 1; f *= (g/ix-r); goto S160; S170: if(psave > 0.5) ix = n-ix; ignbin = ix; return ignbin; } int ignnbn(const int n,const double p) /* ********************************************************************** int ignnbn(int n,double p) GENerate Negative BiNomial random deviate Function Generates a single random deviate from a negative binomial distribution. Arguments N --> The number of trials in the negative binomial distribution from which a random deviate is to be generated. JJV (N > 0) P --> The probability of an event. JJV (0.0 < P < 1.0) Method Algorithm from page 480 of Devroye, Luc Non-Uniform Random Variate Generation. Springer-Verlag, New York, 1986. ********************************************************************** */ { static int ignnbn; static double y,a,r; /* .. .. Executable Statements .. */ /* Check Arguments */ if(n <= 0L) ftnstop("N <= 0 in IGNNBN"); if(p <= 0.0F) ftnstop("P <= 0.0 in IGNNBN"); if(p >= 1.0F) ftnstop("P >= 1.0 in IGNNBN"); /* Generate Y, a random gamma (n,(1-p)/p) variable JJV Note: the above parametrization is consistent with Devroye, JJV but gamma (p/(1-p),n) is the equivalent in our code */ r = (double)n; a = p/(1.0F-p); /* * JJV changed this to call SGAMMA directly * y = gengam(a,r); <- OLD */ y = sgamma(r)/a; /* Generate a random Poisson(y) variable */ ignnbn = ignpoi(y); return ignnbn; } int ignpoi(const double mu) /* ********************************************************************** int ignpoi(double mu) GENerate POIsson random deviate Function Generates a single random deviate from a Poisson distribution with mean MU. Arguments mu --> The mean of the Poisson distribution from which a random deviate is to be generated. (mu >= 0.0) ignpoi <-- The random deviate. Method Renames KPOIS from TOMS as slightly modified by BWB to use RANF instead of SUNIF. For details see: Ahrens, J.H. and Dieter, U. Computer Generation of Poisson Deviates From Modified Normal Distributions. ACM Trans. Math. Software, 8, 2 (June 1982),163-179 ********************************************************************** ********************************************************************** P O I S S O N DISTRIBUTION ********************************************************************** ********************************************************************** FOR DETAILS SEE: AHRENS, J.H. AND DIETER, U. COMPUTER GENERATION OF POISSON DEVIATES FROM MODIFIED NORMAL DISTRIBUTIONS. ACM TRANS. MATH. SOFTWARE, 8,2 (JUNE 1982), 163 - 179. (SLIGHTLY MODIFIED VERSION OF THE PROGRAM IN THE ABOVE ARTICLE) ********************************************************************** INTEGER FUNCTION IGNPOI(IR,MU) INPUT: IR=CURRENT STATE OF BASIC RANDOM NUMBER GENERATOR MU=MEAN MU OF THE POISSON DISTRIBUTION OUTPUT: IGNPOI=SAMPLE FROM THE POISSON-(MU)-DISTRIBUTION MUPREV=PREVIOUS MU, MUOLD=MU AT LAST EXECUTION OF STEP P OR B. TABLES: COEFFICIENTS A0-A7 FOR STEP F. FACTORIALS FACT COEFFICIENTS A(K) - FOR PX = FK*V*V*SUM(A(K)*V**K)-DEL SEPARATION OF CASES A AND B */ { static double a0 = -0.5; static double a1 = 0.3333333; static double a2 = -0.2500068; static double a3 = 0.2000118; static double a4 = -0.1661269; static double a5 = 0.1421878; static double a6 = -0.1384794; static double a7 = 0.125006; /* JJV changed the initial values of MUPREV and MUOLD */ static double muold = -1.0E37; static double muprev = -1.0E37; static double fact[10] = { 1.0,1.0,2.0,6.0,24.0,120.0,720.0,5040.0,40320.0,362880.0 }; /* JJV added ll to the list, for Case A */ static int ignpoi,j,k,kflag,l,ll,m; static double b1,b2,c,c0,c1,c2,c3,d,del,difmuk,e,fk,fx,fy,g,omega,p,p0,px,py,q,s, t,u,v,x,xx,pp[35]; if(mu == muprev) goto S10; if(mu < 10.0) goto S120; /* C A S E A. (RECALCULATION OF S,D,LL IF MU HAS CHANGED) JJV changed l in Case A to ll */ muprev = mu; s = sqrt(mu); d = 6.0*mu*mu; /* THE POISSON PROBABILITIES PK EXCEED THE DISCRETE NORMAL PROBABILITIES FK WHENEVER K >= M(MU). LL=IFIX(MU-1.1484) IS AN UPPER BOUND TO M(MU) FOR ALL MU >= 10 . */ ll = (int) (mu-1.1484); S10: /* STEP N. NORMAL SAMPLE - SNORM(IR) FOR STANDARD NORMAL DEVIATE */ g = mu+s*snorm(); if(g < 0.0) goto S20; ignpoi = (int) (g); /* STEP I. IMMEDIATE ACCEPTANCE IF IGNPOI IS LARGE ENOUGH */ if(ignpoi >= ll) return ignpoi; /* STEP S. SQUEEZE ACCEPTANCE - SUNIF(IR) FOR (0,1)-SAMPLE U */ fk = (double)ignpoi; difmuk = mu-fk; u = safe_ranf(); if(d*u >= difmuk*difmuk*difmuk) return ignpoi; S20: /* STEP P. PREPARATIONS FOR STEPS Q AND H. (RECALCULATIONS OF PARAMETERS IF NECESSARY) .3989423=(2*PI)**(-.5) .416667E-1=1./24. .1428571=1./7. THE QUANTITIES B1, B2, C3, C2, C1, C0 ARE FOR THE HERMITE APPROXIMATIONS TO THE DISCRETE NORMAL PROBABILITIES FK. C=.1069/MU GUARANTEES MAJORIZATION BY THE 'HAT'-FUNCTION. */ if(mu == muold) goto S30; muold = mu; omega = 0.3989423/s; b1 = 4.166667E-2/mu; b2 = 0.3*b1*b1; c3 = 0.1428571*b1*b2; c2 = b2-15.0*c3; c1 = b1-6.0*b2+45.0*c3; c0 = 1.0-b1+3.0*b2-15.0*c3; c = 0.1069/mu; S30: if(g < 0.0) goto S50; /* 'SUBROUTINE' F IS CALLED (KFLAG=0 FOR CORRECT RETURN) */ kflag = 0; goto S70; S40: /* STEP Q. QUOTIENT ACCEPTANCE (RARE CASE) */ if(fy-u*fy <= py*exp(px-fx)) return ignpoi; S50: /* STEP E. EXPONENTIAL SAMPLE - SEXPO(IR) FOR STANDARD EXPONENTIAL DEVIATE E AND SAMPLE T FROM THE LAPLACE 'HAT' (IF T <= -.6744 THEN PK < FK FOR ALL MU >= 10.) */ e = sexpo(); u = safe_ranf(); u += (u-1.0); t = 1.8+fsign(e,u); if(t <= -0.6744) goto S50; ignpoi = (int) (mu+s*t); fk = (double)ignpoi; difmuk = mu-fk; /* 'SUBROUTINE' F IS CALLED (KFLAG=1 FOR CORRECT RETURN) */ kflag = 1; goto S70; S60: /* STEP H. HAT ACCEPTANCE (E IS REPEATED ON REJECTION) */ if(c*fabs(u) > py*exp(px+e)-fy*exp(fx+e)) goto S50; return ignpoi; S70: /* STEP F. 'SUBROUTINE' F. CALCULATION OF PX,PY,FX,FY. CASE IGNPOI .LT. 10 USES FACTORIALS FROM TABLE FACT */ if(ignpoi >= 10) goto S80; px = -mu; py = pow(mu,(double)ignpoi)/ *(fact+ignpoi); goto S110; S80: /* CASE IGNPOI .GE. 10 USES POLYNOMIAL APPROXIMATION A0-A7 FOR ACCURACY WHEN ADVISABLE .8333333E-1=1./12. .3989423=(2*PI)**(-.5) */ del = 8.333333E-2/fk; del -= (4.8*del*del*del); v = difmuk/fk; if(fabs(v) <= 0.25) goto S90; px = fk*log(1.0+v)-difmuk-del; goto S100; S90: px = fk*v*v*(((((((a7*v+a6)*v+a5)*v+a4)*v+a3)*v+a2)*v+a1)*v+a0)-del; S100: py = 0.3989423/sqrt(fk); S110: x = (0.5-difmuk)/s; xx = x*x; fx = -0.5*xx; fy = omega*(((c3*xx+c2)*xx+c1)*xx+c0); if(kflag <= 0) goto S40; goto S60; S120: /* C A S E B. (START NEW TABLE AND CALCULATE P0 IF NECESSARY) JJV changed MUPREV assignment to initial value */ muprev = -1.0E37; if(mu == muold) goto S130; /* JJV added argument checker here */ if(mu >= 0.0) goto S125; (void)fprintf(stderr,"MU < 0 in IGNPOI: MU %16.6E\n",mu); (void)fputs("Abort\n",stderr); exit(EXIT_FAILURE); S125: muold = mu; m = max(1L,(int) (mu)); l = 0; p = exp(-mu); q = p0 = p; S130: /* STEP U. UNIFORM SAMPLE FOR INVERSION METHOD */ u = safe_ranf(); ignpoi = 0; if(u <= p0) return ignpoi; /* STEP T. TABLE COMPARISON UNTIL THE END PP(L) OF THE PP-TABLE OF CUMULATIVE POISSON PROBABILITIES (0.458=PP(9) FOR MU=10) */ if(l == 0) goto S150; j = 1; if(u > 0.458) j = min(l,m); for(k=j; k<=l; k++) { if(u <= *(pp+k-1)) goto S180; } if(l == 35) goto S130; S150: /* STEP C. CREATION OF NEW POISSON PROBABILITIES P AND THEIR CUMULATIVES Q=PP(K) */ l += 1; for(k=l; k<=35; k++) { p = p*mu/(double)k; q += p; *(pp+k-1) = q; if(u <= q) goto S170; } l = 35; goto S130; S170: l = k; S180: ignpoi = k; return ignpoi; } int ignuin(const int low,const int high) /* ********************************************************************** int ignuin(int low,int high) GeNerate Uniform INteger Function Generates an integer uniformly distributed between LOW and HIGH. Arguments low --> Low bound (inclusive) on integer value to be generated high --> High bound (inclusive) on integer value to be generated Note If (HIGH-LOW) > 2,147,483,561 prints error message on * unit and stops the program. ********************************************************************** IGNLGI generates integers between 1 and 2147483562 MAXNUM is 1 less than maximum generable value */ { static int ignuin,ranp1; static unsigned int ign; if(!(low > high)) goto S10; (void)fputs(" low > high in ignuin - ABORT\n",stderr); exit(EXIT_FAILURE); S10: if(!(low == high)) goto S30; ignuin = low; return ignuin; S30: ign = low+(int)(safe_ranf()*(double)(ranp1+1)); return ign; #undef err1 #undef err2 } int lennob(const char *str ) /*@*/ /* Returns the length of str ignoring trailing blanks but not other white space. */ { int i, i_nb; for (i=0, i_nb= -1L; *(str+i); i++) if ( *(str+i) != ' ' ) i_nb = i; return (i_nb+1); } int mltmod(const int a,const int s,const int m) /* ********************************************************************** int mltmod(int a,int s,int m) Returns (A*S) MOD M This is a transcription from Pascal to Fortran of routine MULtMod_Decompos from the paper L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package with Splitting Facilities." ACM Transactions on Mathematical Software, 17:98-111 (1991) Arguments a, s, m --> ********************************************************************** */ { #define h 32768L static int mltmod,a0,a1,k,p,q,qh,rh; /* H = 2**((b-2)/2) where b = 32 because we are using a 32 bit machine. On a different machine recompute H */ if(!(a <= 0 || a >= m || s <= 0 || s >= m)) goto S10; (void)fputs(" a, m, s out of order in mltmod - ABORT!\n",stderr); (void)fprintf(stderr," a = %12d s = %12d m = %12d\n",a,s,m); (void)fputs(" mltmod requires: 0 < a < m; 0 < s < m\n",stderr); exit(EXIT_FAILURE); S10: if(!(a < h)) goto S20; a0 = a; p = 0; goto S120; S20: a1 = a/h; a0 = a-h*a1; qh = m/h; rh = m-h*qh; if(!(a1 >= h)) goto S50; a1 -= h; k = s/qh; p = (int)(h*(s-k*qh)-k*rh); S30: if(!(p < 0)) goto S40; p += m; goto S30; S40: goto S60; S50: p = 0; S60: /* P = (A2*S*H)MOD M */ if(!(a1 != 0)) goto S90; q = m/a1; k = s/q; p -= (k*(m-a1*q)); if(p > 0) p -= m; p += (a1*(s-k*q)); S70: if(!(p < 0)) goto S80; p += m; goto S70; S90: S80: k = p/qh; /* P = ((A2*H + A1)*S)MOD M */ p = (int)(h*(p-k*qh)-k*rh); S100: if(!(p < 0)) goto S110; p += m; goto S100; S120: S110: if(!(a0 != 0)) goto S150; /* P = ((A2*H + A1)*H*S)MOD M */ q = m/a0; k = s/q; p -= (k*(m-a0*q)); if(p > 0) p -= m; p += (a0*(s-k*q)); S130: if(!(p < 0)) goto S140; p += m; goto S130; S150: S140: mltmod = p; return mltmod; #undef h } double sexpo(void) /*@*/ /* ********************************************************************** (STANDARD-) E X P O N E N T I A L DISTRIBUTION ********************************************************************** ********************************************************************** FOR DETAILS SEE: AHRENS, J.H. AND DIETER, U. COMPUTER METHODS FOR SAMPLING FROM THE EXPONENTIAL AND NORMAL DISTRIBUTIONS. COMM. ACM, 15,10 (OCT. 1972), 873 - 882. ALL STATEMENT NUMBERS CORRESPOND TO THE STEPS OF ALGORITHM 'SA' IN THE ABOVE PAPER (SLIGHTLY MODIFIED IMPLEMENTATION) Modified by Barry W. Brown, Feb 3, 1988 to use RANF instead of SUNIF. The argument IR thus goes away. ********************************************************************** Q(N) = SUM(ALOG(2.0)**K/K!) K=1,..,N , THE HIGHEST N (HERE 8) IS DETERMINED BY Q(N)=1.0 WITHIN STANDARD PRECISION */ { static double q[8] = { 0.6931472,0.9333737,0.9888778,0.9984959,0.9998293,0.9999833,0.9999986, .9999999 }; static int i; static double sexpo,a,u,ustar,umin; static double *q1 = q; S21: a = 0.0; u = safe_ranf(); goto S30; S20: a += *q1; S30: u += u; /* * JJV changed the following to reflect the true algorithm and prevent * JJV unpredictable behavior if U is initially 0.5. * if(u <= 1.0) goto S20; */ if(u < 1.0) goto S20; u -= 1.0; if(u > *q1) goto S60; sexpo = a+u; return sexpo; S60: if(u>q[7]) goto S21; i = 1; ustar = safe_ranf(); umin = ustar; S70: ustar = safe_ranf(); if(ustar < umin) umin = ustar; i += 1; if(u > *(q+i-1)) goto S70; sexpo = a+umin**q1; return sexpo; } double sgamma(const double a) /* ********************************************************************** (STANDARD-) G A M M A DISTRIBUTION ********************************************************************** ********************************************************************** PARAMETER A >= 1.0 ! ********************************************************************** FOR DETAILS SEE: AHRENS, J.H. AND DIETER, U. GENERATING GAMMA VARIATES BY A MODIFIED REJECTION TECHNIQUE. COMM. ACM, 25,1 (JAN. 1982), 47 - 54. STEP NUMBERS CORRESPOND TO ALGORITHM 'GD' IN THE ABOVE PAPER (STRAIGHTFORWARD IMPLEMENTATION) Modified by Barry W. Brown, Feb 3, 1988 to use RANF instead of SUNIF. The argument IR thus goes away. ********************************************************************** PARAMETER 0.0 < A < 1.0 ! ********************************************************************** FOR DETAILS SEE: AHRENS, J.H. AND DIETER, U. COMPUTER METHODS FOR SAMPLING FROM GAMMA, BETA, POISSON AND BINOMIAL DISTRIBUTIONS. COMPUTING, 12 (1974), 223 - 246. (ADAPTED IMPLEMENTATION OF ALGORITHM 'GS' IN THE ABOVE PAPER) ********************************************************************** INPUT: A =PARAMETER (MEAN) OF THE STANDARD GAMMA DISTRIBUTION OUTPUT: SGAMMA = SAMPLE FROM THE GAMMA-(A)-DISTRIBUTION COEFFICIENTS Q(K) - FOR Q0 = SUM(Q(K)*A**(-K)) COEFFICIENTS A(K) - FOR Q = Q0+(T*T/2)*SUM(A(K)*V**K) COEFFICIENTS E(K) - FOR EXP(Q)-1 = SUM(E(K)*Q**K) PREVIOUS A PRE-SET TO ZERO - AA IS A', AAA IS A" SQRT32 IS THE SQUAREROOT OF 32 = 5.656854249492380 */ { static double q1 = 4.166669E-2; static double q2 = 2.083148E-2; static double q3 = 8.01191E-3; static double q4 = 1.44121E-3; static double q5 = -7.388E-5; static double q6 = 2.4511E-4; static double q7 = 2.424E-4; static double a1 = 0.3333333; static double a2 = -0.250003; static double a3 = 0.2000062; static double a4 = -0.1662921; static double a5 = 0.1423657; static double a6 = -0.1367177; static double a7 = 0.1233795; static double e1 = 1.0; static double e2 = 0.4999897; static double e3 = 0.166829; static double e4 = 4.07753E-2; static double e5 = 1.0293E-2; static double aa = 0.0; static double aaa = 0.0; static double sqrt32 = 5.656854; /* JJV added b0 to fix rare and subtle bug */ static double sgamma,s2,s,d,t,x,u,r,q0,b,b0,si,c,v,q,e,w,p; if(a == aa) goto S10; if(a < 1.0) goto S120; /* STEP 1: RECALCULATIONS OF S2,S,D IF A HAS CHANGED */ aa = a; s2 = a-0.5; s = sqrt(s2); d = sqrt32-12.0*s; S10: /* STEP 2: T=STANDARD NORMAL DEVIATE, X=(S,1/2)-NORMAL DEVIATE. IMMEDIATE ACCEPTANCE (I) */ t = snorm(); x = s+0.5*t; sgamma = x*x; if(t >= 0.0) return sgamma; /* STEP 3: U= 0,1 -UNIFORM SAMPLE. SQUEEZE ACCEPTANCE (S) */ u = safe_ranf(); if(d*u <= t*t*t) return sgamma; /* STEP 4: RECALCULATIONS OF Q0,B,SI,C IF NECESSARY */ if(a == aaa) goto S40; aaa = a; r = 1.0/ a; q0 = ((((((q7*r+q6)*r+q5)*r+q4)*r+q3)*r+q2)*r+q1)*r; /* APPROXIMATION DEPENDING ON SIZE OF PARAMETER A THE CONSTANTS IN THE EXPRESSIONS FOR B, SI AND C WERE ESTABLISHED BY NUMERICAL EXPERIMENTS */ if(a <= 3.686) goto S30; if(a <= 13.022) goto S20; /* CASE 3: A .GT. 13.022 */ b = 1.77; si = 0.75; c = 0.1515/s; goto S40; S20: /* CASE 2: 3.686 .LT. A .LE. 13.022 */ b = 1.654+7.6E-3*s2; si = 1.68/s+0.275; c = 6.2E-2/s+2.4E-2; goto S40; S30: /* CASE 1: A .LE. 3.686 */ b = 0.463+s+0.178*s2; si = 1.235; c = 0.195/s-7.9E-2+1.6E-1*s; S40: /* STEP 5: NO QUOTIENT TEST IF X NOT POSITIVE */ if(x <= 0.0) goto S70; /* STEP 6: CALCULATION OF V AND QUOTIENT Q */ v = t/(s+s); if(fabs(v) <= 0.25) goto S50; q = q0-s*t+0.25*t*t+(s2+s2)*log(1.0+v); goto S60; S50: q = q0+0.5*t*t*((((((a7*v+a6)*v+a5)*v+a4)*v+a3)*v+a2)*v+a1)*v; S60: /* STEP 7: QUOTIENT ACCEPTANCE (Q) */ if(log(1.0-u) <= q) return sgamma; S70: /* STEP 8: E=STANDARD EXPONENTIAL DEVIATE U= 0,1 -UNIFORM DEVIATE T=(B,SI)-DOUBLE EXPONENTIAL (LAPLACE) SAMPLE */ e = sexpo(); u = safe_ranf(); u += (u-1.0); t = b+fsign(si*e,u); /* STEP 9: REJECTION IF T .LT. TAU(1) = -.71874483771719 */ if(t < -0.7187449) goto S70; /* STEP 10: CALCULATION OF V AND QUOTIENT Q */ v = t/(s+s); if(fabs(v) <= 0.25) goto S80; q = q0-s*t+0.25*t*t+(s2+s2)*log(1.0+v); goto S90; S80: q = q0+0.5*t*t*((((((a7*v+a6)*v+a5)*v+a4)*v+a3)*v+a2)*v+a1)*v; S90: /* STEP 11: HAT ACCEPTANCE (H) (IF Q NOT POSITIVE GO TO STEP 8) */ if(q <= 0.0) goto S70; if(q <= 0.5) goto S100; /* * JJV modified the code through line 115 to handle large Q case */ if(q < 15.0) goto S95; /* * JJV Here Q is large enough that Q = log(exp(Q) - 1.0) (for real Q) * JJV so reformulate test at 110 in terms of one EXP, if not too big * JJV 87.49823 is close to the largest real which can be * JJV exponentiated (87.49823 = log(1.0E38)) */ if((q+e-0.5*t*t) > 87.49823) goto S115; if(c*fabs(u) > exp(q+e-0.5*t*t)) goto S70; goto S115; S95: w = exp(q)-1.0; goto S110; S100: w = ((((e5*q+e4)*q+e3)*q+e2)*q+e1)*q; S110: /* IF T IS REJECTED, SAMPLE AGAIN AT STEP 8 */ if(c*fabs(u) > w*exp(e-0.5*t*t)) goto S70; S115: x = s+0.5*t; sgamma = x*x; return sgamma; S120: /* ALTERNATE METHOD FOR PARAMETERS A BELOW 1 (.3678794=EXP(-1.)) JJV changed B to B0 (which was added to declarations for this) JJV in 120 to END to fix rare and subtle bug. JJV Line: 'aa = 0.0' was removed (unnecessary, wasteful). JJV Reasons: the state of AA only serves to tell the A >= 1.0 JJV case if certain A-dependent constants need to be recalculated. JJV The A < 1.0 case (here) no inter changes any of these, and JJV the recalculation of B (which used to change with an JJV A < 1.0 call) is governed by the state of AAA anyway. aa = 0.0; */ b0 = 1.0+0.3678794*a; S130: p = b0*safe_ranf(); if(p >= 1.0) goto S140; sgamma = exp(log(p)/ a); if(sexpo() < sgamma) goto S130; return sgamma; S140: sgamma = -log((b0-p)/ a); if(sexpo() < (1.0-a)*log(sgamma)) goto S130; return sgamma; } double snorm(void) /* ********************************************************************** (STANDARD-) N O R M A L DISTRIBUTION ********************************************************************** ********************************************************************** FOR DETAILS SEE: AHRENS, J.H. AND DIETER, U. EXTENSIONS OF FORSYTHE'S METHOD FOR RANDOM SAMPLING FROM THE NORMAL DISTRIBUTION. MATH. COMPUT., 27,124 (OCT. 1973), 927 - 937. ALL STATEMENT NUMBERS CORRESPOND TO THE STEPS OF ALGORITHM 'FL' (M=5) IN THE ABOVE PAPER (SLIGHTLY MODIFIED IMPLEMENTATION) Modified by Barry W. Brown, Feb 3, 1988 to use RANF instead of SUNIF. The argument IR thus goes away. ********************************************************************** THE DEFINITIONS OF THE CONSTANTS A(K), D(K), T(K) AND H(K) ARE ACCORDING TO THE ABOVEMENTIONED ARTICLE */ { static double a[32] = { 0.0,3.917609E-2,7.841241E-2,0.11777,0.1573107,0.1970991,0.2372021,0.2776904, 0.3186394,0.36013,0.4022501,0.4450965,0.4887764,0.5334097,0.5791322, 0.626099,0.6744898,0.7245144,0.7764218,0.8305109,0.8871466,0.9467818, 1.00999,1.077516,1.150349,1.229859,1.318011,1.417797,1.534121,1.67594, 1.862732,2.153875 }; static double d[31] = { 0.0,0.0,0.0,0.0,0.0,0.2636843,0.2425085,0.2255674,0.2116342,0.1999243, 0.1899108,0.1812252,0.1736014,0.1668419,0.1607967,0.1553497,0.1504094, 0.1459026,0.14177,0.1379632,0.1344418,0.1311722,0.128126,0.1252791, 0.1226109,0.1201036,0.1177417,0.1155119,0.1134023,0.1114027,0.1095039 }; static double t[31] = { 7.673828E-4,2.30687E-3,3.860618E-3,5.438454E-3,7.0507E-3,8.708396E-3, 1.042357E-2,1.220953E-2,1.408125E-2,1.605579E-2,1.81529E-2,2.039573E-2, 2.281177E-2,2.543407E-2,2.830296E-2,3.146822E-2,3.499233E-2,3.895483E-2, 4.345878E-2,4.864035E-2,5.468334E-2,6.184222E-2,7.047983E-2,8.113195E-2, 9.462444E-2,0.1123001,0.136498,0.1716886,0.2276241,0.330498,0.5847031 }; static double h[31] = { 3.920617E-2,3.932705E-2,3.951E-2,3.975703E-2,4.007093E-2,4.045533E-2, 4.091481E-2,4.145507E-2,4.208311E-2,4.280748E-2,4.363863E-2,4.458932E-2, 4.567523E-2,4.691571E-2,4.833487E-2,4.996298E-2,5.183859E-2,5.401138E-2, 5.654656E-2,5.95313E-2,6.308489E-2,6.737503E-2,7.264544E-2,7.926471E-2, 8.781922E-2,9.930398E-2,0.11556,0.1404344,0.1836142,0.2790016,0.7010474 }; static int i; static double snorm,u,s,ustar,aa,w,y,tt; u = safe_ranf(); s = 0.0; if(u > 0.5) s = 1.0; u += (u-s); u = 32.0*u; i = (int) (u); if(i == 32) i = 31; if(i == 0) goto S100; /* START CENTER */ ustar = u-(double)i; aa = *(a+i-1); S40: if(ustar > *(t+i-1)) { w = (ustar-*(t+i-1))**(h+i-1); goto S50; } /* CENTER CONTINUED */ u = safe_ranf(); w = u*(*(a+i)-aa); tt = (0.5*w+aa)*w; goto S80; S70: tt = u; ustar = safe_ranf(); S80: if(ustar > tt) goto S50; u = safe_ranf(); if(ustar >= u) goto S70; ustar = safe_ranf(); goto S40; S100: /* START TAIL */ i = 6; aa = *(a+31); goto S120; S110: aa += *(d+i-1); i += 1; S120: u += u; if(u < 1.0) goto S110; u -= 1.0; S140: w = u**(d+i-1); tt = (0.5*w+aa)*w; goto S160; S150: tt = u; S160: ustar = safe_ranf(); if(ustar <= tt) { u = safe_ranf(); if(ustar >= u) goto S150; u = safe_ranf(); goto S140; } S50: /* EXIT (BOTH CASES) */ y = aa+w; snorm = y; if(s == 1.0) snorm = -y; return snorm; } loki/libsrc/remember.c0100644000076500007650000000434607646742770014245 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * remember.c: * * * * Routines for keeping track of allocated memory that is used in weird * * ways so that it is not easy to keep track of it. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki_struct.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "AddRemem" /* Adds a memory pointer (from malloc()) to list. Used by FreeStuff() * So all can be free()'d with one call */ struct remember *AddRemem(void *p,struct remember *rblock) { struct remember *pr; if(!p || !rblock) ABT_FUNC("Called with zero pointer\n"); if(rblock->pos==REMSIZE) { if(!(pr=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); rblock->next=pr; rblock=pr; rblock->pos=0; rblock->next=0; } rblock->mem[rblock->pos++]=p; return rblock; } void FreeRemem(struct remember *rblock) { int i; struct remember *pr; while(rblock) { pr=rblock->next; for(i=0;ipos;i++) { free(rblock->mem[i]); } free(rblock); rblock=pr; } } loki/libsrc/strsep.c0100644000076500007650000000320307646742770013756 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Evry * * * * March 2003 * * * * strsep.c: * * * * Find first occurrence of a token in a string * * * * Copyright (C) Simon C. Heath 2003 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include "libhdr.h" char *my_strsep(char **s,const char *d) { char *p,*s1,c,c1; const char *dp; p=*s; if(p) { s1=p; for(;;) { c=*p++; dp=d; do { c1=*dp++; if(c1==c) { if(!c) p=0; else p[-1]=0; *s=p; return s1; } } while(c1); } } return p; } loki/libsrc/utils.c0100644000076500007650000002273207747732512013601 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * utils.c: * * * * Small utility routines used by both prep and loki * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #if HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include #include #include #include #if HAVE_SYS_SYSTEMINFO_H #include #endif #include "ranlib.h" #include "utils.h" #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif const char *FMsg="File Error - aborting\n"; const char *IntErr="Fatal Internal Error - aborting\n"; const char *MMsg="Out of Memory Error - aborting\n"; const char *AbMsg="Aborting\n"; int from_abt; static char *file_prefix,*file_dir; static int set_exit; static char *lfile; static loki_time *ltime; void abt(const char *file, const int line, const char *fmt, ...) { va_list args; if(stdout) (void)fflush(stdout); (void)fprintf(stderr,"[%s:%d] ",file,line); va_start(args,fmt); (void)vfprintf(stderr,fmt,args); va_end(args); from_abt=1; /* Avoid certain cleanup routines if aborting */ exit(EXIT_FAILURE); } static void free_utils(void) { if(file_prefix) { free(file_prefix); file_prefix=0; } if(file_dir) { free(file_dir); file_dir=0; } } char *add_file_dir(const char *p) { char *p1=0,*s2; const char *s1; size_t s; if(p) { if(file_dir) { s=strlen(p)+2+strlen(file_dir); p1=malloc(s); if(p1) { s1=file_dir; s2=p1-1; while((*++s2=*s1++)); if(s2[-1]!='/') *s2='/'; else s2--; s1=p; while((*++s2=*s1++)); } } else p1=strdup(p); } return p1; } int set_file_prefix(const char *p) { int err=0; char *p1; if(*p) { p1=strdup(p); if(p1) { if(file_prefix) free(file_prefix); file_prefix=p1; if(!set_exit) { if(!atexit(free_utils)) set_exit=1; } } else err=2; } else err=1; return err; } int set_file_dir(const char *p) { int err=0,s; char *p1; struct stat sbuf; if(*p) { p1=strdup(p); if(p1) { s=stat(p,&sbuf); if(!s) { if(sbuf.st_mode&S_IFDIR) { if((sbuf.st_mode&(S_IXUSR|S_IWUSR))==(S_IXUSR|S_IWUSR)) { if(file_dir) free(file_dir); file_dir=p1; if(!set_exit) { if(!atexit(free_utils)) set_exit=1; } } else err=5; } else err=4; } else err=3; } else err=2; } else err=1; return err; } const char *utl_error(int i) { static char *errs[]={ "No Error", "Out of memory", "Null Pointer", "Couldn't stat() directory", "Not a directory", "Insufficient permissions", "Bad error number" }; if(i>UTL_MAX_ERR) i=UTL_MAX_ERR+1; return errs[i]; } int mystrcmp(const char *p1, const char *p2) { if(!p1) { if(!p2) return 0; return 1; } if(!p2) return 1; return strcmp(p1,p2); } void qstrip(char *s1) { char *p,*p1; p=s1; p1=s1-1; while(*s1) { if(!isspace((int)*s1)) break; s1++; } while(*s1) { if(!isspace((int)*s1)) p1=p; *(p++)= *(s1++); } *(++p1)='\0'; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "tokenize" char **tokenize(char *s,const int ch) { int n_toks=0,a_size=16; char **p,*p1; if(!s) return 0; p1=s; if(!(p=malloc(sizeof(void *)*a_size))) ABT_FUNC(MMsg); if(!ch) { /* Split on white space */ for(;;) { while(*s && isspace((int)*s)) s++; if(n_toks==a_size) { a_size<<=1; if(!(p=realloc(p,sizeof(void *)*a_size))) ABT_FUNC(MMsg); } if(!*s) { p[n_toks]=0; break; } else p[n_toks++]=p1; while(*s && !isspace((int)*s)) { if(*s=='\\') { s++; if(!*s) break; } *p1++=*s++; } if(*s) s++; *p1++=0; } } else { /* Split on token */ for(;;) { if(n_toks==a_size) { a_size<<=1; if(!(p=realloc(p,sizeof(void *)*a_size))) ABT_FUNC(MMsg); } if(!*s) { p[n_toks]=0; break; } else p[n_toks++]=p1; while(*s && (*s!=ch)) { if(*s=='\\') { s++; if(!*s) break; } *p1++=*s++; } if(*s) s++; *p1++=0; qstrip(p[n_toks-1]); } } return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "copy_string" char *copy_string(const char *s) { char *s1; if(!(s1=malloc(strlen(s)+1))) ABT_FUNC(MMsg); return strcpy(s1,s); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "make_file_name" char *make_file_name(const char *s) { size_t l; char *s1,*s2,*s3; if(!s) ABT_FUNC("Passed zero pointer\n"); if(!file_prefix) { if(set_file_prefix(DEFAULT_FILE_PREFIX)) ABT_FUNC("Couldn't set default file name\n"); } l=strlen(s)+strlen(file_prefix)+2; if(file_dir) l+=strlen(file_dir)+1; if(!l) ABT_FUNC(IntErr); if(!(s1=malloc(l))) ABT_FUNC(MMsg); s2=s1-1; s3=file_dir; if(s3) { while((*++s2 = *s3++)); if(s2[-1]!='/') *s2='/'; else s2--; } s3=file_prefix; while((*++s2 = *s3++)); while((*s2++ = *s++)); return s1; } void print_start_time(const char *progname,const char *mode,char *logfile,loki_time *lt) { FILE *flog=0; char *buf; struct stat sbuf; int i,j; ltime=lt; if(logfile) logfile=add_file_dir(logfile); if(logfile && mode[0]=='w') { if(!stat(logfile,&sbuf)) { i=1; j=(int)strlen(logfile); buf=(char *)malloc((size_t)j+2); if(buf) { (void)strcpy(buf,logfile); buf[j]='~'; buf[j+1]='\0'; i=rename(logfile,buf); free(buf); } if(i) (void)fprintf(stderr,"print_start_time(): Couldn't rename old logfile\n"); } } if(logfile) flog=fopen(logfile,mode); else flog=stdout; if(flog) { (void)fprintf(flog,"\n********************** Starting *************************\n\n"); (void)fprintf(flog," %s: %s",progname,ctime(<->start_time)); if(logfile) { (void)fclose(flog); lfile=logfile; } } else { (void)fprintf(stderr,"Couldn't write to log file %s\n",logfile?logfile:""); if(logfile) free(logfile); } } void print_end_time(void) { FILE *flog; time_t end_time; double l; struct tms tbuf; long tps; int t=0,flag=0; char hname[MAXHOSTNAMELEN+1]; if(from_abt || !ltime) return; if(lfile) flog=fopen(lfile,"a"); else flog=stdout; if(flog) { #if HAVE_SYS_SYSTEMINFO_H if(sysinfo(SI_HOSTNAME,hname,MAXHOSTNAMELEN)<0) #else if(gethostname(hname,MAXHOSTNAMELEN)<0) #endif (void)strcpy(hname,"UNKNOWN"); (void)fprintf(flog,"\n*********************** Exiting *************************\n\n"); (void)fprintf(flog," Hostname: %s\n", hname); tps=sysconf (_SC_CLK_TCK); errno=0; (void)times(&tbuf); if(errno) perror("print_end_time():"); else { (void)fprintf (flog," System time: %.4f seconds\n",ltime->extra_stime+(double)tbuf.tms_stime/(double)tps); (void)fprintf (flog," User time: %.4f seconds\n",ltime->extra_utime+(double)tbuf.tms_utime/(double)tps); } end_time=time(0); l=ltime->extra_time+difftime(end_time,ltime->start_time); (void)fputs(" Elapsed time: ",flog); if(l>86400.0) { t=(int)l/86400.0; l-=(double)t*86400.0; (void)fprintf(flog,"%d day%s",t,t!=1?"s, ":", "); flag=1; } if(l>3600.0) { t=(int)(l/3600.0); l-=(double)t*3600.0; flag=1; } if(flag) (void)fprintf(flog,"%d hour%s",t,t!=1?"s, ":", "); if(l>60.0) { t=(int)(l/60.0); l-=(double)t*60.0; flag=1; } if(flag) (void)fprintf(flog,"%d minute%s",t,t!=1?"s, ":", "); (void)fprintf(flog,"%d second%c\n",(int)l,(int)l!=1?'s':' '); if(lfile) (void)fclose(flog); } if(lfile) { free(lfile); lfile=0; } } void gen_perm(int *x,int n) { int i,j; while(n) { j=(int)(safe_ranf()*(double)(n--)); i=x[j]; x[j]=x[n]; x[n]=i; } } int txt_print_double(double x,FILE *fptr) { int i,er=0; double y,z; static char *hexdigits="0123456789abcdef"; y=frexp(x,&i); if(fprintf(fptr,"%d:",i)<0) er=1; if(!er && y<0.0) { y=-y; if(fputc('-',fptr)==EOF) er=1; } if(!er) { if(y) { while(y>0.0 && !er) { y=frexp(y,&i); y=ldexp(y,i+4); y=modf(y,&z); if(fputc(hexdigits[(int)z],fptr)==EOF) er=1; } } else if(fputc('0',fptr)==EOF) er=1; } return er; } int txt_get_double(char *p,char **p1,double *x) { int j,e,mf=0; char *p2; double y; e=strtol(p,p1,10); p2=*p1; if(*p2++!=':') return 1; if(*p2=='-') { mf=1; p2++; } p=p2; while(isxdigit((int)*p2++)); y=0.0; *p1=--p2; while(p2-->p) { j=(int)*p2; if(j>='0'&&j<='9') j-='0'; else if(j>='a'&&j<='f') j-='a'-10; else return 1; y+=(double)j; y=frexp(y,&j); y=ldexp(y,j-4); } if(mf) y=-y; *x=ldexp(y,e); return 0; } loki/lokisrc/0040755000076500007650000000000010060041201012424 5ustar heathheathloki/lokisrc/alloc_loki.c0100644000076500007650000002542510001741567014726 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * alloc_loki.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki.h" int n_genetic_groups=1; /* n_tloci refers to how much storage for trait loci we currently have, not * how many are actually in the model, nor is it the maximum possible */ int n_tloci=8; struct TraitLocus *tlocus=0; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "AllocLokiStruct" void AllocLokiStruct(void) { int i,j,k,*tp1,*tp2,n_all,**tipp,*ff; #ifdef DEBUG int k2; #endif lk_ulong **tlpp,*tlp; double **tpp,*tp; signed char *tcp,**tcpp; struct Locus *loc; if(n_markers) { for(i=0;iseg[0]=tp1; loc->seg[1]=tp1+ped_size; marker[i].m_flag=tp1+2*ped_size; ff=founder_flag[i]; for(j=0;jseg[0][j]=loc->seg[1][j]= -2; break; case 1: loc->seg[0][j]=loc->seg[1][j]= -1; break; default: loc->seg[0][j]=loc->seg[1][j]= -1; break; } } tp1+=3*ped_size; } for(j=i=0;in_alleles; loc->aff_freq=loc->diff_freq=0; if(!n_all) { loc->freq=0; marker[i].freq_set=0; marker[i].count_flag=0; continue; } loc->freq=tpp; marker[i].freq_set=tcpp; marker[i].count_flag=tp1; marker[i].nhaps=tipp; marker[i].lump=tipp+ped_size; marker[i].temp=tlpp; tipp+=2*ped_size; tlpp+=ped_size; marker[i].nhaps[0]=tp2; marker[i].lump[0]=tp2+2*ped_size; marker[i].ngens=tp2+4*ped_size; marker[i].temp[0]=tlp; tp2+=5*ped_size; tlp+=2*ped_size; for(j=1;jfreq[j]=tp; marker[i].freq_set[j]=tcp; tp+=n_all; tcp+=n_all; for(k=0;kfreq[j][k]=0.0; marker[i].freq_set[j][k]=0; } } } } else for(i=0;imax_tloci) n_tloci=max_tloci; if(!(tlocus=realloc(tlocus,sizeof(struct TraitLocus)*n_tloci))) ABT_FUNC(MMsg); k=n_tloci-i; for(j=i;jfreq=0; loc->flag=0; loc->seg[0]=0; loc->lk_store=0; loc->variance=0; loc->gt=0; tlocus[j].eff=0; tlocus[j].model_flag=0; } } else return -1; } j=n_all*(n_all+1)/2-1; k=n_models*(n_models+1)/2; if(!(tpp=malloc(sizeof(void *)*(n_models+n_genetic_groups)))) ABT_FUNC(MMsg); if(!(tp=malloc(sizeof(double)*(j*n_models+k+n_genetic_groups*n_all)))) ABT_FUNC(MMsg); loc=&tlocus[i].locus; loc->freq=tpp; tlocus[i].eff=loc->freq+n_genetic_groups; loc->variance=tp; tp+=k; for(k=0;kfreq[k]=tp+n_all*k; loc->n_alleles=n_all; if(!(loc->seg[0])) { if(!(loc->seg[0]=calloc((size_t)4*ped_size,sizeof(int)))) ABT_FUNC(MMsg); loc->seg[1]=loc->seg[0]+ped_size; loc->genes[0]=loc->seg[1]+ped_size; loc->genes[1]=loc->genes[0]+ped_size; } ff=founder_flag[n_markers]; for(j=0;jseg[0][j]=loc->seg[1][j]= -2; break; case 1: loc->seg[0][j]=loc->seg[1][j]= -1; break; default: loc->seg[0][j]=loc->seg[1][j]= -1; break; } } if(!loc->gt) { if(!(loc->gt=calloc((size_t)ped_size,sizeof(int)))) ABT_FUNC(MMsg); } if(!loc->lk_store) { if(!(loc->lk_store=malloc(sizeof(double)*n_comp))) ABT_FUNC(MMsg); } return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "delete_traitlocus" void delete_traitlocus(const int tl) { struct Locus *loc; if(tl<0 || tl>=n_tloci) ABT_FUNC("Internal error - illegal trait locus\n"); loc=&tlocus[tl].locus; loc->flag=0; if(loc->variance) free(loc->variance); if(loc->freq) free(loc->freq); loc->freq=0; tlocus[tl].eff=0; loc->variance=0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "AllocEffects" void AllocEffects(void) { int i,j,k,k1,type,*tip,mod,n_all; struct Variable *var; double *tp; struct id_data *data; if(n_markers) { if(!(tip=calloc((size_t)n_markers*ped_size,sizeof(int)))) ABT_FUNC(MMsg); RemBlock=AddRemem(tip,RemBlock); for(i=0;iflag) { j+=1+use_student_t; /* Storage for residual + nu */ if((type&ST_CENSORED)&&(data->flag&2)) j++; /* Storage for censored value */ } } else if(id_array[i].n_rec) { j+=id_array[i].n_rec*(1+use_student_t); /* Storage for residual + nu */ if(type&ST_CENSORED) j+=id_array[i].n_rec; /* Storage for censored value */ } } if(j) { if(!(tp=malloc(sizeof(double)*j))) ABT_FUNC(MMsg); RemBlock=AddRemem(tp,RemBlock); for(i=0;iflag) { id_array[i].res[mod]=tp++; if(use_student_t) id_array[i].vv[mod]=tp++; if((type&ST_CENSORED)&&(data->flag&2)) id_array[i].cens[mod]=tp++; } } else { if(id_array[i].n_rec) { id_array[i].res[mod]=tp; tp+=id_array[i].n_rec; if(use_student_t) { id_array[i].vv[mod]=tp; tp+=id_array[i].n_rec; } if(type&ST_CENSORED) { id_array[i].cens[mod]=tp; tp+=id_array[i].n_rec; } } } } } for(k=i=0;i1) ABT_FUNC("Sorry - interaction terms not currently supported\n"); type=models[mod].term[i].vars[0].type; j=models[mod].term[i].vars[0].var_index; if(type&ST_TRAITLOCUS) models[mod].term[i].df=2; else if(type&ST_ID) models[mod].term[i].df=ped_size; else if(type&ST_MARKER) { k1=marker[j].locus.n_alleles; models[mod].term[i].df=k1*(k1+1)/2-1; marker[j].mterm[mod]=models[mod].term+i; if(!(marker[j].locus.variance)) if(!(marker[j].locus.variance=malloc(sizeof(double)*n_models*(n_models+1)/2))) ABT_FUNC(MMsg); } else { if(type&ST_CONSTANT) var=id_variable+j; else var=nonid_variable+j; if(type&ST_FACTOR) { if(type&ST_RANDOM) models[mod].term[i].df=var->n_levels; else models[mod].term[i].df=var->n_levels-1; } } if(!(type&ST_TRAITLOCUS)) k+=models[mod].term[i].df; } if(!k) continue; if(!(tp=malloc(sizeof(double)*k))) ABT_FUNC(MMsg); RemBlock=AddRemem(tp,RemBlock); for(i=0;i #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki.h" #include "mat_utils.h" #include "calc_var_locus.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "calc_var_locus" void calc_var_locus(int locus) { int i,j,k,mod,mod1; double z,z1; int *gt; static double *x,*mu,*n; unsigned long mflag=0,a,b; if(locus==n_markers) { if(x) free(x); return; } k=n_models*(n_models+1)/2; if(!x) { if(!(x=malloc(sizeof(double)*(n_models+2*k)))) ABT_FUNC(MMsg); n=x+k; mu=n+k; } if(locus<0) { gt=tlocus[-1-locus].locus.gt; mflag=tlocus[-1-locus].model_flag; } else gt=marker[locus].locus.gt; for(i=0;i0.0?mu[mod]/n[mod]:0.0; n[mod]=0.0; } for(i=0;ieff[k-1]; n[mod]++; } } for(mod=0;mod0.0?mu[mod]/n[mod]:0.0; n[mod]=0.0; } for(i=0;ieff[k-1]:0.0; z-=mu[mod]; for(mod1=0;mod1<=mod;mod1++) if(marker[locus].mterm[mod1]&&id_array[i].res[mod1]) { z1=k?marker[locus].mterm[mod1]->eff[k-1]:0.0; z1-=mu[mod1]; j=IDX(mod,mod1); n[j]++; x[j]+=z*z1; } } } } for(j=mod=0;mod0.0) x[j]/=z; if(x[j]<1.0e-16) x[j]=0.0; j++; } } k=n_models*(n_models+1)/2; if(locus<0) for(i=0;i #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "loki_monitor.h" #include "count_dbr.h" static unsigned int **dbr_count[2],**dbr_countn[2],*dbr_mem; static int *perm; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_dbr_count" int init_dbr_shm(void) { int i,j,k; int er=-1; if(n_links && n_markers) { for(k=i=0;i2) k+=j-2; } if(k) { lpar->dbr_mem_size=k*ped_size*4*sizeof(int); lpar->dbr_shm_id=shmget(IPC_PRIVATE,lpar->dbr_mem_size,IPC_CREAT|0600); if(lpar->dbr_shm_id<0) { perror("Failed to get shared memory segment"); ABT_FUNC(AbMsg); } } er=0; } return er; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_dbr_count" int init_dbr_count(void) { int i,j,k,k1,k2,er=-1; unsigned int *tmp; if(lpar->dbr_shm_id>=0) { dbr_mem=shmat(lpar->dbr_shm_id,0,0); if(dbr_mem==(void *)-1) { perror("Failed to attach shared memory segment"); ABT_FUNC(AbMsg); } if(!(perm=malloc(sizeof(int)*n_markers))) ABT_FUNC(MMsg); if(!(dbr_count[0]=malloc(sizeof(void *)*4*n_markers))) ABT_FUNC(MMsg); dbr_count[1]=dbr_count[0]+n_markers; dbr_countn[0]=dbr_count[1]+n_markers; dbr_countn[1]=dbr_countn[0]+n_markers; for(i=0;i2) { gnu_qsort(perm,(size_t)j,sizeof(int),cmp_loci_pos); for(k=1;kdbr_shm_id>=0) { (void)shmctl(lpar->dbr_shm_id,IPC_RMID,0); lpar->dbr_shm_id=-1; lpar->dbr_flag=0; } if(perm) free(perm); if(dbr_count[0]) free(dbr_count[0]); dbr_count[0]=0; dbr_mem=0; perm=0; } void zero_dbr_count(void) { if(dbr_mem) memset(dbr_mem,0,lpar->dbr_mem_size); } void count_dbr(void) { int i,j,k,k1,k2,*kk,id,seg[2][3]; if(dbr_mem) { for(i=0;i2) { gnu_qsort(perm,(size_t)j,sizeof(int),cmp_loci_pos); for(id=0;id #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki.h" #include "ranlib.h" #include "loki_peel.h" #include "seg_pen.h" #include "gen_pen.h" #include "handle_res.h" static struct gp_rfnode **rflist,*free_rfn_list; static struct gp_rfunc_ptr **rfuncs,*free_rfp_list; static struct gp_peel_op *free_ops_list[MAX_GP_RF_GENES]; static struct gp_rfunc *free_rf_list[MAX_GP_RF_GENES],**autozyg_list; static struct deg_list *deglist,**first; static int *gp_inv,*gp_inv1,*gp_flag,*pflag,*rf_idx, **fact,*ofact,rf_idx_n,*rfxn,**rfx, *cnv_gene,gp_xx_size,mem_list_size,mem_list_ptr; static double *gp_tmp_p,*gp_z,*gp_xx; static void **mem_list; static void *realloc_and_remember(void *p,size_t size) { int i; for(i=0;iinv); free(rf->p); free(rf); } void free_gen_pen(void) { int i=0; struct gp_rfunc_ptr *rfp,*rfp1; struct gp_rfnode *rfn,*rfn1; struct gp_rfunc *rf,*rf1; struct gp_peel_op *ops,*ops1; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In free_gen_pen()\n"); #endif rfp=free_rfp_list; while(rfp) { rfp1=rfp->next; free(rfp); rfp=rfp1; } free_rfp_list=0; rfn=free_rfn_list; while(rfn) { rfn1=rfn->next; free(rfn); rfn=rfn1; } free_rfn_list=0; if(mem_list) { for(i=0;inext; free_rfunc(rf); rf=rf1; } free_rf_list[i]=0; ops=free_ops_list[i]; while(ops) { ops1=ops->next; free(ops->inv); free(ops); ops=ops1; } free_ops_list[i]=0; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_gen_pen" void alloc_gen_pen(int ngenes) { int i,n_all; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In alloc_gen_pen(%d)\n",ngenes); #endif if(!(rflist=malloc_and_remember(sizeof(void *)*ngenes))) ABT_FUNC(MMsg); if(!(autozyg_list=malloc_and_remember(sizeof(void *)*ngenes))) ABT_FUNC(MMsg); if(!(rfuncs=malloc_and_remember(sizeof(void *)*ngenes))) ABT_FUNC(MMsg); if(!(first=malloc_and_remember(sizeof(void *)*ngenes))) ABT_FUNC(MMsg); if(!(fact=malloc_and_remember(sizeof(void *)*2*ngenes))) ABT_FUNC(MMsg); rfx=fact+ngenes; if(!(deglist=malloc_and_remember(sizeof(struct deg_list)*ngenes))) ABT_FUNC(MMsg); for(i=0;in_inv=n; nc=(int)(.5+exp(log((double)n_all)*(double)n)); rf->nc=nc; if(!(rf->p=malloc(sizeof(double)*nc))) ABT_FUNC(MMsg); if(!(rf->inv=malloc(sizeof(int)*n))) ABT_FUNC(MMsg); #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("In get_new_rfunc(%d,%d): allocating new rfunc %p\n",n,n_all,(void *)rf); #endif return rf; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_new_peel_op" static struct gp_peel_op *get_new_peel_op(int n) { struct gp_peel_op *ops; if(n>MAX_GP_RF_GENES || n<1) ABT_FUNC("Illegal peel_op size\n"); ops=free_ops_list[n-1]; if(ops) { free_ops_list[n-1]=ops->next; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("In get_new_peel_op(%d): getting peel_op %p from free list\n",n,(void *)ops); #endif } else { if(!(ops=malloc(sizeof(struct gp_peel_op)))) ABT_FUNC(MMsg); ops->n_inv=n; if(!(ops->inv=malloc(sizeof(int)*n*2))) ABT_FUNC(MMsg); ops->pflag=ops->inv+n; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("In get_new_peel_op(%d): allocating new peel_op %p\n",n,(void *)ops); #endif } ops->next=0; return ops; } static struct gp_rfnode *find_rfnode(int x,int y) { struct gp_rfnode *p,**pp; pp=rflist+x; p=*pp; while(p) { if(p->y<=y) break; pp=&p->next; p=*pp; } if(!p || p->y!=y) { if((p=free_rfn_list)) free_rfn_list=p->next; else { if(!(p=malloc(sizeof(struct gp_rfnode)))) ABT_FUNC(MMsg); } p->next=*pp; p->y=y; p->rf=0; *pp=p; } return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "delete_rfnode" static void delete_rfnode(int x,int y) { struct gp_rfnode *p,**pp; pp=rflist+x; p=*pp; while(p) { if(p->y<=y) break; pp=&p->next; p=*pp; } if(!p || p->y!=y) { (void)fprintf(stderr,"node %d,%d not found",x,y); ABT_FUNC("aborting\n"); } *pp=p->next; p->next=free_rfn_list; free_rfn_list=p; } static int get_inv_list(int *inv,int i) { int k=1; struct gp_rfnode *rfn; inv[0]=i; rfn=rflist[i]; while(rfn) { inv[k++]=rfn->y; rfn=rfn->next; } return k; } static void del_rfrow(int i) { struct gp_rfnode *rfn; rfn=rflist[i]; if(rfn) { while(rfn->next) { delete_rfnode(rfn->y,i); rfn=rfn->next; } delete_rfnode(rfn->y,i); rfn->next=free_rfn_list; free_rfn_list=rflist[i]; rflist[i]=0; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("In del_rfrow(): Adding row %d to free_rfn_list\n",i); #endif } } static int qfunc(const void *s1,const void *s2) { int i1,i2; i1=*(const int *)s1; i2=*(const int *)s2; if(i1next) { j2=1; while(rfn) { k1=rfn->y; if(k1!=i) { if(gp_inv[j2]==i1) j2++; if(gp_inv[j2++]!=k1) break; rfn=rfn->next; } else { rfn=rfn->next; if(!rfn && gp_inv[j2]==i1) j2++; } } if(!rfn && j2==k-1 && gp_inv[j2]==i1) k1=1; else k1=(!rfn && j2==k)?1:0; } else { k1=k==2?1:0; } if(k1) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("Absorbing gene %d into %d\n",i1,i); #endif gp_flag[i1]|=1; p=deglist[i1].abs_list; if(p) { while(p->abs_list) p=p->abs_list; p->abs_list=deglist[i].abs_list; } else deglist[i1].abs_list=deglist[i].abs_list; deglist[i].abs_list=deglist+i1; if(deglist[i1].deg>=0) { j1=deglist[i1].deg; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("Removing %d from degree list %d (b)\n",i1,j1); #endif if(deglist[i1].prev) deglist[i1].prev->next=deglist[i1].next; else first[j1]=deglist[i1].next; if(deglist[i1].next) deglist[i1].next->prev=deglist[i1].prev; deglist[i1].deg=-1; } rfn=rflist[i1]; while(rfn) { k1=rfn->y; if(k1!=i && !gp_flag[k1]) { j2=deglist[k1].deg; if(j2>=0) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("Moving %d from degree list %d to %d (b)\n",k1,j2,j2-1); #endif if(!j2) ABT_FUNC("Internal error - degree shouldn't be zero\n"); if(deglist[k1].prev) deglist[k1].prev->next=deglist[k1].next; else first[j2]=deglist[k1].next; if(deglist[k1].next) deglist[k1].next->prev=deglist[k1].prev; deglist[k1].next=first[--j2]; deglist[k1].prev=0; if(first[j2]) first[j2]->prev=deglist+k1; first[j2]=deglist+k1; deglist[k1].deg--; } } rfn=rfn->next; } } } } } else if(autozyg_list[i]) k=1; return k-1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "clean_up" /* Only called if we exit with an incompatibility */ static void clean_up(int ngenes,struct gp_rfunc *rfl) { int i; struct gp_rfunc_ptr *rfp1,*rfp2; struct gp_rfunc *rf; for(i=0;inext; rf=rfp1->rf; if(!rf->flag) { rf->flag=1; rf->next=rfl; rfl=rf; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("[%s:%d] %s() - Adding %p to free_rfp_list\n",__FILE__,__LINE__,FUNC_NAME,(void *)rfp1); #endif rfp1->next=free_rfp_list; free_rfp_list=rfp1; rfp1=rfp2; } del_rfrow(i); } while(rfl) { rf=rfl->next; i=rfl->n_inv-1; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("[%s:%d] %s() - Adding %p to free_rf_list[%d]\n",__FILE__,__LINE__,FUNC_NAME,(void *)rfl,i); #endif rfl->next=free_rf_list[i]; free_rf_list[i]=rfl; rfl=rf; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "free_rfunc_list" static void free_rfunc_list(struct gp_rfunc *rfl) { int k; struct gp_rfunc *rf; while(rfl) { rf=rfl->next; k=rfl->n_inv-1; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("[%s:%d] %s() - Adding %p to free_rf_list[%d]\n",__FILE__,__LINE__,FUNC_NAME,(void *)rfl,k); #endif rfl->next=free_rf_list[k]; free_rf_list[k]=rfl; rfl=rf; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "gen_pen" double gen_pen(int loc,int c,int *err,int flag,int si) { int i,i1,i2,j,k,k1,k2,k3,a1,a2,n_all,n_peel,n_inv,n_out,*inv,*inv1,nc=0,*gt,**seg,ngenes1; int n_rf=0,*ff,*idx,out_idx,mtype,cpsize,ngenes,**genes,*grp=0,*pflag1,ids,idd,rec,nrec; double *xx=0,like=0.0,z1,z,z3,**freq,*freq1=0,*eff,*count1,*rflp; struct gp_rfnode *rfnode,*rfnode1,**rfnodep; struct gp_rfunc *rf,*rf1,**rf2,*rfl; struct gp_rfunc_ptr *rfp,*rfp1,*rfp2,**rfp3; struct gp_peel_op *ops,*ops1,*opslist=0; struct deg_list *degp; struct Locus *locus; struct Id_Record *id; trait_pen_func *pen=0; #ifdef TRACE_PEEL struct deg_list *degp1; if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("\nIn %s(%d,%d,%p,%d)\n",FUNC_NAME,loc,c,(void *)err,flag); #endif mtype=models[0].var.type; if(!multiple_rec && !use_student_t && (!(mtype&ST_CENSORED) || censor_mode)) pen=s_penetrance1; else pen=s_penetrance; locus=&tlocus[loc].locus; freq=locus->freq; gt=locus->gt; n_all=locus->n_alleles; if(n_all!=2) { ABT_FUNC("Only for di-allelic QTLs\n"); } ngenes=comp_ngenes[c]; genes=locus->genes; eff=tlocus[loc].eff[0]; *err=0; cpsize=comp_size[c]; if(n_genetic_groups>1) grp=tl_group[c]; else freq1=freq[0]; if(singleton_flag && c==n_comp-1) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)fputs("\nHandling singletons\n",stdout); #endif i=comp_start[c]; if(n_genetic_groups==1) { xx=gp_xx+4; for(j=0;j<2;j++) { z1=freq1[j]; for(k=j+1;k<2;k++) { z=z1*freq1[k]; xx[j*2+k]=xx[k*2+j]=z; } xx[j*2+j]=z1*z1; } count1=seg_count[0]; while(cpsize--) { if(id_array[i].res[0]) { for(j=0;j<4;j++) gp_xx[j]=xx[j]; pen(gp_xx,i,-1-loc); for(z=0.0,j=0;j<4;j++) z+=gp_xx[j]; like+=log(z); if(flag) { z1=safe_ranf()*z; z=0.0; for(j=0;j<4;j++) if(gp_xx[j]>0.0) { z+=gp_xx[j]; if(z1<=z) break; } k1=1+(j&1); k2=1+(j>>1); k=k1>k2?k1*(k1-1)/2+k2:k2*(k2-1)/2+k1; #ifdef DEBUG if(k<1 || k>=4) ABT_FUNC("Bad sampled genotype\n"); #endif if(flag&4) { count1[k1-1]+=1.0; count1[k2-1]+=1.0; } nrec=id_array[i].n_rec; k1=(locus->flag&LOCUS_SAMPLED)?gt[i]:1; if(k1!=k) { z=(k1>1)?eff[k1-2]:0.0; if(k>1) z-=eff[k-2]; for(rec=0;rec0.0) { z+=xx[j]; if(z1<=z) break; } k1=1+(j&1); k2=1+(j>>1); k=k1>k2?k1*(k1-1)/2+k2:k2*(k2-1)/2+k1; if(flag&4) { count1[k1-1]+=1.0; count1[k2-1]+=1.0; } #ifdef DEBUG if(k<1 || k>=4) ABT_FUNC("Bad sampled genotype\n"); #endif gt[i]=k; } i++; } } else { while(cpsize--) { if(id_array[i].res[0] || flag) { a1=genes[0][i]-1; k=grp[a1]; freq1=freq[k]; for(j=0;j<2;j++) { z1=freq1[j]; for(k=j+1;k<2;k++) { z=z1*freq1[k]; gp_xx[j*2+k]=gp_xx[k*2+j]=z; } gp_xx[j*2+j]=z1*z1; } if(id_array[i].res[0]) { pen(gp_xx,i,-1-loc); for(z=0.0,j=0;j<4;j++) z+=gp_xx[j]; like+=log(z); } else z=1.0; if(flag) { z1=safe_ranf()*z; z=0.0; for(j=0;j<4;j++) if(gp_xx[j]>0.0) { z+=gp_xx[j]; if(z1<=z) break; } k1=1+(j&1); k2=1+(j>>1); k=k1>k2?k1*(k1-1)/2+k2:k2*(k2-1)/2+k1; #ifdef DEBUG if(k<1 || k>=4) ABT_FUNC("Bad sampled genotype\n"); #endif if(id_array[i].res[0]) { nrec=id_array[i].n_rec; k1=(locus->flag&LOCUS_SAMPLED)?gt[i]:1; if(k1!=k) { z=(k1>1)?eff[k1-2]:0.0; if(k>1) z-=eff[k-2]; for(rec=0;rec=ngenes || a2>=ngenes) { ABT_FUNC("Internal error - invalid founder genes\n"); } #endif #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)fputs("Ind ",stdout); print_orig_id(stdout,i+1); (void)printf(": genes %d %d\n",a1,a2); } #endif if(a1==a2) { rf=autozyg_list[a1]; if(!rf) { /* Allocate rfunction when a1==a2 */ if((rf=free_rf_list[0])) free_rf_list[0]=rf->next; else rf=get_new_rfunc(1,2); rf->next=0; rf->flag=0; rf->inv[0]=a1; if((rfp=free_rfp_list)) free_rfp_list=rfp->next; else if(!(rfp=malloc(sizeof(struct gp_rfunc_ptr)))) ABT_FUNC(MMsg); rfp->next=rfuncs[a1]; rfp->rf=rf; rfuncs[a1]=rfp; xx=rf->p; for(j=0;j<2;j++) xx[j]=1.0; autozyg_list[a1]=rf; } } else { if(a1>a2) { k=a1; a1=a2; a2=k; } rfnode=find_rfnode(a1,a2); if(!rfnode->rf) { /* Is this a new combination? */ /* Allocate rfunction */ if((rf=free_rf_list[1])) free_rf_list[1]=rf->next; else rf=get_new_rfunc(2,2); rf->next=0; rf->flag=0; rf->inv[0]=a1; rf->inv[1]=a2; rfnode->rf=rf; if((rfp=free_rfp_list)) free_rfp_list=rfp->next; else if(!(rfp=malloc(sizeof(struct gp_rfunc_ptr)))) ABT_FUNC(MMsg); rfp->next=rfuncs[a1]; rfp->rf=rf; rfuncs[a1]=rfp; /* Add in reference to symmetrical node */ if((rfp=free_rfp_list)) free_rfp_list=rfp->next; else if(!(rfp=malloc(sizeof(struct gp_rfunc_ptr)))) ABT_FUNC(MMsg); rfp->next=rfuncs[a2]; rfp->rf=rf; rfuncs[a2]=rfp; rfnodep=rflist+a2; if((rfnode=free_rfn_list)) free_rfn_list=rfnode->next; else if(!(rfnode=malloc(sizeof(struct gp_rfnode)))) ABT_FUNC(MMsg); while((rfnode1=*rfnodep)) { if(rfnode1->ynext=rfnode1; *rfnodep=rfnode; break; } rfnodep=&rfnode1->next; } if(!rfnode1) { *rfnodep=rfnode; rfnode->next=0; } rfnode->y=a1; rfnode->rf=rf; xx=rf->p; for(j=0;j<4;j++) xx[j]=1.0; } else rf=rfnode->rf; } xx=rf->p; /* Add in penetrance */ if(a1!=a2) { pen(xx,i,-1-loc); z=xx[0]+xx[1]+xx[2]+xx[3]; like+=log(z); z=1.0/z; for(j=0;j<4;j++) xx[j]*=z; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) { for(k1=j=0;j<2;j++) { for(k=0;k<2;k++) { (void)printf("%d %d : %g\n",j,k,xx[k1++]); } } printf("z=%g, like=%g\n",1.0/z,like); } #endif } else { gp_tmp_p[0]=gp_tmp_p[3]=1.0; gp_tmp_p[1]=gp_tmp_p[2]=0.0; pen(gp_tmp_p,i,-1-loc); xx[0]=gp_tmp_p[0]; xx[1]=gp_tmp_p[3]; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) for(j=0;j<2;j++) (void)printf("%d : %g\n",j,xx[j]); #endif } } i++; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) { (void)fputs("Node adjacancies\n",stdout); printf("ngenes=%d\n",ngenes); for(i=0;iy); #ifdef DEBUG if(!(rflist[rfnode->y]) || rfnode->y>=ngenes) { ABT_FUNC("Internal error - adjacent node has null degree\n"); } #endif rfnode=rfnode->next; } (void)fputc('\n',stdout); } } } #endif /* Find peeling sequence using the minimum external degree approach */ /* Find degree of each node and put into linked list */ for(i=0;i=0) { j=0; for(k1=1;k1<=k;k1++) if(!gp_flag[gp_inv[k1]]) j++; deglist[i].deg=j; deglist[i].next=first[j]; deglist[i].prev=0; if(first[j]) first[j]->prev=deglist+i; first[j]=deglist+i; } } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) { (void)fputs("Degree lists\n",stdout); for(i=0;igene; (void)printf(" %d",j); degp1=degp->abs_list; while(degp1) { (void)printf("-%d",degp1->gene); degp1=degp1->abs_list; } degp=degp->next; } (void)fputc('\n',stdout); } } } #endif /* Main peeling loop */ ngenes1=ngenes; for(;;) { /* Pick a node of minimum degree */ for(i=0;igene; if(gp_flag[j]) { (void)fprintf(stderr,"Internal error when peeling gene %d from degree list %d\n",j,i); ABT_FUNC("Gene already peeled\n"); } /* Get list of genes involved */ n_inv=get_inv_list(gp_inv,j); /* Find out who we can peel */ n_peel=1; gp_inv1[0]=j; gp_flag[j]|=4; degp=deglist[j].abs_list; while(degp) { j=degp->gene; gp_flag[j]|=2; gp_inv1[n_peel++]=j; degp=degp->abs_list; } k=n_peel; for(i=1;i1) qsort(gp_inv1,n_inv,sizeof(int),qfunc); for(i=0;i",stdout); if(n_peel==n_inv) (void)fputs(" *",stdout); else { for(i=j=0;inext; rf1=rfp1->rf; if(!rf1->flag) { rf1->next=rfl; rfl=rf1; rf1->flag=1; n_rf++; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("\n[%s:%d] %s() - Adding %p to free_rfp_list\n",__FILE__,__LINE__,FUNC_NAME,(void *)rfp1); #endif rfp1->next=free_rfp_list; free_rfp_list=rfp1; rfp1=rfp2; } rfuncs[k]=0; } else { pflag[i]=0; rfp3=rfuncs+k; rfp1=*rfp3; while(rfp1) { rf1=rfp1->rf; if(!rf1->flag) { for(k1=0;k1n_inv;k1++) { k3=rf1->inv[k1]; for(k2=0;k2n_inv) { rf1->next=rfl; rfl=rf1; rf1->flag=1; n_rf++; } } if(rf1->flag) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("\n[%s:%d] %s() - Adding %p to free_rfp_list\n",__FILE__,__LINE__,FUNC_NAME,(void *)rfp1); #endif *rfp3=rfp1->next; rfp1->next=free_rfp_list; free_rfp_list=rfp1; } else rfp3=&rfp1->next; rfp1=*rfp3; } } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { rf1=rfl; while(rf1) { (void)fputc(' ',stdout); for(i=0;in_inv;i++) { (void)fputc(i?',':'(',stdout); (void)printf("%d",rf1->inv[i]); } (void)fputc(')',stdout); rf1=rf1->next; } (void)fputc('\n',stdout); } #endif /* Convert genes in rfunctions to references in gp_inv1 */ rf1=rfl; while(rf1) { for(i=0;in_inv;i++) { j=rf1->inv[i]; rf1->inv[i]=cnv_gene[j]; } rf1=rf1->next; } /* Setup output rfunction */ n_out=n_inv-n_peel; if(n_out) { if((rf=free_rf_list[n_out-1])) free_rf_list[n_out-1]=rf->next; else rf=get_new_rfunc(n_out,2); rf->next=0; rf->flag=0; xx=rf->p; nc=rf->nc; for(i=0;iinv[j++]=k1; if((rfp1=free_rfp_list)) free_rfp_list=rfp1->next; else if(!(rfp1=malloc(sizeof(struct gp_rfunc_ptr)))) ABT_FUNC(MMsg); rfp1->next=rfuncs[k1]; rfp1->rf=rf; rfuncs[k1]=rfp1; /* Fill in new adjacencies */ for(i1=0;i1rf) (void)find_rfnode(k2,k1); } } } } } /* If sampling, store peel_op */ if(flag) { /* Get new peel_op and add to opslist */ ops=get_new_peel_op(n_inv); ops->next=opslist; opslist=ops; /* Fill in details */ ops->n_peel=n_peel; ops->rfl=rfl; (void)memcpy(ops->inv,gp_inv1,n_inv*sizeof(int)); (void)memcpy(ops->pflag,pflag,n_inv*sizeof(int)); } /* Check we have enough space for rfunction indices */ if(n_rf>rf_idx_n) { rf_idx_n=n_rf; if(rf_idx) rf_idx=realloc_and_remember(rf_idx,sizeof(int)*(rf_idx_n+2*rf_idx_n*ngenes)); else rf_idx=malloc_and_remember(sizeof(int)*(rf_idx_n+2*rf_idx_n*ngenes)); if(!rf_idx) ABT_FUNC(MMsg); fact[0]=rf_idx+rf_idx_n; rfx[0]=fact[0]+rf_idx_n*ngenes; for(k1=1;k11) { for(z=1.0,i=n_inv-1;i>=0;i--) { gp_inv[i]=0; gp_z[i]=z; if(pflag[i]) z*=freq[grp[gp_inv1[i]]][0]; } } else { z1=freq1[0]; for(z=1.0,i=n_inv-1;i>=0;i--) { gp_inv[i]=0; gp_z[i]=z; if(pflag[i]) z*=z1; } } z3=z; /* Initialize output index */ for(k2=1,k1=0;k1inv; for(k1=0;k1n_inv;k1++,k2<<=1) { i2=inv[k1]; fact[i2][0]=k2; } k3=0; rflp=rfl->p; do { /* Loop through all combinations */ #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) for(j=0;j=rfl->nc) ABT_FUNC("Internal error - index out of bounds\n"); #endif z=z3*rflp[k3]; if(n_out) xx[out_idx]+=z; z1+=z; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) { (void)printf("[%d,%g]) : %g %g",k3,rfl->p[k3],z3,z); } #endif /* Bump indices to get next combination */ for(i=0;i=0;k--) { gp_z[k]=z3; if(pflag[k]) { z3*=freq1[gp_inv[k]]; } } } else { z3=gp_z[i]; if(pflag[i]) { k=gp_inv[i]; z3*=freq[grp[gp_inv1[i]]][k]; } for(k=i-1;k>=0;k--) { gp_z[k]=z3; if(pflag[k]) { k1=gp_inv[k]; z3*=freq[grp[gp_inv1[k]]][k1]; } } } } } while(iinv; for(k2=1,k1=0;k1n_inv;k1++,k2<<=1) { i2=inv[k1]; fact[i2][k]=k2; rfx[i2][rfxn[i2]++]=k; } rf_idx[k++]=0; rf1=rf1->next; } do { /* Loop through all combinations */ #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) for(j=0;j=rf1->nc) ABT_FUNC("Internal error - index out of bounds\n"); #endif z*=rf1->p[*(idx++)]; rf1=rf1->next; } if(n_out) xx[out_idx]+=z; z1+=z; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) { k1=0; rf1=rfl; while(rf1) { (void)fputc(k1?',':'(',stdout); (void)printf("[%d,%g]",rf_idx[k1],rf1->p[rf_idx[k1]]); k1++; rf1=rf1->next; } if(k1) (void)fputs(") ",stdout); (void)printf(": %g %g\n",z3,z); } #endif /* Bump indices to get next combination */ for(i=0;i=0;k--) { gp_z[k]=z3; if(pflag[k]) { z3*=freq1[gp_inv[k]]; } } } else { z3=gp_z[i]; if(pflag[i]) { k=gp_inv[i]; z3*=freq[grp[gp_inv1[i]]][k]; } for(k=i-1;k>=0;k--) { gp_z[k]=z3; if(pflag[k]) { k1=gp_inv[k]; z3*=freq[grp[gp_inv1[k]]][k1]; } } } } } while(inext; if(rfp1->rf->flag) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("[%s:%d] %s() - Adding %p to free_rfp_list\n",__FILE__,__LINE__,FUNC_NAME,(void *)rfp1); #endif *rfp3=rfp1->next; rfp1->next=free_rfp_list; free_rfp_list=rfp1; } else rfp3=&rfp1->next; rfp1=rfp2; } } /* Free used rfunctions (unless sampling) */ if(!flag) free_rfunc_list(rfl); /* Remove peeled nodes from degree list */ for(i=0;inext=deglist[k].next; else { k1=deglist[k].deg; first[k1]=deglist[k].next; } if(deglist[k].next) deglist[k].next->prev=deglist[k].prev; } del_rfrow(k); /* Mark gene as peeled */ gp_flag[k]|=2; } /* Recalculate degree for output nodes */ for(i=0;i=0) { k2=0; for(j=1;j<=k1;j++) if(!gp_flag[gp_inv[j]]) k2++; } else k2=k1; k1=deglist[k].deg; if(k1!=k2) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("Moving %d from degree list %d to %d (a)\n",k,k1,k2); #endif if(deglist[k].prev) deglist[k].prev->next=deglist[k].next; else first[k1]=deglist[k].next; if(deglist[k].next) deglist[k].next->prev=deglist[k].prev; deglist[k].next=first[k2]; deglist[k].prev=0; if(first[k2]) first[k2]->prev=deglist+k; first[k2]=deglist+k; deglist[k].deg=k2; } } } } if(flag && opslist) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)fputs("Starting sampling phase\n",stdout); #endif /* Zero sampled alleles */ (void)memset(gp_inv1,0,sizeof(int)*ngenes); ops=opslist; while(ops) { n_inv=ops->n_inv; n_peel=ops->n_peel; n_out=n_inv-n_peel; inv1=ops->inv; pflag1=ops->pflag; rfl=ops->rfl; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)fputs("Sampling",stdout); for(i=j=0;igp_xx_size) { if(gp_xx) { if(!(gp_xx=realloc_and_remember(gp_xx,sizeof(double)*nc))) ABT_FUNC(MMsg); } else { if(!(gp_xx=malloc_and_remember(sizeof(double)*nc))) ABT_FUNC(MMsg); } gp_xx_size=nc; } xx=gp_xx; for(i=0;i1) { for(z=1.0,i=n_inv-1;i>=0;i--) { gp_z[i]=z; if(pflag1[i]) { gp_inv[i]=0; z*=freq[grp[inv1[i]]][0]; } else { k=gp_inv1[inv1[i]]-1; #ifdef DEBUG if(k<0 || k>=n_all) ABT_FUNC("Internal error - unsampled allele\n"); #endif gp_inv[i]=k; } } } else { z1=freq1[0]; for(z=1.0,i=n_inv-1;i>=0;i--) { gp_z[i]=z; if(pflag1[i]) { gp_inv[i]=0; z*=z1; } else { k=gp_inv1[inv1[i]]-1; #ifdef DEBUG if(k<0 || k>=n_all) ABT_FUNC("Internal error - unsampled allele\n"); #endif gp_inv[i]=k; } } } /* Initialize output index */ for(k2=1,k1=0;k1inv; for(k2=1,k1=i=j=0;k1n_inv;k1++,k2<<=1) { i2=inv[k1]; if(pflag1[i2]) { j++; fact[i2][k]=k2; rfx[i2][rfxn[i2]++]=k; } else i+=k2*gp_inv[i2]; } if(!j) { /* R-Functions only has already sampled genes, so remove from list */ rf=rf1->next; k1=rf1->n_inv-1; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) (void)printf("[%s:%d] %s() - Adding %p to free_rf_list[%d]\n",__FILE__,__LINE__,FUNC_NAME,(void *)rf1,k); #endif rf1->next=free_rf_list[k1]; free_rf_list[k1]=rf1; *rf2=rf; } else { rf_idx[k++]=i; rf2=&rf1->next; } rf1=*rf2; } if(k==1) { k3=rf_idx[0]; rflp=rfl->p; do { /* Loop through all combinations */ /* Insert frequencies for genes we are sampling*/ /* Insert probabilities from rfunctions */ #ifdef DEBUG if(k3>=rfl->nc) ABT_FUNC("Internal error - index out of bounds\n"); #endif z=z3*rflp[k3]; xx[out_idx]+=z; z1+=z; /* Bump indices to get next combination */ for(i=0;i=0;k--) { gp_z[k]=z3; if(pflag1[k]) { z3*=freq1[gp_inv[k]]; } } } else { z3=gp_z[i]; k=gp_inv[i]; z3*=freq[grp[inv1[i]]][k]; for(k=i-1;k>=0;k--) { gp_z[k]=z3; if(pflag1[k]) { k1=gp_inv[k]; z3*=freq[grp[inv1[k]]][k1]; } } } } } while(i=rf1->nc) ABT_FUNC("Internal error - index out of bounds\n"); #endif z*=rf1->p[*(idx++)]; rf1=rf1->next; } xx[out_idx]+=z; z1+=z; /* Bump indices to get next combination */ for(i=0;i=0;k--) { gp_z[k]=z3; if(pflag1[k]) { z3*=freq1[gp_inv[k]]; } } } else { z3=gp_z[i]; k=gp_inv[i]; z3*=freq[grp[inv1[i]]][k]; for(k=i-1;k>=0;k--) { gp_z[k]=z3; if(pflag1[k]) { k1=gp_inv[k]; z3*=freq[grp[inv1[k]]][k1]; } } } } } while(i 0 then we're sampling so any problems should have been detected at the peeling stage */ if(n_out) { printf("z1 = %g, n_rf=%d",z1,n_rf); ABT_FUNC("Internal error = zero prob. in sampling step\n"); } /* If n_out==0 then this this technically still a peeling op, so a zero here might be valid (not a bug) */ #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)fputs("Returning err=-1, p = 0.0 (zero prob.) (d)\n",stdout); #endif clean_up(ngenes,rfl); printf("BB: z1 = %g, n_rf = %d\n",z1,n_rf); *err=-1; return 0.0; } if(!n_out) like+=log(z1); /* Free used rfunctions */ free_rfunc_list(rfl); /* Sample! */ z=ranf()*z1; for(z3=0.0,i=0;i0.0) { z3+=xx[i]; if(z<=z3) break; } for(j=0;j>=1; } ops1=ops->next; ops->next=free_ops_list[n_inv-1]; free_ops_list[n_inv-1]=ops; ops=ops1; } /* Sample unobserved founder genes */ for(i=0;iseg; ff=founder_flag[n_markers]; while(cpsize--) { id=id_array+i; a1=genes[X_MAT][i]-1; a2=genes[X_PAT][i]-1; k1=id->allele[X_MAT]=gp_inv1[a1]; k2=id->allele[X_PAT]=gp_inv1[a2]; if((flag&2) && !si && locus->flag&TL_LINKED) { /* Remove ambiguous segregations (cond. on ordered genotypes) */ /* Don't bother if unlinked as it buys us nothing */ if(ff[i]) seg[X_MAT][i]=seg[X_PAT][i]=-1; else { idd=id->dam; #ifdef DEBUG if(k1!=id_array[idd-1].allele[seg[X_MAT][i]]) { ABT_FUNC("Internal error - bad sampled allele\n"); } #endif if(id_array[idd-1].allele[X_MAT]==id_array[idd-1].allele[X_PAT]) seg[X_MAT][i]=-2; ids=id->sire; #ifdef DEBUG if(k2!=id_array[ids-1].allele[seg[X_PAT][i]]) { ABT_FUNC("Internal error - bad sampled allele\n"); } #endif if(id_array[ids-1].allele[X_MAT]==id_array[ids-1].allele[X_PAT]) seg[X_PAT][i]=-2; } } /* Correct residuals for new genotypes */ if(id_array[i].pruned_flag[n_markers]) k=0; else { k=k1>k2?k1*(k1-1)/2+k2:k2*(k2-1)/2+k1; if(id->res[0]) { nrec=id->n_rec; k1=(locus->flag&LOCUS_SAMPLED)?gt[i]:1; if(k1!=k) { z=(k1>1)?eff[k1-2]:0.0; if(k>1) z-=eff[k-2]; for(rec=0;recres[0][rec]+=z; } } } } gt[i++]=k; } /* Get allele counts for frequency update */ if(flag&4) { if(n_genetic_groups==1) { count1=seg_count[0]; for(i=0;i #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki.h" #include "ranlib.h" #include "loki_peel.h" #include "genedrop.h" void genedrop(int locus) { int i,**seg; seg=marker[locus].locus.seg; for(i=0;i #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki.h" #include "loki_ibd.h" void get_founders(unsigned long **found,int **inb,int **n_l,int **n_p) { int *n_longs,i,j,k,k1,ids,idd,nf,nf1,longbit,nlong,cs,comp,*n_pairs,*inbr; unsigned long *founders,*tp,*tp1,*tp2; if(!(n_longs=malloc(sizeof(int)*(2*n_comp+ped_size)))) exit(EXIT_FAILURE); n_pairs=n_longs+n_comp; inbr=n_pairs+n_comp; longbit=sizeof(long)<<3; for(i=nf1=comp=0;comp #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "get_par_probs.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_par_probs" /* Get parental probability dist., put into *val */ double get_par_probs(double *val,const int i,const int locus,pen_func pen,lk_ulong **a_set,double **freq, struct R_Func *rf) { int j,k,k1,fflag=0,nb1,n_idx,comp,n_all,n_bits; double f,f1,lf[2],*fq=0,*tmp,p=0.0,z; lk_ulong mask,cm[2],l,l1,l2,a; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("In %s(%p,%d,%d,%p)\n",FUNC_NAME,(void *)val,i,locus,(void *)pen); #endif comp=id_array[i].comp; n_all=marker[locus].n_all1[comp]; n_bits=num_bits(n_all); nb1=1<>=1; } } } } if(pen) { tmp=val; for(j=0;j=0) { /* Insert Previously computed R_Func */ if(!pen) for(j=0;j>=1; } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)fputs("get_par_probs(): inserting previously computed R-Function for ",stdout); print_orig_id(stdout,i+1); (void)fputc('\n',stdout); } #endif k1=rf[k].n_terms; if(fflag) { for(j=0;j>n_bits)&mask; if((cm[X_MAT])&(LK_ONE<>=1; } } } else { for(j=0;j>=1; } } } } } /* Add penetrances */ if(pen) { pen(val,i,locus,n_all,n_bits); p=0.0; for(j=0;j>=1; l+=nb1; } } } z=1.0/p; for(j=0;j>=1; l+=nb1; } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)printf("get_par_probs(): Returning with %g for ",p); print_orig_id(stdout,i+1); (void)fputc('\n',stdout); } #endif return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_par_probs_x" /* Get parental probability dist. for x linked markers, put into *val */ double get_par_probs_x(double *val,const int i,const int locus,pen_func pen,lk_ulong **a_set,double **freq, struct R_Func *rf) { int j,k,k1,fflag=0,nb1,sex,n_idx,comp,n_bits,n_all; double f,f1,lf[2],*fq=0,*tmp,p=0.0,z; lk_ulong mask,cm[2],l,l1,l2,a; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("In %s(%p,%d,%d,%p)\n",FUNC_NAME,(void *)val,i,locus,(void *)pen); #endif comp=id_array[i].comp; n_all=marker[locus].n_all1[comp]; n_bits=num_bits(n_all); nb1=1<>=1; } } } } if(pen) { tmp=val; for(j=0;j=0) { /* Insert Previously computed R_Func */ if(!pen) { if(sex==1) { for(j=0;j>=1; } } } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)fputs("get_par_probs(): inserting previously computed R-Function for ",stdout); print_orig_id(stdout,i+1); (void)fputc('\n',stdout); } #endif k1=rf[k].n_terms; if(fflag) { for(j=0;j>n_bits)&mask; if((cm[X_MAT])&(LK_ONE<>=1; } } } } else { if(sex==2) { for(j=0;j>=1; } } } } else { for(j=0;j>=1; l+=nb1; } } z=1.0/p; for(j=0;j>=1; l+=nb1; } } } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)printf("get_par_probs(): Returning with %g for ",p); print_orig_id(stdout,i+1); (void)fputc('\n',stdout); } #endif return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_trait_par_probs" /* Similar to get_par_probs, but for a trait locus */ double get_trait_par_probs(double *val,const int i,const int locus,trait_pen_func *pen,double **freq,struct R_Func *rf) { int j,k,fflag=0,l1,l2,n_idx,n_all; double f,*fq=0,z,z1,*tmp,*tmp1,*tmp2; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("In %s(%p,%d,%d)\n",FUNC_NAME,(void *)val,i,locus); #endif n_all=tlocus[-1-locus].locus.n_alleles; n_idx=n_all*n_all; j=id_array[i].sire; if(j && !(id_array[j-1].pruned_flag[n_markers])) fflag=1; else { k=id_array[i].group-1; #ifdef DEBUG if(k<0) ABT_FUNC("Internal error - null group\n"); #endif fq=freq[k]; } tmp=val; if((k=id_array[i].rfp)>=0) {/* Insert Previously computed R_Func */ tmp1=rf[k].p; if(fflag) for(j=0;j0.0) { z1=1.0/z; tmp=val; for(j=0;j #include #include #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #include "utils.h" #include "ranlib.h" #include "loki.h" #include "handle_res.h" double res_prior_konst; static void get_res_param(double *n,double *s) { int i,j,nrec; double y; *s=*n=0.0; if(!use_student_t) { for(i=0;i0.0) K+=log(z); else return -DBL_MAX; } else { s+=y*y; nn+=1.0; } } } else for(i=0;i0.0) K+=log(z); else return -DBL_MAX; } else { s+=y*y; nn+=1.0; } } } return K-.5*(nn*log(2.0*M_PI*residual_var[0])+s/residual_var[0]); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Recalc_Res" double Recalc_Res(int fg) { int i,j,k,k1,k2,rec,nrec,type,mtype,idx,mod; struct id_data *data; double x,y,er=0.0; for(mod=0;modflag&2) y+=id_array[i].cens[mod][0]; } else { data=id_array[i].data1[rec]+idx; if(data->flag&2) y+=id_array[i].cens[mod][rec]; } if(data->flag&ST_INTTYPE) y+=(double)data->data.value; else y+=data->data.rvalue; for(j=0;jdata.value-1; if(!(type&ST_RANDOM)) k2--; if(k2>=0) y-=models[mod].term[k].eff[k2]; } else { if(data->flag&ST_INTTYPE) x=(double)data->data.value; else x=data->data.rvalue; y-=models[mod].term[k].eff[0]*x; } } } x=fabs(id_array[i].res[mod][rec]-y); er+=x; if(fg && x>0.0) (void)printf("%d %g %g\n",i,x,er); id_array[i].res[mod][rec]=y; } } } return er; } loki/lokisrc/handle_res.h0100644000076500007650000000046410001741572014717 0ustar heathheath#define RES_PRIOR_V0 1.0 #define RES_PRIOR_S0 1.0 extern double Calc_Res_Ratio(double,double),Calc_Resprop(void); extern double Calc_CensResLike(void),Calc_ResLike(void); extern double Sample_ResVar(void); extern double Calc_Var_Prior(double); extern double Recalc_Res(int); extern double res_prior_konst; loki/lokisrc/kinship.c0100644000076500007650000000371710001741567014263 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * August 2000 * * * * kinship.c: * * * * Calculate kinship coefficients * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include "utils.h" #include "loki.h" #include "kinship.h" double kinship(const int a, const int b) { if(!(a&&b)) return 0.0; if (a==b) return 0.5+0.5*kinship(id_array[a-1].sire,id_array[a-1].dam); if(!id_array[a-1].sire) { if(b #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #ifdef USE_MONITOR #include #include #endif #include #include #include "version.h" #include "ranlib.h" #include "utils.h" #include "libhdr.h" #include "loki.h" #include "loki_peel.h" #include "seg_pen.h" #include "loki_ibd.h" #include "loki_output.h" #include "sample_rand.h" #include "loki_tlmoves.h" #include "sample_effects.h" #include "sample_nu.h" #include "calc_var_locus.h" #include "meiosis_scan.h" #include "loki_monitor.h" #include "output_recomb.h" #ifdef USE_MONITOR #include "count_dbr.h" #endif unsigned int RunID; int nrm_flag,catch_sigs,sig_caught,multiple_rec; int map_function,singleton_flag,est_aff_freq,*ibd_mode; char *Filter,*Seedfile; struct remember *RemBlock; static struct remember *FirstRemBlock; static loki_time lt; #ifdef TRACE_PEEL int *peel_trace; #endif static struct peel_mem peel_workspace; static int ranseed_set; static char *LogFile; /* Called when program receives signal */ static void int_handler(int i) { char *sigs[]={"SIGTERM","SIGQUIT","SIGHUP","SIGINT","SIGALRM","SIGVTALRM","SIGPROF","UNKNOWN"}; int j,signals[]={SIGTERM,SIGQUIT,SIGHUP,SIGINT,SIGALRM,SIGVTALRM,SIGPROF}; for(j=0;j<7;j++) if(i==signals[j]) break; if(catch_sigs && !sig_caught) { sig_caught=i; if(j>=4 && j<7) (void)fprintf(stderr,"Received signal %s: %s closing down.\n",sigs[j],LOKI_NAME); else (void)fprintf(stderr,"Received signal %s: please wait while %s closes down.\nRepeat signal to abort immediately.\n",sigs[j],LOKI_NAME); return; } (void)fprintf(stderr,"Exiting on signal %s (%d)\n",sigs[j],i); exit(i); } void FreeStuff(void) { int i,j; struct Locus *loc; #ifdef USE_MONITOR if(lpar) free_dbr_count(); if(lmon_shm_id>=0) { (void)shmctl(lmon_shm_id,IPC_RMID,0); lmon_shm_id=-1; } #else if(lpar) free(lpar); #endif if(from_abt) return; if((ranseed_set&3)==2) { if(Seedfile) (void)writeseed(Seedfile,1); else (void)writeseed("seedfile",1); } if(n_markers && marker[0].locus.seg[0]) free(marker[0].locus.seg[0]); if(Seedfile) free(Seedfile); if(LogFile) free(LogFile); if(Filter) free(Filter); if(Dumpfile) free(Dumpfile); if(Polyfile) free(Polyfile); if(Freqfile) free(Freqfile); if(Haplofile) free(Haplofile); if(Outputfile) free(Outputfile); if(OutputIBDfile) free(OutputIBDfile); if(OutputIBDdir) free(OutputIBDdir); if(OutputPosfile) free(OutputPosfile); if(id_array) free(id_array); if(founder_flag) { if(founder_flag[0]) free(founder_flag[0]); free(founder_flag); } if(marker) { if(marker[0].mterm) free(marker[0].mterm); for(i=0;ipos); free(linkage[i].ibd_list); } } free(linkage); } OutputSample(0,0); free_IBD(); free_rand(); free_sample_effects(); if(use_student_t) free_sample_nu(); seg_dealloc(); peel_dealloc(&peel_workspace); free_complex_mem(); TL_Free(); if(tlocus) { for(i=0;iseg[0]) free(loc->seg[0]); if(loc->gt) free(loc->gt); if(loc->lk_store) free(loc->lk_store); if(loc->freq) { if(loc->variance) free(loc->variance); free(loc->freq); } } free(tlocus); } if(all_set) { if(n_markers && req_set[0][0]) free(req_set[0][0]); if(n_markers && allele_trans[0]) { if(allele_trans[0][0]) free(allele_trans[0][0]); free(allele_trans[0]); } if(n_markers && all_set[0]) free(all_set[0]); if(r_func[0]) { for(i=0;i=argc) abt(__FILE__,__LINE__,"No parameter file specified\n"); /* If program terminates normally or via a signal I want it to go through * FreeStuff() so that Memory can be cleared so I can check for unfreed blocks */ if(!(FirstRemBlock=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); RemBlock=FirstRemBlock; RemBlock->pos=0; RemBlock->next=0; s_action.sa_handler=ignore_handler; s_action.sa_flags=0; (void)sigaction(SIGPIPE,&s_action,0L); #ifdef USE_MONITOR s_action.sa_handler=reaper; s_action.sa_flags=0; (void)sigaction(SIGCHLD,&s_action,0L); #endif ReadBinFiles(&LogFile,0); print_start_time(LOKI_NAME,"a",LogFile,<); AllocLokiStruct(); if((fptr=fopen(argv[optind],"r"))) i=ReadParam(fptr,argv[optind],&ranseed_set); else { (void)printf("Couldn't open '%s' for input as parameter file\nAborting...\n",argv[optind]); exit(EXIT_FAILURE); } (void)fclose(fptr); if(i) exit(EXIT_FAILURE); #ifdef USE_MONITOR /* Set up shared memory segment */ lmon_shm_id=shmget(IPC_PRIVATE,sizeof(struct lmon_param),IPC_CREAT|0600); if(lmon_shm_id<0) { perror("Failed to get shared memory segment"); ABT_FUNC(AbMsg); } /* Attach shared memory segment */ lpar=shmat(lmon_shm_id,0,0); if(lpar==(void *)-1) { perror("Failed to attach shared memory segment"); ABT_FUNC(AbMsg); } #else if(!(lpar=malloc(sizeof(struct lmon_param)))) ABT_FUNC(MMsg); #endif lpar->magic=0; lpar->dbr_flag=0; lpar->dbr_shm_id=-1; lpar->peel_trace=0; lpar->debug_level=0; lpar->si_mode=0; lpar->ibd_mode=0; #ifdef TRACE_PEEL peel_trace=&lpar->peel_trace; #endif #ifdef DEBUG debug_level=&lpar->debug_level; #endif si_mode=&lpar->si_mode; ibd_mode=&lpar->ibd_mode; #ifdef USE_MONITOR /* Start up monitor process */ start_monitor(); #endif if(atexit(FreeStuff)) ABT_FUNC("Unable to register exit function FreeStuff()\n"); if(atexit(print_end_time)) ABT_FUNC("Unable to register exit function print_end_time()\n"); s_action.sa_handler=int_handler; s_action.sa_flags=0; (void)sigaction(SIGINT,&s_action,0L); (void)sigaction(SIGHUP,&s_action,0L); (void)sigaction(SIGQUIT,&s_action,0L); (void)sigaction(SIGTERM,&s_action,0L); (void)sigaction(SIGALRM,&s_action,0L); (void)sigaction(SIGVTALRM,&s_action,0L); (void)sigaction(SIGPROF,&s_action,0L); if(tfile) { if(Dumpfile) free(Dumpfile); Dumpfile=tfile; } if(!(ranseed_set&2)) { if(!Seedfile) { if(getseed("seedfile",0)) init_ranf(135421); } else if(getseed(Seedfile,0)) init_ranf(135421); ranseed_set|=2; } if(LogFile && (tname=add_file_dir(LogFile))) { fptr=fopen(tname,"a"); free(tname); if(fptr) { (void)fputs("\n Starting state of RNG (seedfile):\n\n",fptr); (void)dumpseed(fptr,1); (void)fputc('\n',fptr); (void)fclose(fptr); } } LokiSetup(); AllocEffects(); InitValues(si_mode); seg_alloc(); peel_alloc(&peel_workspace); if(output_recomb) print_recomb(); if(limit_time>0.0) { frac=modf(limit_time,&sec); itimerval.it_value.tv_sec=(time_t)sec; itimerval.it_value.tv_usec=(time_t)(frac*1000000.0); /* Set it to trigger another timer event after 5 minutes in case * we get stuck in the peel operation */ itimerval.it_interval.tv_sec=300; itimerval.it_interval.tv_usec=0; setitimer(limit_timer_type,&itimerval,0); } SampleLoop(&peel_workspace,si_mode,read_dump_flag,append_output_flag,<); return sig_caught; } loki/lokisrc/loki.h0100644000076500007650000001523610016647673013571 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * loki.h: * * * ****************************************************************************/ #include "loki_struct.h" #include "lk_long.h" #define LUMPED_ALLELE "__LUMPED__" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif struct Id_Record { int *pruned_flag; /* Pruning on a marker x marker basis */ int *kids; double **res,**cens,**vv,*bv; double *bvsum,*bvsum2; struct id_data *data,**data1; double tp[4],tpp[2][2]; lk_ulong *temp; int sire,dam; int comp; /* Component */ int fam_code; /* Original family designation */ int ngens; int rfp; int sex,affected,group; int nkids; int flag; int n_rec; int allele[2]; int *lumped,*nhaps; }; struct output_gen { struct output_gen *next; char *file; int link_group; }; struct peel_mem { struct fset *s0; int *s1; double *s2; lk_ulong *s3; int *s4; void **s5; void **s6; double *s7; }; struct loki_data { char *file_prefix; char *Filter,*Seedfile; unsigned int RunID; int nrm_flag; int multiple_rec; int map_function,singleton_flag,est_aff_freq; }; union arg_type { char *string; int value; }; struct Id_Recode { union arg_type *recode; int flag; }; struct IBD_List { double *pos; int idx,size; }; struct Locus { double pos[2]; int *gt; /* genotypes */ int *seg[2]; /* segregation pattern */ int *genes[2]; /* Founder genes */ double *lk_store; double *variance; double **freq; double *aff_freq,*diff_freq; int n_alleles; /* In entire pedigree */ int link_group; int flag; }; struct Marker { struct Locus locus; char *name; int **group; double **counts; struct Model_Term **mterm; int *haplo; int *count_flag; union arg_type *recode; signed char **freq_set; int *m_flag; int *n_all1; /* In each component */ int **nhaps,**lump,*ngens; lk_ulong **temp; int index; int rec_flag; int lumped; int pos_set; }; struct TraitLocus { struct Locus locus; double **eff; double dom_par; unsigned long model_flag; /* Which models are affected by this locus? */ }; struct Link { char *name; int *mk_index; struct IBD_List *ibd_list; double r1[2],r2[2]; /* Map range */ int ibd_est_type; int n_markers; int type; int sample_pos; int range_set[2]; }; struct Variable { char *name; union arg_type *recode; int type; int n_levels,index,rec_flag; }; struct Model_Var { int type; int var_index; }; struct Model_Term { double *eff; struct Model_Var *vars; int n_vars; int df; int out_flag; }; struct Model { struct Model_Term *term; struct Model_Var var; int n_terms; int polygenic_flag; }; extern void sample_segs(void); extern void ReadBinFiles(char **,int); extern int ReadParam(FILE *,char *,int *); extern void AllocLokiStruct(void); extern void AllocEffects(void); extern void print_marker_name(FILE *,const int); extern size_t print_orig_id(FILE *,const int); extern size_t print_orig_id1(FILE *,const int); extern size_t print_orig_family(FILE *,const int,const int); extern void print_orig_triple(FILE *,const int); extern void print_orig_allele_id(FILE *,const int); extern size_t get_max_idlen(void); extern void LokiSetup(void); extern void FreeStuff(void); extern void InitValues(int *); extern void SampleLoop(struct peel_mem *,int *,int,int,loki_time *); extern void delete_traitlocus(const int); extern void print_allele_type1(FILE *,const int,const int); extern void print_allele_type(FILE *,const int,const int,const int); extern int get_new_traitlocus(const int); extern void loki_identity(double *,int,int); extern double phi2(int,int); extern char *fget_line(FILE *); extern char *Filter,*Seedfile,*Output_Phen,*Dumpfile,*Outputfile,*Freqfile,*Haplofile,*Polyfile; extern char *OutputPosfile,*OutputIBDfile,*OutputIBDdir; extern unsigned int RunID; extern int ped_size,n_markers,n_links,n_id_records,n_nonid_records,polygenic_flag,bv_iter,n_tloci,sex_map; extern int n_genetic_groups,n_comp,*comp_ngenes,*comp_start,*comp_size,*comp_npeel,max_tloci,min_tloci,start_tloci,extra_allele_flag; extern int catch_sigs,sig_caught,use_student_t,output_haplo,family_id,n_models,limit_timer_type; extern struct lmon_param *lpar; extern struct remember *RemBlock; extern struct Id_Record *id_array; extern struct Id_Recode id_recode,fam_recode; extern struct Marker *marker; extern struct Link *linkage; extern struct Variable *id_variable,*nonid_variable; extern struct Model *models; extern struct SparseMatRec **AIMatrix; extern struct TraitLocus *tlocus; extern struct output_gen *Output_Gen; extern double mjrgene_var,*residual_var,*additive_var,*residual_var_limit,*additive_var_limit,*grand_mean,total_maplength[2]; extern double *tau,*tau_beta,tloci_mean,lm_ratio,limit_time; extern int *res_var_set,*add_var_set,*grand_mean_set,num_iter,sample_from[2],sample_freq[2],tlocus_flag,tloci_mean_set; extern int no_overdominant,censored_flag,censor_mode,tau_mode,*debug_level; extern int *peel_trace,dump_freq,output_type,analysis; extern int multiple_rec,**founder_flag; extern int map_function,singleton_flag,est_aff_freq; extern int has_orig_id(int); extern int genv_out; /* for stat 5 EWD */ #define MAP_HALDANE 0 #define MAP_KOSAMBI 1 struct move_stats { int success; int n; }; extern struct move_stats move_stats[]; #define N_MOVE_STATS 8 #define NUM_SYSTEM_VAR 12 /* increse for stat5 EWD */ extern struct id_data syst_var[]; #define SYST_NO_OVERDOMINANT 0 #define SYST_TAU 1 #define SYST_TAU_MODE 2 #define SYST_CENSOR_MODE 3 #define SYST_DEBUG_LEVEL 4 #define SYST_LM_RATIO 5 #define SYST_PEEL_TRACE 6 #define SYST_BACKUPS 7 #define SYST_SI_MODE 8 #define SYST_IBD_OUTPUT 9 #define SYST_RNG 10 #define SYST_GENV_OUT 11 /* EWD - added to indicate whether or not to output trait genotype vectors for stat 5 computation */ #define DEFAULT_ANALYSIS 0 #define AFFECTED_ANALYSIS 1 #define NULL_ANALYSIS 2 #define IBD_ANALYSIS 4 #define ESTIMATE_IBD 8 #define OUTPUT_TYPE_ORIGINAL 0 #define OUTPUT_VERSION_2_1 1 #define OUTPUT_VERSION_2_2 2 #define OUTPUT_VERSION_2_3 3 #define DEFAULT_OUTPUT_TYPE OUTPUT_VERSION_2_3 loki/lokisrc/loki_complex_peel.c0100644000076500007650000011216410001741567016305 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * - Rockefeller University * * * * August 1997 * * * * loki_complex_peel.c: * * * * Perform peeling calculations * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #define IDX_PART_BIT 8 #define IDX_PART (1<>=n_bits1; } for(;i=0;i--) { x<<=n_bits; x|=gt[i]-1; } return x; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_new_element" /* Returns storage for storing a new non-zero element. Elements are allocated * in blocks of size hb_size */ static struct bin_node *get_new_element(const lk_ulong idx,const double p) { struct bin_node *element; struct hash_data *hd; while(hash_block->ptr>=hash_block->size) { if(!hash_block->next) { if(!(hash_block->next=malloc(sizeof(struct hash_block)))) ABT_FUNC(MMsg); hash_block=hash_block->next; hash_block->next=0; if(!(hash_block->elements=malloc(sizeof(struct bin_node)*hb_size))) ABT_FUNC(MMsg); if(!(hash_block->hd=malloc(sizeof(struct hash_data)*hb_size))) ABT_FUNC(MMsg); hash_block->size=hb_size; } else hash_block=hash_block->next; hash_block->ptr=0; } hd=hash_block->hd+hash_block->ptr; element=hash_block->elements+hash_block->ptr++; element->left=element->right=0; element->balance=0; hd->index=idx; hd->p=p; element->data=hd; n_terms++; return element; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_new_memblock" struct peel_mem_block *get_new_memblock(size_t size,int flag) { struct peel_mem_block *p; if(!(p=malloc(sizeof(struct peel_mem_block)))) ABT_FUNC(MMsg); p->index=0; p->val=0; p->size=size; p->ptr=0; p->next=0; if(flag==MRK_MBLOCK) if(!(p->index=malloc(sizeof(lk_ulong)*size))) ABT_FUNC(MMsg); if(!(p->val=malloc(sizeof(double)*size))) ABT_FUNC(MMsg); return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_rf_memory" void get_rf_memory(struct R_Func *rf,size_t size,int flag) { size_t i; struct peel_mem_block *p,*p1; p1=mem_block[flag]; i=p1->size-p1->ptr; if(size>i) { p=p1; while(p->next) { if(size<=p->next->size) break; p=p->next; } if(!(p->next)) { hb_size*=1.2; i=(size>hb_size)?size:hb_size; p=get_new_memblock(i,flag); } else { p1=p->next; p->next=p1->next; p=p1; p->ptr=0; p1=mem_block[flag]; } p->next=p1->next; p1->next=p; p1=p; } i=p1->ptr; rf->index=p1->index+i; rf->p=p1->val+i; p1->ptr+=size; mem_block[flag]=p1; } /* Insert element with index idx into the binary tree hanging off *node */ static struct bin_node *insert_node(struct bin_node *node,const lk_ulong idx,const double p,int *bal) { int bb; lk_ulong idx1; struct hash_data *hd; hd=node->data; idx1=hd->index; if(idx!=idx1) { bb=node->balance; if(idxleft) node->left=insert_node(node->left,idx,p,bal); else { node->left=get_new_element(idx,p); *bal=0; } if(!(*bal)) { switch(bb) { case -1: node=rotate_left(node); *bal=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *bal=1; } } } else { if(node->right) node->right=insert_node(node->right,idx,p,bal); else { node->right=get_new_element(idx,p); *bal=0; } if(!(*bal)) { switch(bb) { case -1: node->balance=0; *bal=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *bal=1; } } } } else { *bal=1; hd->p+=p; } return node; } /* Recursive routine for getting all elements from binary tree hanging off *node and storing * the values and indices from them in *tp and *tl */ static void get_nodes(struct bin_node *node,double *tp,lk_ulong *tl,int *j) { struct hash_data *hd; if(node->left) get_nodes(node->left,tp,tl,j); hd=node->data; tp[*j]=hd->p; tl[(*j)++]=hd->index; if(node->right) get_nodes(node->right,tp,tl,j); } /* Similar to get_nodes, but stops when the cumulative probability >= z. Allows sampling * from distribution */ static int sample_comb(struct bin_node *node,const double z,double *p,lk_ulong *idx) { struct hash_data *hd; if(node->left) if(sample_comb(node->left,z,p,idx)) return 1; hd=node->data; if(hd->p>0.0) { *p+=hd->p; if(*p>=z) { *idx=hd->index; return 1; } } if(node->right) if(sample_comb(node->right,z,p,idx)) return 1; return 0; } /* Clean up memory used */ static void free_hash_blocks(void) { struct hash_block *hb1; hash_block=first_hash_block; while(hash_block) { if(hash_block->elements) free(hash_block->elements); if(hash_block->hd) free(hash_block->hd); hb1=hash_block->next; free(hash_block); hash_block=hb1; } first_hash_block=0; } void free_complex_mem(void) { if(complex_mem) free(complex_mem); if(complex_out_p) free(complex_out_p); if(complex_freq) { if(complex_freq[0]) free(complex_freq[0]); free(complex_freq); } if(complex_pen) { if(complex_pen[0]) free(complex_pen[0]); free(complex_pen); } free_hash_blocks(); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "setup_complex_peel" static void setup_complex_peel(const struct Complex_Element *element, const int sampling,int *temp[],int *n_other,int *n_jnt,int *n_trans) { int i,j,k,k1,n_peel,n_inv,n_rf,*inv; static int complex_mem_size; n_inv=element->n_involved; n_peel=element->n_peel; n_rf=element->n_rfuncs; inv=element->involved; i=9*n_inv+n_rf+2*n_peel; if(!complex_mem) { complex_mem_size=i; if(!(complex_mem=calloc((size_t)i,sizeof(int)))) ABT_FUNC(MMsg); } else { if(i>complex_mem_size) { complex_mem_size=i; if(!(complex_mem=realloc(complex_mem,i*sizeof(int)))) ABT_FUNC(MMsg); } (void)memset(complex_mem,0,i*sizeof(int)); } temp[0]=complex_mem; for(i=1;i<10;i++) temp[i]=temp[i-1]+n_inv; for(;i<12;i++) temp[i]=temp[i-1]+n_peel; /* 'other' alleles are alleles not in R-Functions and not already sampled * (if on reverse sampling pass) */ k1=sampling?n_peel:n_inv; /* When we are sampling, the output alleles have already been sampled */ for(*n_other=i=0;iflags[i]&(HAP_JNT|HAP_DAT)) { k=-inv[i]; for(j=0;jflags[i]&IN_RF)) temp[1][(*n_other)++]=i; } *n_jnt=0; for(i=0;iflags[i]&(HAP_JNT|HAP_DAT)) { if(inv[i]>0) { k=-inv[i]; for(j=0;jflags[i]&HAD_P) { k=id_array[-inv[i]-1].sire; for(j=0;jflags[i]&HAD_M) { k=id_array[inv[i]-1].dam; for(j=0;jn_involved; /* No. alleles involved in op */ n_peel=element->n_peel; /* No. alleles to peel out (absorb) */ n_out=n_inv-n_peel; /* No. to appear in output R-Function */ n_rf=element->n_rfuncs; /* No. input R-Functions */ inv=element->involved; /* List of involved alleles (alleles to peel come first) */ /* Allocate first hash_block, if not already done so */ if(!first_hash_block) { if(!(first_hash_block=malloc(sizeof(struct hash_block)))) ABT_FUNC(MMsg); if(!(first_hash_block->elements=malloc(sizeof(struct bin_node)*hb_size))) ABT_FUNC(MMsg); if(!(first_hash_block->hd=malloc(sizeof(struct hash_data)*hb_size))) ABT_FUNC(MMsg); first_hash_block->next=0; first_hash_block->size=hb_size; } /* Reset pointers to all hash_blocks */ hash_block=first_hash_block; while(hash_block) { hash_block->ptr=0; hash_block=hash_block->next; } hash_block=first_hash_block; n_terms=0; /* No. non-zero terms in output R-Function */ /* if s_flag is non-zero then we are doing a sampling run */ /* if s_flag&OP_SAMPLING then we are on the reverse (sampling) phase */ /* In any case, if !n_out and s_flag then we can sample */ if(s_flag) { if(s_flag&OP_SAMPLING) sampling=1; else if(!n_out) sampling=1; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%d,%p,%d,%p,%p)\n",FUNC_NAME,(void *)element,locus,s_flag,(void *)pen,n_all,(void *)rf,(void *)freq); if(CHK_PEEL(TRACE_LEVEL_2)) { for(i=0;iindex[i]; n_ind=rf[j].n_ind; for(k=0;k(int)LK_LONG_BIT) { (void)fprintf(stderr,"\nToo many individuals in output R-Function for marker %s\nn_peel = %d, n_all = %d, n_bits1 = %d, required size = %d, LONG_BIT = %d\n",marker[locus].name,n_peel,n_all,n_bits1,n_peel*n_bits1,LK_LONG_BIT); ABT_FUNC(AbMsg); } hash_mode=(log(2.0)*kindex[i]; n_ind=rf[j].n_ind; a=0; k2=0; b=(LK_ONE<=0;k--) { a<<=n_bits1; k1=rf[j].id_list[k]; if(gt_store[k1]) a|=b; else { k2|=LK_ONE<max_fnd) { max_fnd=n_fnd; tp=complex_freq[0]; if(!(complex_freq=realloc(complex_freq,sizeof(void *)*n_fnd))) ABT_FUNC(MMsg); complex_freq[0]=tp; } if(n_fnd*n_all>max_all) { max_all=n_all*n_fnd; if(!(complex_freq[0]=realloc(complex_freq[0],sizeof(double)*max_all))) ABT_FUNC(MMsg); } } for(i=1;i0 && id_array[k1].res[0]) pen_list[n_pen++]=k1; else if(linktype==LINK_X && inv[k]<0 && id_array[k1].res[0]) pen_list[n_pen++]=k1; } /* Pre-calculate penetrances */ if(n_pen) { if(!complex_pen) { if(!(complex_pen=malloc(sizeof(void *)*n_pen))) ABT_FUNC(MMsg); max_pen1=n_pen*n_idx; if(!(complex_pen[0]=malloc(sizeof(double)*max_pen1))) ABT_FUNC(MMsg); max_pen=n_pen; } else { if(n_pen>max_pen) { max_pen=n_pen; if(!(complex_pen=realloc(complex_pen,sizeof(void *)*n_pen))) ABT_FUNC(MMsg); } if(n_pen*n_idx>max_pen1) { max_pen1=n_pen*n_idx; if(!(complex_pen[0]=realloc(complex_pen[0],sizeof(double)*max_pen1))) ABT_FUNC(MMsg); } } for(k1=0;k10) gt_store[j+n_peel]=id_array[k-1].allele[X_MAT]; else gt_store[j+n_peel]=id_array[-k-1].allele[X_PAT]; } /* Cycle through R-Functions */ for(;iindex[i]; ef=0; n_ind=rf[j].n_ind; /* Find term consistent with what's already been set up */ a=rf[j].mask[sampling]; if(a) { b=0; for(k=n_ind-1;k>=0;k--) { b<<=n_bits1; k1=rf[j].id_list[k]; if(gt_store[k1]) b|=gt_store[k1]-1; } b&=a; k1=rf[j].n_terms; tl=rf[j].index; k=rf_ptr[i]; for(;k>=1; } do { if(!i) { ef1=1; break; } rf_ptr[i--]=0; rf_ptr[i]++; j=element->index[i]; k2=rf[j].mask1[sampling]; k=0; while(k2) { if(k2&1) gt_store[k]=0; k++; k2>>=1; } } while(rf_ptr[i]>=rf[j].n_terms); i--; } if(ef1) break; } if(ef1) break; /* We have a consistent configuration from the R-Functions, now find 1 for the 'other' alleles */ for(ef=i=0;i<=n_other;i++) { if(i==n_other) { if(!ef) { for(k=0;kindex[k]].p[rf_ptr[k]]; #ifdef DEBUG if(p1<0.0) { fprintf(stderr,"Internal error - p1 = %g\n",p1); ABT_FUNC("Aborting\n"); } #endif for(k1=0;k1data; hd->p+=p1; } } else { k=(a>>idx_shift); if(hashtable[k]) { hashtable[k]=insert_node(hashtable[k],a,p1,&k1); } else hashtable[k]=get_new_element(a,p1); } ef=1; } } } /* Find next combination */ if(ef) { i--; while(i>=0) { other_ptr[i]++; gt_store[other_list[i]]=0; if(other_ptr[i]flags[k1]&(HAP_JNT|HAP_DAT)) { k2=jnt_list[k1]; if(inv[k1]>0) { if(gt_store[k2]) { b=LK_ONE<<(gt_store[k2]-1); for(k=other_ptr[i];k0) { for(k=other_ptr[i];kindex[i]; k2=rf[j].mask1[sampling]; if(k2) { k=0; while(k2) { if(k2&1) gt_store[k]=0; k++; k2>>=1; } if(rf_ptr[i]=0); if(i>=0) ef=0; } else i=0; if(ef) break; } /* All valid combinations have been visited. Have we found any ? */ if(!n_terms) ABT_FUNC("Zero probability!\n"); #ifdef DEBUG if(prob<=0.0) { fprintf(stderr,"Error - probability = %g\n",prob); ABT_FUNC("Aborting\n"); } #endif /* If sampling then sample from output function */ if(sampling) { do { z=safe_ranf()*prob; p1=0.0; for(j=k=0;kdata; if(hd->p>0.0) { p1+=hd->p; if(z<=p1) { a=(lk_ulong)k; break; } } } else if(sample_comb(elem,z,&p1,&a)) break; } if(k==ht_size) { ABT_FUNC("Internal error\n"); } } while(k==ht_size); get_gts(a,n_peel,gt_store); #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) fputs("Sampled: ",stdout); #endif for(i=0;i0) { id_array[j-1].allele[X_MAT]=gt_store[i]; id_array[j-1].flag|=SAMPLED_MAT; } else { id_array[-j-1].allele[X_PAT]=gt_store[i]; id_array[-j-1].flag|=SAMPLED_PAT; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { fputc(i?',':'(',stdout); printf("%d",gt_store[i]); } #endif } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) fputs(")\n",stdout); #endif } else { /* Otherwise normalize and store */ i=element->out_index; if(i>=0) { rf[i].n_terms=n_terms; get_rf_memory(rf+i,n_terms,MRK_MBLOCK); tl=rf[i].index; tp=rf[i].p; if(hash_mode) { for(j=k=0;kdata; tp[j]=hd->p; tl[j++]=(lk_ulong)k; } } else { for(j=k=0;kn_involved; /* No. alleles involved in op */ n_peel=element->n_peel; /* No. allles to peel out (absorb) */ n_out=n_inv-n_peel; /* No. to appear in output R-Function */ n_rf=element->n_rfuncs; /* No. input R-Functions */ inv=element->involved; /* List of involved alleles (alleles to peel come first) */ /* if s_flag is non-zero then we are doing a sampling run */ /* if s_flag&OP_SAMPLING then we are on the reverse (sampling) phase */ /* In any case, if !n_out and s_flag then we can sample */ if(s_flag) { if(s_flag&OP_SAMPLING) sampling=1; else if(!n_out) sampling=1; } /* In a sampling operation we sample the peeled alleles conditional on * R-Functions and on the pivot (output) alleles which have all already been sampled */ #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%d,%p,%p,%p)\n",FUNC_NAME,(void *)element,locus,s_flag,(void *)rf,(void *)trait_pen,(void *)freq); if(CHK_PEEL(TRACE_LEVEL_2)) { for(i=0;iindex[i]; n_ind=rf[j].n_ind; for(k=0;kout_p_size) { out_p_size=i+n_rf; if(!(complex_out_p=realloc(complex_out_p,sizeof(double)*out_p_size))) ABT_FUNC(MMsg); } p_rf=complex_out_p+i; for(j=0;jindex[i]; n_ind=rf[j].n_ind; k2=0; k3=1; for(k=n_ind-1;k>=0;k--) { k1=rf[j].id_list[k]; if(!gt_store[k1]) { k2|=LK_ONE<max_pen) { max_pen=n_pen; if(!(complex_pen=realloc(complex_pen,sizeof(void *)*n_pen))) ABT_FUNC(MMsg); } if(n_pen*n_idx>max_pen1) { max_pen1=n_pen*n_idx; if(!(complex_pen[0]=realloc(complex_pen[0],sizeof(double)*max_pen1))) ABT_FUNC(MMsg); } } for(k1=0;k10) gt_store[j+n_peel]=id_array[k-1].allele[X_MAT]; else gt_store[j+n_peel]=id_array[-k-1].allele[X_PAT]; } /* Cycle through R-Functions */ for(;iindex[i]; ef=0; n_ind=rf[j].n_ind; /* Find term consistent with what's already been set up */ k3=rf_ptr[i]; k2=0; for(k=n_ind-1;k>=0;k--) { k1=rf[j].id_list[k]; if(!gt_store[k1]) { gt_store[k1]=1+(k3%n_all); k3/=n_all; } k2=k2*n_all+gt_store[k1]-1; } p_rf[i]=rf[j].p[k2]; if(p_rf[i]<=0.0) {/* Inconsistent - find the next 1 */ for(;;) { k2=rf[j].mask1[sampling]; k=0; while(k2) { if(k2&1) gt_store[k]=0; k++; k2>>=1; } if(++rf_ptr[i]index[i]; } i--; } if(ef1) break; } if(ef1) break; for(ef=i=0;i<=n_other;i++) { if(i==n_other) { if(!ef) { /* Add Parent-off transmission probs. */ p1=1.0; if(!ef) for(k=0;k=0;k--) k1=k1*n_all+gt_store[k]-1; else for(k=n_inv-1;k>=n_peel;k--) k1=k1*n_all+gt_store[k]-1; complex_out_p[k1]+=p1; k1=0; for(k=n_inv-1;k>=0;k--) k1=k1*n_all+gt_store[k]-1; ef=1; } } } /* Find next combination */ if(ef) { i--; while(i>=0) { other_ptr[i]++; gt_store[other_list[i]]=0; if(other_ptr[i]index[i]; k2=rf[j].mask1[sampling]; if(k2) { k=0; while(k2) { if(k2&1) gt_store[k]=0; k++; k2>>=1; } if(rf_ptr[i]=0); if(i>=0) ef=0; } else i=0; if(ef) break; } /* All valid combinations have been visited. Have we found any ? */ if(prob<=0.0) { if(!(s_flag&1)) return -DBL_MAX; ABT_FUNC("Zero probability!\n"); } n_terms=(int)(.5+exp(max_terms)); /* If sampling then sample from output function */ if(sampling) { do { z=ranf()*prob; p1=0.0; for(k=0;k0.0) { p1+=complex_out_p[k]; if(z<=p1) break; } } } while(k==n_terms); for(k1=0;k10) { id_array[j-1].allele[X_MAT]=gt_store[i]; id_array[j-1].flag|=SAMPLED_MAT; } else { id_array[-j-1].allele[X_PAT]=gt_store[i]; id_array[-j-1].flag|=SAMPLED_PAT; } } } else { /* Otherwise normalize and store */ i=element->out_index; if(i>=0) { get_rf_memory(rf+i,n_terms,TRT_MBLOCK); for(j=0;j #include #include #include #include #include #include #include #include #include "utils.h" #include "loki.h" #include "libhdr.h" #include "loki_peel.h" #include "loki_output.h" #include "sample_rand.h" #include "loki_ibd.h" #include "loki_dump.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "read_dump" int read_dump(int *lp,int *lp1,int *n_ibd,long *old_pos,int *flag,int analysis,loki_time *lt) { int i=0,j,k,k1,k2,nl=0,type,nrec,v2[4],pflag=0; char *tmp,*tmp1; double v1[4],z; FILE *fdump; signal(SIGCHLD,SIG_IGN); k=k1=k2=0; if(Filter) { errno=0; i=child_open(READ,Dumpfile,Filter); fdump=fdopen(i,"r"); if(errno && errno!=ESPIPE) i=__LINE__; else i=0; errno=0; } else fdump=fopen(Dumpfile,"r"); if(!fdump || i) (void)fprintf(stderr,"[%s:%d] %s(): File Error. Couldn't open '%s' for input\n",__FILE__,__LINE__,FUNC_NAME,Dumpfile); else { if(!(tmp=fget_line(fdump))) i=__LINE__; if(!i && strncmp(tmp,"Loki.dump:",10)) i=__LINE__; if(!i) { tmp1=tmp+10; for(j=0;!i && j<2;j++) { if(j && (*tmp1++!=',')) i=__LINE__; else v2[j]=strtol(tmp1,&tmp,16); tmp1=tmp; } } if(!i) { *lp=(int)v2[0]; *lp1=(int)v2[1]; } if(!i && (analysis&IBD_ANALYSIS)) { if(analysis&ESTIMATE_IBD) i=read_ibd_dump(fdump,n_ibd,tmp); else if(*tmp!='\n') i=__LINE__; } (void)fputs("[Parameters] ",stdout); (void)fflush(stdout); if(!(analysis&IBD_ANALYSIS)) { for(j=0;!i && j<3;j++) { if(*tmp1++!=',') i=__LINE__; else v2[j]=strtol(tmp1,&tmp,16); tmp1=tmp; } if(!i) { nl=(int)v2[0]; n_cov_columns=(int)v2[2]; k=3; if(polygenic_flag) k++; for(j=0;!i && j=k) i=__LINE__; } if(k2) for(j=0;!i && j='0'&&k1<='9') k1-='0'; else if(k1>='a'&&k1<='f') k1-='a'-10; else i=__LINE__; if(!i) { tlocus[j].locus.seg[1][k]=(k1&3)-2; tlocus[j].locus.seg[0][k]=(k1>>2)-2; } } if(!i && *tmp!='\n') i=__LINE__; } if(!(tmp=fget_line(fdump))) i=__LINE__; else if(strncmp(tmp,"LKQG\n",5)) i=__LINE__; for(k=0;!i && k='0'&&k1<='9') k1-='0'; else if(k1>='a'&&k1<='f') k1-='a'-10; else i=__LINE__; if(!i) { marker[j].locus.seg[1][k]=(k1&3)-2; marker[j].locus.seg[0][k]=(k1>>2)-2; } } if(!i && *tmp!='\n') i=__LINE__; } for(k=j=0;!i && j=n_markers || !marker[k2].mterm[0]) i=__LINE__; else tmp=tmp1; } if(!i && *tmp++!='\n') i=__LINE__; for(k=0;!i && kextra_time)) i=__LINE__; if(!i && *tmp1++!=',') i=__LINE__; if(!i && txt_get_double(tmp1,&tmp,<->extra_stime)) i=__LINE__; if(!i && *tmp++!=',') i=__LINE__; if(!i && txt_get_double(tmp,&tmp1,<->extra_utime)) i=__LINE__; if(!i && *tmp1!='\n') i=__LINE__; if(!i && !(tmp=fget_line(fdump))) i=__LINE__; } if(!i && strncmp(tmp,"Ldmp.end\n",9)) i=__LINE__; } } } (void)fget_line(0); if(fdump) (void)fclose(fdump); if(i) (void)fprintf(stderr,"[%s:%d] Error in %s() ",__FILE__,i,FUNC_NAME); (void)fget_line(0); if(!i && pflag==2) (void)fputs("Polygenic summary information not in file\n",stdout); signal(SIGCHLD,SIG_DFL); while(waitpid(-1,&i,WNOHANG)>0); return -i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "write_dump" void write_dump(int lp,int lp1,int n_ibd,long old_pos,int flag,int analysis,loki_time *lt) { int i=0,j,k,k1,k2,nx,nl=0,type,nrec; double ex1,ex2; struct tms tbuf; long tps; FILE *fdump; signal(SIGCHLD,SIG_IGN); (void)fputs("Dumping program state: ",stdout); (void)fflush(stdout); if(!Dumpfile) Dumpfile=make_file_name(".dump"); if(Dumpfile) { j=syst_var[SYST_BACKUPS].flag?syst_var[SYST_BACKUPS].data.value:1; if(j) i=mkbackup(Dumpfile,j); if(!i) { if(Filter) { errno=0; i=child_open(WRITE,Dumpfile,Filter); fdump=fdopen(i,"w"); if(errno && errno!=ESPIPE) i=1; else i=0; errno=0; } else fdump=fopen(Dumpfile,"w"); if(!fdump || i) (void)fprintf(stderr,"[%s:%d] %s(): File Error. Couldn't open '%s' for output\n",__FILE__,__LINE__,FUNC_NAME,Dumpfile); else { if(!i && fprintf(fdump,"Loki.dump:%x,%x",lp,lp1)<0) i=1; if(!i && (analysis&IBD_ANALYSIS)) { if(analysis&ESTIMATE_IBD) i=write_ibd_dump(fdump,n_ibd); else if(fputc('\n',fdump)<0) i=1; } (void)fputs("[Parameters] ",stdout); (void)fflush(stdout); if(!(analysis&IBD_ANALYSIS)) { nx=0; if(models) { for(j=0;jextra_time+difftime(time(0),lt->start_time),fdump); if(!i) { ex1=lt->extra_stime; ex2=lt->extra_utime; tps=sysconf (_SC_CLK_TCK); errno=0; (void)times(&tbuf); if(errno) perror("print_end_time():"); else { ex1+=(double)tbuf.tms_stime/(double)tps; ex2+=(double)tbuf.tms_utime/(double)tps; } } if(!i && fputc(',',fdump)<0) i=1; if(!i) i=txt_print_double(ex1,fdump); if(!i && fputc(',',fdump)<0) i=1; if(!i) i=txt_print_double(ex2,fdump); if(!i && fputc('\n',fdump)<0) i=1; } if(!i && fputs("Ldmp.end\n",fdump)<0) i=1; } if(fdump) { (void)fclose(fdump); if(i) (void)unlink(Dumpfile); } } } else i=1; if(i) (void)fputs("FAILED\n",stdout); else (void)fputs("OK\n",stdout); signal(SIGCHLD,SIG_DFL); while(waitpid(-1,&i,WNOHANG)>0); } loki/lokisrc/loki_dump.h0100644000076500007650000000020410001741572014566 0ustar heathheathextern int read_dump(int *,int *,int *,long *,int *,int,loki_time *); extern void write_dump(int,int,int,long,int,int,loki_time *); loki/lokisrc/loki_ibd.c0100644000076500007650000006727110016650374014400 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - Rockefeller University * * * * February 1998 * * * * loki_ibd.c: * * * * Routines for estimating pairwise IBD matrices * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include #include #include #include #include "ranlib.h" #include "utils.h" #include "libhdr.h" #include "loki.h" #include "loki_peel.h" #include "loki_ibd.h" #include "seg_pen.h" static double *pos_list; static unsigned int ***ibd[2]; static int *loci,*seg[2],*n_longs,*n_pairs,*inbr,**inb_sparse,**inb_sparse1; static unsigned long *founders; void get_founder_params(unsigned long **fnd,int **nl,int **np,int **in) { if(!founders) get_founders(&founders,&inbr,&n_longs,&n_pairs); if(fnd) *fnd=founders; if(in) *in=inbr; if(np) *np=n_pairs; if(nl) *nl=n_longs; } void free_IBD(void) { int i; if(ibd[0]) { if(ibd[0][0]) { if(ibd[0][0][0]) free(ibd[0][0][0]); free(ibd[0][0]); } free(ibd[0]); } if(loci) free(loci); if(seg[0]) free(seg[0]); if(founders) free(founders); if(n_longs) free(n_longs); if(pos_list) free(pos_list); if(inb_sparse) { for(i=0;i1) { for(link=0;link1) gnu_qsort(loci,(size_t)nloci,sizeof(int),cmp_loci_pos); for(k=0;k=0?marker[lk].locus.seg:tlocus[-1-lk].locus.seg; } for(par_flag=0;par_flag<2;par_flag++) { lk=loci[0]; x=(lk>=0)?marker[lk].locus.pos[par_flag]:tlocus[-1-lk].locus.pos[par_flag]; for(k=1;k=0)?marker[lk].locus.pos[par_flag]:tlocus[-1-lk].locus.pos[par_flag]; recom[par_flag][k-1]=.5*(1.0-exp(0.02*(x-x1))); x=x1; } } for(i=i1;i=0;k--) { s1=seglist[k][par_flag][kid]; if(s1<0) { pp[s]=p[s][k]*(1.0-r[k]); pp[s^1]=p[s^1][k]*r[k]; z=pp[0]+pp[1]; z1=ranf(); s1=(z*z1idx; break; case IBD_EST_MARKERS: k=linkage[i].n_markers; break; case IBD_EST_GRID: k=1+(int)(.5+(linkage[i].ibd_list->pos[1]-linkage[i].ibd_list->pos[0])/linkage[i].ibd_list->pos[2]); break; } if(k>k1) k1=k; j+=k; } if(j) { /* Allocate memory for j triangular matrices */ if(!(pos_list=malloc(sizeof(double)*k1))) ABT_FUNC(MMsg); for(np=i=0;i=0;k--) { k1=perm[k]; if(k1<0) { if(id_array[i].pruned_flag[n_markers] || id_array[ids-1].pruned_flag[n_markers] || !(tlocus[-1-k1].locus.flag&LOCUS_SAMPLED)) continue; k2=tlocus[-1-k1].locus.seg[X_MAT][i]; if(k2<0) continue; theta=.5*(1.0-exp(-0.02*(pos[X_MAT]-tlocus[-1-k1].locus.pos[X_MAT]))); } else { if(marker[k1].n_all1[comp]<2) continue; if(id_array[i].pruned_flag[k1] || id_array[ids-1].pruned_flag[k1] || !(marker[k1].locus.flag&LOCUS_SAMPLED)) continue; k2=marker[k1].locus.seg[X_MAT][i]; if(k2<0) continue; theta=.5*(1.0-exp(-0.02*(pos[X_MAT]-marker[k1].locus.pos[X_MAT]))); } Mtp[k2]=1.0-theta; Mtp[1-k2]=theta; break; } for(k=idx-1;k>=0;k--) { k1=perm[k]; if(k1<0) { if(id_array[i].pruned_flag[n_markers] || id_array[ids-1].pruned_flag[n_markers] || !(tlocus[-1-k1].locus.flag&LOCUS_SAMPLED)) continue; k2=tlocus[-1-k1].locus.seg[X_PAT][i]; if(k2<0) continue; theta=.5*(1.0-exp(-0.02*(pos[X_PAT]-tlocus[-1-k1].locus.pos[X_PAT]))); } else { if(marker[k1].n_all1[comp]<2) continue; if(id_array[i].pruned_flag[k1] || id_array[ids-1].pruned_flag[k1] || !(marker[k1].locus.flag&LOCUS_SAMPLED)) continue; k2=marker[k1].locus.seg[X_PAT][i]; if(k2<0) continue; theta=.5*(1.0-exp(-0.02*(pos[X_PAT]-marker[k1].locus.pos[X_PAT]))); } Ptp[k2]=1.0-theta; Ptp[1-k2]=theta; break; } for(k=idx;kidx; for(j=0;jpos[j]; break; case IBD_EST_MARKERS: n=nl; for(j=0;jpos[0]; pos_list[n++]=x; x+=linkage[i].ibd_list->pos[2]; if(linkage[i].ibd_list->pos[2]>0.0) { for(;x<=linkage[i].ibd_list->pos[1];x+=linkage[i].ibd_list->pos[2]) pos_list[n++]=x; } else { for(;x>=linkage[i].ibd_list->pos[1];x+=linkage[i].ibd_list->pos[2]) pos_list[n++]=x; } break; } return n; } void Handle_IBD(void) { int i,i1,i2,i3,i4,j,k,k1,kk,ix=0,*genes[2],nl,s,comp,g0,g1,g2,g3,cs,ids,idd,np,kk1; int *pp,ct; unsigned int **ibd1[2]; double x,z,ps[2],tp[2]; genes[0]=loci+n_markers; genes[1]=genes[0]+ped_size; for(i=0;i=x) break; /* Should extend this to allow for sex-specific maps later */ ps[0]=ps[1]=x; for(i1=0,comp=0;comp0.0) { l+=z/pairs[k4]; (*k5)++; } else if(z>0.0) { (void)fprintf(stderr,"[%d %d %d %d %d %d (%d %d) (%d %d)]\n",comp,i,j,i1,i2,k4,genes[0][i1],genes[1][i1],genes[0][i2],genes[1][i2]); print_orig_id(stderr,i1+1); (void)fputc(',',stderr); print_orig_id(stderr,i2+1); (void)fputc('\n',stderr); ABT_FUNC("OOOK!\n"); } k4++; } } return l; } static int print_pair(FILE *fptr,int i,int j) { int k=0; if(has_orig_id(i) && has_orig_id(j)) { if(family_id) { print_orig_family(fptr,i,0); (void)fputc(' ',fptr); } print_orig_id1(fptr,i); (void)fputc(' ',fptr); print_orig_id1(fptr,j); k=1; } return k; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "open_ibd_file" static FILE *open_ibd_file(char *name,int md) { int i,j,k=0; char *fname; FILE *fptr; if(md&COMPRESS_IBD) { j=0; i=(int)strlen(name); if(i>3 && !strcmp(name+i-3,".gz")) j=1; if(!j) { if(!(fname=malloc(i+4))) ABT_FUNC(MMsg); memcpy(fname,name,i); strcpy(fname+i,".gz"); k=1; } else fname=name; errno=0; i=child_open(WRITE,fname,IBD_COMPRESS_PROG); fptr=fdopen(i,"w"); if(errno && errno!=ESPIPE) i=1; else i=0; errno=0; } else { fname=name; fptr=fopen(fname,"w"); i=0; } if(i || !fptr) abt(__FILE__,__LINE__,"%s(): File Error. Couldn't open '%s' for output\n",FUNC_NAME,fname); printf("Writing IBD matrices to file %s\n",fname); if(k) free(fname); return fptr; } int read_ibd_dump(FILE *fdump,int *n_ibd,char *tmp) { int link,k,j,k1,k2=0,comp,i=0; char *tmp1; for(k=link=0;linkidx; break; case IBD_EST_MARKERS: k=linkage[link].n_markers; break; case IBD_EST_GRID: k=1+(int)(.5+(linkage[link].ibd_list->pos[1]-linkage[link].ibd_list->pos[0])/linkage[link].ibd_list->pos[2]); break; } if(k>k1) k1=k; j+=k; } if(*tmp++!=',') i=__LINE__; if(!i) { k1=(int)strtol(tmp,&tmp1,16); if(k1!=j) i=__LINE__; } if(!i && *tmp1++!=',') i=__LINE__; if(!i) { *n_ibd=(int)strtol(tmp1,&tmp,16); if(*tmp!='\n') i=__LINE__; } for(comp=0;!i && compidx; break; case IBD_EST_MARKERS: k=linkage[link].n_markers; break; case IBD_EST_GRID: k=1+(int)(.5+(linkage[link].ibd_list->pos[1]-linkage[link].ibd_list->pos[0])/linkage[link].ibd_list->pos[2]); break; } if(k>k1) k1=k; j+=k; } if(fprintf(fdump,",%x,%x\n",j,n_ibd)<0) i=1; for(comp=0;!i && comps2) (void)fprintf(fptr,"%5d %5d",s1,s2); else (void)fprintf(fptr,"%5d %5d",s2,s1); (void)fprintf(fptr," %10.7f %10.7f\n",0.5,0.0); } else { ct=ibd1[0][i2]; if(ct) { if(s1>s2) (void)fprintf(fptr,"%5d %5d",s1,s2); else (void)fprintf(fptr,"%5d %5d",s2,s1); (void)fprintf(fptr," %10.7f %10.7f\n",(double)ct*z,(double)ibd1[1][i2]*z); } i2++; } } (void)fprintf(fptr,"%5d %5d",trans[i1+i],trans[i1+i]); if(inbr[i1+i]) { ct=ibd1[0][i2++]; if(ct) (void)fprintf(fptr," %10.7f %10.7f\n",(double)ct*z,1.0); } else (void)fprintf(fptr," %10.7f %10.7f\n",1.0,1.0); } i1+=comp_size[comp]; } fclose(fptr); k++; } free(fname); } } if(!OutputIBDdir) free(dname); while(waitpid(-1,&i,WNOHANG)>0); } loki/lokisrc/loki_ibd.h0100644000076500007650000000136610001741572014371 0ustar heathheathvoid free_IBD(void); void set_n_ibd_rec(int); int get_n_ibd_rec(void); int SetupIBD(void); void Handle_IBD(void); double score_ibd(int,int *,int,int,int *,double *,int); void get_founders(unsigned long **,int **,int **,int **); void Output_Sample_IBD(int,int); void Output_Merlin_IBD(int,int); void Output_Solar_IBD(int,int,int *); void get_founder_params(unsigned long **,int **,int **,int **); int write_ibd_dump(FILE *,int); int read_ibd_dump(FILE *,int *,char *); #define IBD_MIN_GRID_STEP .0001 #define IBD_MAX_GRID 10000 #define IBD_EST_DISCRETE 1 #define IBD_EST_MARKERS 2 #define IBD_EST_GRID 3 #define DEFAULT_IBD_MODE 0 #define MERLIN_IBD_MODE 1 #define SOLAR_IBD_MODE 2 #define IBD_MODE_MASK 3 #define IBD_SINGLE_POINT 4 #define COMPRESS_IBD 8 loki/lokisrc/loki_identity.c0100644000076500007650000001031610001741567015456 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - Rockefeller University * * * * October 1997 * * * * loki_identity.c: * * * * Calculate the 9 condensed identity coefficients for relative pairs * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "loki_ibd.h" #define SWAP (a,b) {swap_temp=(a);(a)=(b);(b)=swap_temp;} static double coeffmat[9][9]={ {0,0,0,.25,-.25,-.25,.25,0,0}, {1,-1,-1,-.25,.25,.25,-.25,1,0}, {0,0,0,-1,1,.5,-.5,0,0}, {-2,2,1,1,-1,-.5,.5,-1,0}, {0,0,0,-1,.5,1,-.5,0,0}, {-2,1,2,1,-.5,-1,.5,-1,0}, {0,0,0,0,0,0,-.5,0,.5}, {0,0,0,4,-2,-2,2,0,-1}, {4,-2,-2,-4,2,2,-1.5,1,.5}}; double phi2(int a, int b) { double x; int swap_temp; if(!(a&&b)) x=0.0; else if (a==b) x=0.5+0.5*phi2(id_array[a-1].sire,id_array[a-1].dam); else { if(ay) return -1; if(x0.0) { y[0]=1.0; y[1]=2.0*phi2(a,a); y[2]=2.0*phi2(b,b); y[3]=4.0*p2; y[4]=8.0*phi3(a,a,b); y[5]=8.0*phi3(a,b,b); y[6]=16.0*phi4(a,a,b,b); y[7]=4.0*phi22(a,a,b,b); y[8]=16.0*phi22(a,b,a,b); for(i=0;i<9;i++) for(j=0;j<9;j++) k[i]+=coeffmat[i][j]*y[j]; } else k[8]=1.0; } loki/lokisrc/loki_init.c0100644000076500007650000001637010001742417014571 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - Rockefeller University * * * * October 1997 * * * * loki_init.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #ifdef HAVE_LIMITS_H #include #endif #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "loki_output.h" #include "loki_ibd.h" #include "mat_utils.h" #include "sample_rand.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "InitValues" void InitValues(int *si_mode) { int i,j,k,k1,type,n,mod,n_rec,*tmp; double y,s,mu; struct id_data *data; struct Id_Record *id; size_t size; if(syst_var[SYST_NO_OVERDOMINANT].flag && syst_var[SYST_NO_OVERDOMINANT].data.value) no_overdominant=1; if(syst_var[SYST_TAU_MODE].flag) { if(syst_var[SYST_TAU_MODE].flag==ST_REAL) tau_mode=(int)syst_var[SYST_TAU_MODE].data.rvalue; else tau_mode=syst_var[SYST_TAU_MODE].data.value; } if(syst_var[SYST_CENSOR_MODE].flag && syst_var[SYST_CENSOR_MODE].data.value) censor_mode=1; for(mod=0;modbv[mod]=id->bvsum[mod]=id->bvsum2[mod]=0.0; if(type&ST_CONSTANT) id->n_rec=id->data?1:0; n_rec=id->n_rec; for(k1=k=0;kdata+j:id->data1[k]+j; if(data && data->flag) { if(data->flag&ST_INTTYPE) y=(double)data->data.value; else y=data->data.rvalue; mu+=y; n++; k1++; } } if(!k1) id->res[mod]=0; } if(n) { if(grand_mean_set[mod]) mu=grand_mean[mod]; else mu/=(double)n; id=id_array; for(i=0;ires[mod]) { if(type&ST_CONSTANT) n_rec=id->data?1:0; else n_rec=id->n_rec; for(k=0;kdata+j:id->data1[k]+j; if(data && data->flag&ST_INTTYPE) y=(double)data->data.value; else y=data->data.rvalue; y-=mu; s+=y*y; id->res[mod][k]=y; if(use_student_t) id->vv[mod][k]=1.0; if((type&ST_CENSORED)&&(data->flag&2)) { id->cens[mod][k]=0.0; censored_flag=1; } } } } if(!res_var_set[mod]) { s=n?s/(double)n:1.0; if(s1 && ((*ibd_mode)&IBD_SINGLE_POINT)) { /* Set up singlepoint IBD analysis */ if(analysis&ESTIMATE_IBD) { /* Set up singlepoint IBD analysis */ if(!(tmp=malloc(sizeof(int)*n_markers))) ABT_FUNC(MMsg); for(i=0;ipos); free(linkage[i].ibd_list); } } free(linkage); } if(!(linkage=malloc(sizeof(struct Link)*n_markers))) ABT_FUNC(MMsg); n_links=n_markers; for(i=0;i #include #include #include #include #include #include #include #include #include #if HAVE_UNISTD_H #include #endif #include #include #include #include #if HAVE_SYS_SYSTEMINFO_H #include #endif #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif #include "utils.h" #include "loki.h" #include "count_dbr.h" #include "loki_monitor.h" #define MAX_CONN 64 #define MAX_CHILD 8 int child_alive,lmon_shm_id=-1; static pid_t monitor_pid,child_id[MAX_CHILD]; static char *monitor_sock_addr=".loki_monitor"; static char *loki_pid_file=".loki_pid"; static int n_child; void reaper(int i) { pid_t id; do { id=waitpid(-1,&i,WNOHANG|WUNTRACED); if(id==monitor_pid) { if(WIFSTOPPED(i)) { (void)fprintf(stderr,"Child (%d) has stopped - sending SIGCONT\n",(int)monitor_pid); (void)kill(id,SIGCONT); } else { (void)unlink(monitor_sock_addr); (void)fprintf(stderr,"Child (%d) has died: ",(int)monitor_pid); if(WIFEXITED(i)) (void)fprintf(stderr,"exited with status %d\n",WEXITSTATUS(i)); else (void)fprintf(stderr,"Terminated by signal %d\n",WTERMSIG(i)); child_alive=0; } } } while(id>0); } void reaper1(int i) { pid_t id,j; do { id=waitpid(-1,&i,WNOHANG|WUNTRACED); if(id>0 && WIFEXITED(i)) { for(j=0;j0); } static int get_num(char *p,int *v,int n,int *fg) { int i; char *p1; for(i=0;idbr_shm_id>=0) free_dbr_count(); (void)shmctl(lmon_shm_id,IPC_RMID,0); _exit(EXIT_SUCCESS); } bp=bp1=0; tps=(double)sysconf(_SC_CLK_TCK); for(;;) { FD_ZERO(&readfds); FD_SET(s,&readfds); for(i=0;idbr_shm_id>=0) free_dbr_count(); (void)shmctl(lmon_shm_id,IPC_RMID,0); if(nfd<0 && errno!=EINTR) { if(par_id!=1) (void)kill(par_id,SIGQUIT); perror("Select failed"); ABT_FUNC(AbMsg); } _exit(EXIT_SUCCESS); } if(nfd<0 || lpar->magic!=LMON_MAGIC) continue; if(!nfd) continue; iter[bp]=lpar->it; utime[bp]=(double)lpar->utime/tps; tm[bp]=time(0); j=iter[bp]-iter[bp1]; if(j) { z=difftime(tm[bp],tm[bp1])/(double)j; z1=(utime[bp]-utime[bp1])/(double)j; } else z=z1=0.0; z2=lpar->extra_time+difftime(tm[bp],start_time); z3=lpar->extra_utime+utime[bp]; bp++; if(bp>LMON_WIN_SIZE) bp=0; if(bp1>=bp) { bp1++; if(bp1>LMON_WIN_SIZE) bp1=0; } timeout.tv_sec=0; timeout.tv_usec=0; if(FD_ISSET(s,&readfds)) { len=sizeof(addr); if((sock=accept(s,(struct sockaddr *)&addr,&len))<0) { (void)fprintf(stderr,"[%s:%d] %s():",__FILE__,__LINE__,FUNC_NAME); perror("Couldn't accept"); } else { for(i=0;i=0) socklist[i]=sock; } } for(i=0;iit, lpar->nq,lpar->nq1,z,z1,z2,z3); #else buflen=sprintf(buf,"%d %d %d %g %g %g %g\n",lpar->it, lpar->nq,lpar->nq1,z,z1,z2,z3); #endif (void)write(socklist[i],buf,buflen); break; case 1: /* LMONINFO */ #ifdef HAVE_SNPRINTF buflen=snprintf(buf,256,"%d %d %d %d %d\n",lpar->num_iter, lpar->sample_from[0],lpar->sample_from[1], lpar->sample_freq[0],lpar->sample_freq[1]); #else buflen=sprintf(buf,"%d %d %d %d %d\n",lpar->num_iter, lpar->sample_from[0],lpar->sample_from[1], lpar->sample_freq[0],lpar->sample_freq[1]); #endif (void)write(socklist[i],buf,buflen); break; case 2: /* LSETINFO */ FD_ZERO(&tmpfds); FD_SET(socklist[i],&tmpfds); nfd=select(FD_SETSIZE,&tmpfds,0,0,&timeout); if(nfd>0) { j=read(socklist[i],buf,255); if(j<=0) er=1; else { buf[j]=0; j=get_num(buf,v,5,mask); if(j==5) { if(mask[0]) lpar->num_iter=v[0]; if(mask[1]) lpar->sample_from[0]=v[1]; if(mask[2]) lpar->sample_from[1]=v[2]; if(mask[3]) lpar->sample_freq[0]=v[3]; if(mask[4]) lpar->sample_freq[1]=v[4]; } } } break; case 3: /* LMON_PID */ #ifdef HAVE_SNPRINTF buflen=snprintf(buf,256,"%d\n",(int)par_id); #else buflen=sprintf(buf,"%d\n",(int)par_id); #endif (void)write(socklist[i],buf,buflen); break; case 4: /* DBR_INFO */ if(!lpar->dbr_flag) { lpar->command=LMON_START_DBR; (void)write(socklist[i],"__END__\n",8); } else { if(n_child>=MAX_CHILD) { fprintf(stderr,"Too many children, can't fork()\n"); er=1; } else { child=fork(); if(!child) { for(j=0;j0); } } } static void UnlinkFiles(void) { (void)unlink(monitor_sock_addr); (void)unlink(loki_pid_file); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "start_monitor" void start_monitor(void) { int s,i,j,pid=-1,flg=0; struct sockaddr_un sock; mode_t omask; struct stat sbuf; socklen_t len; fd_set fds; struct timeval timeout; char buf[256],*p=0; char host[MAXHOSTNAMELEN+1]; FILE *fptr; #if HAVE_SYS_SYSTEMINFO_H if(sysinfo(SI_HOSTNAME,host,MAXHOSTNAMELEN)<0) #else if(gethostname(host,MAXHOSTNAMELEN)<0) #endif (void)strcpy(host,"UNKNOWN"); if((s=socket(AF_UNIX,SOCK_STREAM,0))<0) { perror("Couldn't create socket"); ABT_FUNC(AbMsg); } sock.sun_family=AF_UNIX; (void)strcpy(sock.sun_path,monitor_sock_addr); omask=umask(077); len=sizeof(sock.sun_family)+strlen(sock.sun_path)+1; if(!stat(monitor_sock_addr,&sbuf)) { (void)fprintf(stderr,"The file '%s' is present in the current directory.\n",monitor_sock_addr); if(connect(s,(struct sockaddr *)&sock,len)<0) { if(errno==ENOTSOCK) { (void)fprintf(stderr,"'%s' is not a socket.\n",monitor_sock_addr); flg=1; } else { perror("Couldn't connect to existing loki process"); } } else { (void)fputs("Connected to socket - trying to get process id of existing loki process\n",stderr); timeout.tv_sec=1; timeout.tv_usec=0; FD_ZERO(&fds); FD_SET(s,&fds); i=select(FD_SETSIZE,0,&fds,0,&timeout); if(i<0) perror("Couldn't write to socket"); else if(i>0 && write(s,"LMON_PID",8)==8) { timeout.tv_sec=1; i=select(FD_SETSIZE,&fds,0,0,&timeout); if(i>0 && (j=read(s,buf,255))>0) { buf[j]=0; pid=atoi(buf); } } } if(pid<0 && !flg) { if(!(fptr=fopen(loki_pid_file,"r"))) { perror("Couldn't open pid file for reading"); } else { if(fgets(buf,256,fptr)) { i=strlen(buf); if(buf[i-1]=='\n') buf[i-1]=0; i=(int)strtol(buf,&p,10); if(*(p++)==':') pid=i; } } } if(pid>=0) { (void)fprintf(stderr,"Existing loki process (%d) is%srunning on %s in this directory\n",pid,p?" apparently ":" ",p?p:host); (void)fprintf(stderr,"If this is not true, delete '%s' and retry\n",monitor_sock_addr); } else { if(flg==1) (void)fprintf(stderr,"Delete spurious file '%s' and retry\n",monitor_sock_addr); else { (void)fputs("Check to make sure no loki process is running locally or remotely in this directory.\n",stderr); (void)fprintf(stderr,"If not, delete spurious file '%s' and retry\n",monitor_sock_addr); } } ABT_FUNC(AbMsg); } else if(errno!=ENOENT) { perror("Problem creating socket file"); ABT_FUNC(AbMsg); } if(atexit(UnlinkFiles)) ABT_FUNC("Unable to register exit function UnlinkFiles()\n"); (void)umask(omask); if(bind(s,(struct sockaddr *)&sock,len)<0) { perror("Couldn't bind socket"); ABT_FUNC(AbMsg); } if(listen(s,MAX_CONN)<0) { perror("Couldn't listen on socket"); ABT_FUNC(AbMsg); } if(!(fptr=fopen(loki_pid_file,"w"))) { perror("Couldn't open pid file for writing"); ABT_FUNC(AbMsg); } (void)fprintf(fptr,"%d:%s\n",(int)getpid(),host); (void)fclose(fptr); monitor_pid=fork(); if(!monitor_pid) { /* Child */ if(setsid()<0) { perror("Couldn't set new process session"); ABT_FUNC(AbMsg); } monitor(s); /* Should never return */ _exit(EXIT_FAILURE); } else if(monitor_pid>0) { /* Parent */ (void)close(s); } else { perror("Couldn't fork"); ABT_FUNC(AbMsg); } child_alive=1; } loki/lokisrc/loki_monitor.h0100644000076500007650000000074410001741572015321 0ustar heathheathvoid start_monitor(void); void reaper(int); void ignore_handler(int); struct lmon_param { double extra_time,extra_utime; clock_t utime; int command; unsigned int magic; int it; int nq,nq1; int num_iter; int sample_from[2],sample_freq[2]; int debug_level; int peel_trace; int si_mode; int ibd_mode; int dbr_flag; int dbr_shm_id; size_t dbr_mem_size; }; extern int child_alive,lmon_shm_id; #define LMON_WIN_SIZE 64 #define LMON_MAGIC 17062000 #define LMON_START_DBR 1 loki/lokisrc/loki_npl.c0100644000076500007650000000714610001741567014425 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Evry * * * * July 2002 * * * * loki_npl.c: * * * * Routines for calculating NPL scores & associated stats * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "seg_pen.h" #include "loki_ibd.h" #include "loki_npl.h" static int *naff,**affs; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "SetupNPL" void SetupNPL(void) { int i,i1,i2,j,k,k1,k2,comp,*tp,n_long,cs,*n_longs; int ids,idd,ids1,idd1,sh,Spairs; unsigned long *tpl,*founders; get_founder_params(&founders,&n_longs,0,0); if(!(affs=malloc(sizeof(void *)*n_comp))) ABT_FUNC(MMsg); if(!(naff=malloc(sizeof(int)*n_comp))) ABT_FUNC(MMsg); /* Count the number of affecteds in each component */ for(k=i=comp=0;comp #ifdef USE_DMALLOC #include #endif #include #include int n_cov_columns; #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "version.h" #include "loki_ibd.h" #include "calc_var_locus.h" #include "sample_rand.h" #include "sample_nu.h" #include "mat_utils.h" #include "loki_output.h" static double *tot_gen_var; void Output_Sample_Aff(int lp,double *ss,double *ss2,int *perm,FILE *fptr) { int k,k1,k2,k3; (void)fprintf(fptr,"%d ",lp); for(k1=0;k11.0?z-1.0:1.0; fputs("ID ",fptr); for(i=3;idf;j++) (void)fprintf(fptr," %g",marker[k].mterm[mod]->eff[j]); } for(mod=0;modstart_time)); for(i=0;istart_time)); if(!analysis) { (void)fprintf(fptr,"Output format: %d\n",output_type); for(mod=0;mod1) { if(!mod) (void)fputs("Models: \n ",fptr); else (void)fputs(" ",fptr); } else (void)fputs("Model: ",fptr); i=models[mod].var.var_index; var=(type&ST_CONSTANT)?id_variable+i:nonid_variable+i; (void)fputs(var->name,fptr); if(var->index) (void)fprintf(fptr,"(%d)",var->index); (void)fputs(" = ",fptr); for(i=0;iname,fptr); if(var->index) (void)fprintf(fptr,"(%d)",var->index); if(type&ST_RANDOM) (void)fputc('\'',fptr); } } } (void)fputc('\n',fptr); } } } if(!(analysis&NULL_ANALYSIS)) { if(n_links) { (void)fprintf(fptr,"Input map function: %s\nOutput map function: Haldane\n",map_function?"Kosambi":"Haldane"); if((n_tloci+n_markers) && !(perm=malloc(sizeof(int)*(n_tloci+n_markers)))) ABT_FUNC(MMsg); (void)fputs("Linkage groups:\n",fptr); for(i=0;iidx==1?":":"s:"); for(j=0;jidx;j++) { (void)fputc(j?',':' ',fptr); (void)fprintf(fptr,"%g",linkage[i].ibd_list->pos[j]); } (void)fputc('\n',fptr); break; case IBD_EST_GRID: if(!linkage[i].ibd_list) ABT_FUNC("Internal error - no ibd list\n"); (void)fprintf(fptr,"IBD Matrix estimated at grid of positions from %g to %g step %g\n", linkage[i].ibd_list->pos[0],linkage[i].ibd_list->pos[1],linkage[i].ibd_list->pos[2]); break; case IBD_EST_MARKERS: (void)fputs("IBD Matrix estimated at all marker locations\n",fptr); break; } } if(perm) free(perm); (void)fputs("Total Map Length:",fptr); for(k3=0;k3<=sex_map;k3++) (void)fprintf(fptr," %gcM",total_maplength[1-k3]); (void)fputc('\n',fptr); } } if(!analysis && models) { (void)fputs("Output columns:\n",fptr); k1=0; (void)fprintf(fptr," %d: Iteration count\n",++k1); if(output_type<=OUTPUT_VERSION_2_1) { (void)fprintf(fptr," %d: No. QTL's in models[0]\n",++k1); (void)fprintf(fptr," %d: No. linked QTL's\n",++k1); } if(output_type<3) { if(n_models>1) { for(mod=0;mod1) { for(k=mod=0;mod1) { for(mod=0;mod=OUTPUT_VERSION_2_3) { if(n_models>1) { for(mod=0;mod1) { for(k=mod=0;modname); if(var->index) (void)fprintf(fptr,"(%d)",var->index); (void)fprintf(fptr," %d %d\n",mod1+1,mod+1); } (void)fprintf(fptr," %d: Additional random variance for %s",++k1,var->name); if(var->index) (void)fprintf(fptr,"(%d)",var->index); if(n_models>1) (void)fprintf(fptr," %d\n",mod+1); else (void)fputc('\n',fptr); } } if(output_type==OUTPUT_TYPE_ORIGINAL) { (void)fprintf(fptr," %d: No. covariate columns\n",++k1); (void)fprintf(fptr," %d: No. genetic groups\n",++k1); } k3=k1; for(mod=0;mod1) (void)fprintf(fptr," - model %d:\n",mod+1); else (void)fputs(":\n",fptr); if(output_type==DEFAULT_OUTPUT_TYPE) { if(grand_mean_set[mod]!=1) (void)fprintf(fptr," %d: Grand mean\n",++k1); } for(i=0;iname); if(var->index) (void)fprintf(fptr,"(%d)",var->index); (void)fputs(" effect ",fptr); if(var->type&ST_FACTOR) { if(var->rec_flag==ST_STRING) (void)fputs(var->recode[j].string,fptr); else (void)fprintf(fptr,"%d",var->recode[j].value); } (void)fputc('\n',fptr); } } } for(k=0;krec_flag==ST_STRING) (void)fputs(group_var->recode[grp].string,fptr); else (void)fprintf(fptr,"%d",group_var->recode[grp].value); (void)fputc(']',fptr); } (void)fputs(" freq. ",fptr); print_allele_type1(fptr,k,j); (void)fputc('\n',fptr); } } for(mod=0;mod1) (void)fprintf(fptr," for model %d ",mod+1); (void)fputc('\n',fptr); } } for(mod=0;mod1) { if(mod==mod1) (void)fprintf(fptr,"model %d",mod+1); else (void)fprintf(fptr,"models %d,%d\n",mod+1,mod1+1); } (void)fputc('\n',fptr); } } if(tlocus && max_tloci) { (void)fputs(" QTL data blocks:\n linkage group\n",fptr); if(output_type==OUTPUT_TYPE_ORIGINAL) { if(sex_map) (void)fputs(" male position\n female position\n",fptr); else (void)fputs(" position\n",fptr); } else { if(sex_map) (void)fputs(" [male position if linked]\n [female position if linked]\n",fptr); else (void)fputs(" [position if linked]\n",fptr); } for(grp=0;grprec_flag==ST_STRING) (void)fputs(group_var->recode[grp].string,fptr); else (void)fprintf(fptr,"%d",group_var->recode[grp].value); (void)fputc(']',fptr); } (void)fputs(" freq. 1\n",fptr); } if(n_models>1) { (void)fputs(" Effect block:\n Model no.\n effect 1,2\n effect 2,2\n",fptr); (void)fputs(" Size block:\n",fptr); } else (void)fputs(" effect 1,2\n effect 2,2\n size\n",fptr); if(min_tloci==max_tloci) (void)fprintf(fptr,"No. QTL: %d\n",max_tloci); else { (void)fprintf(fptr,"Number of QTL: %d to %d\n",min_tloci,max_tloci); if(tloci_mean_set) (void)fprintf(fptr,"Mean of poisson prior on QTL number: %g\n",tloci_mean); } } if(res_var_set[0]==1) (void)fprintf(fptr,"Residual variance: %g\n",residual_var[0]); if(grand_mean_set[0]==1) (void)fprintf(fptr,"Grand mean: %g\n",grand_mean[0]); (void)fprintf(fptr,"Tau Mode: %d\nTau Beta: %g\n",tau_mode,tau_beta[0]); (void)fprintf(fptr,"No. fixed output columns: %d\n",k1); if(no_overdominant) (void)fputs("Over-dominant QTLs not allowed\n",fptr); k1-=k3; n_cov_columns=k1; } else if(!(analysis&ESTIMATE_IBD)) { (void)fputs("Affected only ",fptr); if(analysis&IBD_ANALYSIS) (void)fputs("IBD Analysis\n",fptr); else (void)fputc('\n',fptr); } if(lm_ratio>0.0) (void)fprintf(fptr,"LM ratio: %g\n",lm_ratio); (void)fprintf(fptr,"SI_mode: %d\n",si); (void)fprintf(fptr,"No. genetic groups: %d\n",n_genetic_groups); if(sex_map) (void)fputs("Sex specific map\n",fptr); (void)fputs("--------------------\n",fptr); (void)fflush(fptr); } /* the following routines are for stat 5 EWD */ #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "OutputQTLvect" void OutputQTLvect(FILE *qptr,int lp) /* June 3, 1998 EWD - output a QTL vector to file */ /* Jan 12, 2004 EWD - update? for new structure */ { int l,n; for(l=0;l #ifdef USE_DMALLOC #include #endif #include #include #include #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "get_par_probs.h" #include "loki_simple_peel.h" #include "loki_trait_simple_peel.h" static double **freq; static struct Peelseq_Head **peel_list; static int *peel_alls; struct peel_mem_block *first_mem_block[2],*mem_block[2]; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "peel_alloc" void peel_alloc(struct peel_mem *work) { int i,j,j1,k,k1,k2; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s()\n",FUNC_NAME); #endif k=tlocus?2:0; for(i=0;ik) k=j; } if(!k) return; if(!(freq=malloc(sizeof(void *)*2*n_genetic_groups))) ABT_FUNC(MMsg); if(!(freq[0]=malloc(sizeof(double)*k*2*n_genetic_groups))) ABT_FUNC(MMsg); for(i=1;is0=malloc(sizeof(struct fset)*k1*k1))) ABT_FUNC(MMsg); if(!(work->s1=malloc(sizeof(int)*(k+k1*2)))) ABT_FUNC(MMsg); peel_alls=work->s1+2*k1; j=num_bits(k); j=1<<(j+j); /* Note the 16 below should change if more than diallelic trait loci are fitted */ if(!(work->s2=malloc(sizeof(double)*(16+k1+4*j)))) ABT_FUNC(MMsg); if(!(work->s3=malloc(sizeof(lk_ulong)*max_peel_off*(k+2)))) ABT_FUNC(MMsg); if(!(work->s4=malloc(sizeof(int)*max_peel_off))) ABT_FUNC(MMsg); for(k2=i=0;ik2) k2=j1; } if(!(work->s5=malloc(sizeof(void *)*k2))) ABT_FUNC(MMsg); j1=n_markers+max_tloci; if(!(work->s6=malloc(sizeof(void *)*j1))) ABT_FUNC(MMsg); if(!(work->s7=malloc(sizeof(double)*2*j1))) ABT_FUNC(MMsg); peel_list=(struct Peelseq_Head **)work->s5; first_mem_block[MRK_MBLOCK]=get_new_memblock(MB_SIZE,MRK_MBLOCK); first_mem_block[TRT_MBLOCK]=get_new_memblock(MB_SIZE,TRT_MBLOCK); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "peel_dealloc" void peel_dealloc(struct peel_mem *work) { int k; struct peel_mem_block *p,*p1; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s()\n",FUNC_NAME); #endif if(freq) { if(freq[0]) free(freq[0]); free(freq); } if(work) { if(work->s0) free(work->s0); if(work->s1) free(work->s1); if(work->s2) free(work->s2); if(work->s3) free(work->s3); if(work->s4) free(work->s4); if(work->s5) free(work->s5); if(work->s6) free(work->s6); if(work->s7) free(work->s7); } for(k=0;k<2;k++) { p1=first_mem_block[k]; while(p1) { p=p1->next; if(p1->index) free(p1->index); if(p1->val) free(p1->val); free(p1); p1=p; } } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "peel_locus" /* Peels locus perm[idx] where the n_loci entries in perm are all in 1 linkage group. * If sample_flag then the locus is to be sampled */ double peel_locus(const int *perm,int idx,int n_loci,int sample_flag,struct peel_mem *work,int si) { struct Peelseq_Head *pp; struct Simple_Element *simple_em; struct Complex_Element *complex_em; struct Id_Record *id; struct Marker *mark=0; struct TraitLocus *tloc=0; trait_pen_func *trait_pen=0; int comp,i,i1,j,k,k1,k2,k3,nn_all,n_peel_ops,ids,idd,allele,n_rf,grp,cs,*a_trans; int rec,nrec,mtype,locus,sample_freq=0,trn[2],res_flag,locus1,**seg,unlinked=0,*f_flag; int ***seglist,n_all,linktype; double *recom1,*recom2; double like=0.0,like1,z,z1,theta,Mtp[2],Ptp[2],*pos,*eff,**count,*tpp,*freq1,*count1; signed char *freq_set; lk_ulong a,b,c,lump,**a_set=0; pen_func *pen=0; struct Locus *loc,*loc1; struct R_Func *rf; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%d,%d)\n",FUNC_NAME,(void *)perm,idx,n_loci,sample_flag); #endif seglist=(int ***)work->s6; recom1=work->s7; recom2=recom1+n_markers+n_tloci; locus=perm[idx]; sample_flag&=~OP_SAMPLING; if(locus<0) { /* Trait locus */ tloc=&tlocus[-1-locus]; loc=&tloc->locus; locus1=n_markers; nn_all=loc->n_alleles; if(loc->flag&TL_LINKED) { j=loc->link_group; linktype=linkage[j].type; } else { linktype=LINK_AUTO; unlinked=1; } mtype=models[0].var.type; if(!multiple_rec && !use_student_t && (loc->flag&LOCUS_SAMPLED) && (!(mtype&ST_CENSORED) || censor_mode)) trait_pen=s_penetrance1; else trait_pen=s_penetrance; sample_freq=sample_flag==1?1:0; } else { /* Marker locus */ locus1=locus; mark=marker+locus; loc=&mark->locus; nn_all=loc->n_alleles; a_set=all_set[locus]; sample_freq=0; if(sample_flag==1) for(k=0;kfreq_set[k][i]!=1) j++; sample_freq|=(j>1)?1:0; } j=loc->link_group; linktype=linkage[j].type; } pos=loc->pos; seg=loc->seg; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void)printf("locus %s, sample_flag=%d, nn_all=%d, linktype=%d\n",locus<0?"QTL":mark->name,sample_flag,nn_all,linktype); } #endif if(nn_all<2) return 0.0; if(n_loci>1) { k2=0; for(i=0;i=0?&marker[k1].locus:&tlocus[-1-k1].locus; seglist[k2]=loc1->seg; recom1[k2]=.5*(1.0-exp(-0.02*(pos[X_MAT]-loc1->pos[X_MAT]))); recom2[k2++]=.5*(1.0-exp(-0.02*(pos[X_PAT]-loc1->pos[X_PAT]))); #ifdef DEBUG if(recom1[k2-1]<=0.0 || recom2[k2-1]<=0.0) { ABT_FUNC("Zero recomb - this will not work!\n"); } if(recom1[k2-1]<=1.0e-16 || recom2[k2-1]<=1.0e-16) { fprintf(stderr,"Warning: [1] Very low recomb (%g,%g) - this may not work!\n",recom1[k2-1],recom2[k2-1]); } #endif } for(i=idx+1;i=0?&marker[k1].locus:&tlocus[-1-k1].locus; seglist[k2]=loc1->seg; recom1[k2]=.5*(1.0-exp(0.02*(pos[X_MAT]-loc1->pos[X_MAT]))); recom2[k2++]=.5*(1.0-exp(0.02*(pos[X_PAT]-loc1->pos[X_PAT]))); #ifdef DEBUG if(recom1[k2-1]<=0.0 || recom2[k2-1]<=0.0) { ABT_FUNC("Zero recomb - this will not work!\n"); } if(recom1[k2-1]<=1.0e-16 || recom2[k2-1]<=1.0e-16) { fprintf(stderr,"Warning: [2] Very low recomb (%g,%g) - this may not work!\n",recom1[k2-1],recom2[k2-1]); } #endif } } count=freq+n_genetic_groups; if(sample_freq) { for(j=0;j=0 && mark->count_flag[j]) for(i=0;icounts[j][i]+1.0; else for(i=0;ilocus.freq[j][i]; } } eff=0; mtype=0; res_flag=0; if(locus<0 || (mark->mterm && mark->mterm[0])) { mtype=models[0].var.type; if(locus<0) eff=tloc->eff[0]; else if(mark->mterm[0]) { eff=mark->mterm[0]->eff; res_flag=1; } } for(j=comp=0;compptr=0; } if(locus<0) { rf=r_func[n_markers][comp]; n_all=nn_all; lump=0; } else { a_trans=allele_trans[locus][comp]; rf=r_func[locus][comp]; n_all=mark->n_all1[comp]; if(n_all<2) { j+=comp_size[comp]; continue; } for(i=0;i=0) peel_alls[k]=i; for(grp=0;grpfreq[grp][i]; lump=0; for(i=0;iflag=0; id->allele[X_MAT]=id->allele[X_PAT]= -1; k3=*(f_flag++); if(k3==2) { id++; i1++; continue; } /* Set up transmission probs. */ if(!k3 && n_loci>1) { for(k=idx-1;k>=0;k--) { k2=seglist[k][X_MAT][i1]; if(k2<0) continue; theta=recom1[k]; #ifdef DEBUG if(theta<1.0e-16) { fprintf(stderr,"Warning: [1] theta very low (%g) for locus %d\n",theta,locus); } #endif Mtp[k2]=1.0-theta; Mtp[1-k2]=theta; break; } if(k<0) Mtp[0]=Mtp[1]=1.0; for(k=idx-1;k>=0;k--) { k2=seglist[k][X_PAT][i1]; if(k2<0) continue; theta=recom2[k]; #ifdef DEBUG if(theta<1.0e-16) { fprintf(stderr,"Warning: [2] theta very low (%g) for locus %d\n",theta,locus); } #endif Ptp[k2]=1.0-theta; Ptp[1-k2]=theta; break; } if(k<0) Ptp[0]=Ptp[1]=1.0; for(k=idx;ktpp[X_MAT][k]=Mtp[k]; id->tpp[X_PAT][k]=Ptp[k]; } id->tp[X_MM_PM]=Mtp[X_MAT]*Ptp[X_MAT]; id->tp[X_MM_PP]=Mtp[X_MAT]*Ptp[X_PAT]; id->tp[X_MP_PM]=Mtp[X_PAT]*Ptp[X_MAT]; id->tp[X_MP_PP]=Mtp[X_PAT]*Ptp[X_PAT]; } else { for(k=0;k<2;k++) id->tpp[X_MAT][k]=id->tpp[X_PAT][k]=0.5; for(k=0;k<4;k++) id->tp[k]=0.25; } id->rfp= -1; if(locus>=0) { id->lumped=mark->lump[i1]; id->temp=mark->temp[i1]; id->nhaps=mark->nhaps[i1]; for(k=0;k<2;k++) { if(id->nhaps[k]==1) { a=id->temp[k]; k1=1; while(!(a&1)) { a>>=1; k1++; } id->allele[k]=k1; } } if((id->ngens=mark->ngens[i1])==1) id->flag|=(SAMPLED_MAT|SAMPLED_PAT); } id++; i1++; } if(locus>=0 && mark->mterm && mark->mterm[0]) pen=&penetrance; n_rf= -1; sample_flag&=~OP_SAMPLING; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) (void)printf("Peeling component %d\n",comp+1); #endif /* Go through all operations in peeling sequence */ pp=peelseq_head[locus1]+comp; like1=0.0; while(pp->type) { if(pp->type==PEEL_SIMPLE) { simple_em=pp->ptr.simple; if(sample_flag && simple_em->pivot) peel_list[n_peel_ops++]=pp; if(locus<0) { if(simple_em->out_index>n_rf) { n_rf=simple_em->out_index; rf[n_rf].p=0; } z=loki_trait_simple_peelop(simple_em,locus,sample_flag,freq,rf,trait_pen,work); if(z== -DBL_MAX) { if(sample_flag&1) ABT_FUNC("Internal error - shouldn't be here\n"); /* Error return on likelihood (not sampling) run. Clean up and return error */ return z; } like1+=z; } else { switch(linktype) { case LINK_AUTO: z=loki_simple_peelop(simple_em,locus,sample_flag,*pen,a_set,freq,rf,work); break; case LINK_X: z=loki_simple_peelop_x(simple_em,locus,sample_flag,*pen,a_set,freq,rf,work); break; default: ABT_FUNC("Link type not implemented\n"); } if(z== -DBL_MAX) { if(sample_flag&1) { ABT_FUNC("Internal error - shouldn't be here\n"); } /* Error return on likelihood (not sampling) run. Clean up and return error */ return z; } like1+=z; } pp= &simple_em->next; } else { complex_em=pp->ptr.complex; if(sample_flag && (complex_em->n_involved-complex_em->n_peel)) peel_list[n_peel_ops++]=pp; if(locus<0) { if(complex_em->out_index>n_rf) { n_rf=complex_em->out_index; rf[n_rf].p=0; } z=loki_trait_complex_peelop(complex_em,locus,sample_flag,rf,trait_pen,freq); if(z== -DBL_MAX) { if(sample_flag&1) ABT_FUNC("Internal error - shouldn't be here\n"); /* Error return on likelihood (not sampling) run. Clean up and return error */ return z; } like1+=z; } else { z=loki_complex_peelop(complex_em,locus,sample_flag,*pen,n_all,rf,freq); if(z== -DBL_MAX) { if(sample_flag&1) ABT_FUNC("Internal error - shouldn't be here\n"); /* Error return on likelihood (not sampling) run. Clean up and return error */ return z; } like1+=z; } pp= &complex_em->next; } } /* If we're sampling, do them again in reverse */ if(sample_flag) { sample_flag|=OP_SAMPLING; for(i=n_peel_ops-1;i>=0;i--) { pp=peel_list[i]; if(pp->type==PEEL_SIMPLE) { simple_em=pp->ptr.simple; if(simple_em->pivot== -2) { k1=simple_em->out_index; } else { if(locus<0) (void)loki_trait_simple_sample(simple_em,locus,sample_flag,freq,rf,trait_pen,work); else { if(linktype==LINK_AUTO) (void)loki_simple_sample(simple_em,locus,*pen,a_set,freq,rf,work); else (void)loki_simple_sample(simple_em,locus,*pen,a_set,freq,rf,work); } } } else { complex_em=pp->ptr.complex; k=0; if(complex_em->n_peel==1) { k1=complex_em->involved[0]; if(locus>=0) { if(k1>0) { if(id_array[k1-1].nhaps[X_MAT]==1) { k=1; id_array[k1-1].flag|=SAMPLED_MAT; } } else { if(id_array[-k1-1].nhaps[X_PAT]==1) { k=1; id_array[-k1-1].flag|=SAMPLED_PAT; } } } } if(!k) { if(locus<0) (void)loki_trait_complex_peelop(complex_em,locus,sample_flag,rf,trait_pen,freq); else (void)loki_complex_peelop(complex_em,locus,sample_flag,*pen,n_all,rf,freq); } } } /* Get allele counts for frequency update */ if(sample_freq) { f_flag=founder_flag[locus1]+j; if(locus>=0) { a_trans=allele_trans[locus][comp]; for(id=id_array+j,i=0;igroup-1; freq1=loc->freq[grp]; count1=count[grp]; for(k1=0;k1<2;k1++) { allele=id->allele[k1]-1; #ifdef DEBUG if(allele<0 || allele>=n_all) { ABT_FUNC("Illegal sampled allele\n"); } #endif a=req_set[k1][locus][i1]; if(a&(LK_ONE<>=1; k3++; } } else z+=freq1[k2]; } a>>=1; k++; } z=1.0/z; k=0; a=req_set[k1][locus][i1]; while(a) { if(a&1) { k2=a_trans[k]; if(k2<0) { b=lump; k3=0; while(b) { if(b&1) count1[k3]+=z*freq1[k3]; b>>=1; k3++; } } else count1[k2]+=z*freq1[k2]; } a>>=1; k++; } } else { k2=a_trans[allele]; if(k2<0) { z=0.0; k3=0; b=lump; while(b) { if(b&1) z+=freq1[k3]; b>>=1; k3++; } z=1.0/z; k3=0; b=lump; while(b) { if(b&1) count1[k3]+=z*freq1[k3]; b>>=1; k3++; } } else count1[k2]+=1.0; } } } } else { for(id=id_array+j,i=0;igroup-1; for(k1=0;k1<2;k1++) { allele=id->allele[k1]-1; count[grp][allele]+=1.0; } } } } /* Correct residuals, get segregation pattern */ if(locus<0) { /* For trait loci */ id=id_array+j; for(i=0;ipruned_flag[n_markers]) continue; i1=i+j; k=id->allele[X_MAT]; k1=id->allele[X_PAT]; if(k>k1) k=k*(k-1)/2+k1; else k=k1*(k1-1)/2+k; /* Correct residuals for new genotypes */ if(id->res[0]) { nrec=id->n_rec; k1=(loc->flag&LOCUS_SAMPLED)?loc->gt[i1]:1; if(k1!=k) { z=(k1>1)?eff[k1-2]:0.0; if(k>1) z-=eff[k-2]; for(rec=0;recres[0][rec]+=z; } } } loc->gt[i1]=k; idd=id->dam; if(idd && !id_array[idd-1].pruned_flag[n_markers]) { k=id->allele[X_MAT]; for(k1=0;k1<2;k1++) trn[k1]=(k==id_array[idd-1].allele[k1])?1:0; #ifdef DEBUG if(!trn[0] && !trn[1]) ABT_FUNC("Internal error - bad configuration?\n"); #endif if(trn[0] && trn[1]) { if(si || unlinked) { tpp=id->tpp[X_MAT]; z=ranf()*(tpp[0]+tpp[1]); seg[X_MAT][i1]=(z<=tpp[0])?0:1; } else seg[X_MAT][i1]= -2; } else if(trn[0]) seg[X_MAT][i1]=0; else seg[X_MAT][i1]=1; } else seg[X_MAT][i1]= -1; ids=id->sire; if(ids && !id_array[ids-1].pruned_flag[n_markers]) { k=id->allele[X_PAT]; for(k1=0;k1<2;k1++) trn[k1]=(k==id_array[ids-1].allele[k1])?1:0; #ifdef DEBUG if(!trn[0] && !trn[1]) ABT_FUNC("Internal error - bad configuration?\n"); #endif if(trn[0] && trn[1]) { if(si || unlinked) { tpp=id->tpp[X_PAT]; z=ranf()*(tpp[0]+tpp[1]); seg[X_PAT][i1]=(z<=tpp[0])?0:1; } else seg[X_PAT][i1]= -2; } else if(trn[0]) seg[X_PAT][i1]=0; else seg[X_PAT][i1]=1; } else seg[X_PAT][i1]= -1; } } else { /* For marker loci */ id=id_array+j; for(i=0;ipruned_flag[locus]) continue; k=id->allele[X_MAT]; k1=id->allele[X_PAT]; if(k>k1) k=k*(k-1)/2+k1; else k=k1*(k1-1)/2+k; if(res_flag) { if(id->res[0]) { nrec=id->n_rec; k1=(loc->flag&LOCUS_SAMPLED)?loc->gt[i1]:1; if(k1!=k) { z=(k1>1)?eff[k1-2]:0.0; if(k>1) z-=eff[k-2]; for(rec=0;recres[0][rec]+=z; } } } } loc->gt[i1]=k; idd=id->dam; if(idd && !id_array[idd-1].pruned_flag[locus]) { c=req_set[X_MAT][locus][i1]; k=id->allele[X_MAT]-1; #ifdef DEBUG if(k<0 || k>=n_all) ABT_FUNC("Internal error - bad sampled genotype\n"); #endif a=LK_ONE<tpp[X_MAT]; z=ranf()*(tpp[0]+tpp[1]); seg[X_MAT][i1]=(z<=tpp[0])?0:1; } else seg[X_MAT][i1]= -2; } else { seg[X_MAT][i1]=trn[0]?0:1; } } else seg[X_MAT][i1]= -1; ids=id->sire; if(ids && !id_array[ids-1].pruned_flag[locus]) { c=req_set[X_PAT][locus][i1]; k=id->allele[X_PAT]-1; #ifdef DEBUG if(k<0 || k>=n_all) ABT_FUNC("Internal error - bad sampled genotype\n"); #endif a=LK_ONE<tpp[X_PAT]; z=ranf()*(tpp[0]+tpp[1]); seg[X_PAT][i1]=(z<=tpp[0])?0:1; } else seg[X_PAT][i1]= -2; } else { seg[X_PAT][i1]=trn[0]?0:1; } } else seg[X_PAT][i1]= -1; } } } like+=like1; j+=cs; } if(sample_freq) for(grp=0;grpfreq[grp]; if(locus<0) { for(i=0;ifreq_set[grp]; for(i=i1=0;iflag|=LOCUS_SAMPLED|RFMASK_OK; return like; } loki/lokisrc/loki_peel.h0100644000076500007650000000431410001741572014554 0ustar heathheath#include "shared_peel.h" #include "bin_tree.h" #define OP_SAMPLING 128 #define SAMPLED_MAT 128 #define SAMPLED_PAT 256 #define LOCUS_SAMPLED 128 #define RFMASK_OK 256 #define TL_UNLINKED 1 #define TL_LINKED 2 #define TL_UPDATING 4 struct R_Func { int n_ind; int n_terms; lk_ulong mask[2]; int mask1[2]; int *id_list; lk_ulong *index; double *p; int flag; }; struct hash_data { lk_ulong index; double p; }; struct hash_block { struct hash_block *next; struct bin_node *elements; struct hash_data *hd; int size,ptr; }; struct peel_mem_block { struct peel_mem_block *next; lk_ulong *index; double *val; size_t size,ptr; }; struct fset { int pat_gene[2]; int mat_gene[2]; double p; }; typedef void pen_func(double *,int,int,int,int); typedef void trait_pen_func(double *,int,int); extern pen_func penetrance; extern trait_pen_func s_penetrance,s_penetrance1; double q_penetrance(int,int,int); /* Peeling output level - controlled by lower 3 bits in peel_trace */ #define TRACE_LEVEL_0 0 #define TRACE_LEVEL_1 1 #define TRACE_LEVEL_2 2 #define TRACE_LEVEL_3 3 #define TRACE_LEVEL_4 4 #define TRACE_MASK 7 #define CHK_PEEL(x) (((*peel_trace)&TRACE_MASK)>=(x)) #define MRK_MBLOCK 0 #define TRT_MBLOCK 1 #define MB_SIZE 4096 extern struct peel_mem_block *first_mem_block[2],*mem_block[2]; extern struct R_Func ***r_func; extern int ***allele_trans; extern lk_ulong ***all_set,**req_set[2]; extern struct Peelseq_Head **peelseq_head; extern int max_peel_off; extern double peel_locus(const int *,int,int,int,struct peel_mem *,int); extern void free_complex_mem(void); extern int cmp_loci_pos(const void *,const void *); extern void set_sort_sex(const int); extern void peel_alloc(struct peel_mem *); extern void peel_dealloc(struct peel_mem *); extern void get_locuslist(int *,const int,int *,int); extern double loki_complex_peelop(const struct Complex_Element *,const int,const int,pen_func,const int,struct R_Func *,double **); extern double loki_trait_complex_peelop(const struct Complex_Element *,const int,const int,struct R_Func *,trait_pen_func *,double **); extern void get_rf_memory(struct R_Func *,size_t,int); extern lk_ulong get_index1(int,int *,const int); struct peel_mem_block *get_new_memblock(size_t,int); loki/lokisrc/loki_pen.c0100644000076500007650000001757310001741567014423 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * August 1997 * * * * loki_pen.c: * * * * Penetrance routines for peeling calculations * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "penetrance" void penetrance(double *val,int id,int locus,int n_all,int n_bits) { int i,j,k,mtype,rec,nrec,censflag,idx; double p,y,m,*eff,kon1,kon2,sd,wt; if(!id_array[id].res[0]) return; if(locus<0) eff=tlocus[-1-locus].eff[0]; else eff=marker[locus].mterm[0]->eff; #ifdef DEBUG if(n_bits) j=1<<(n_bits+n_bits); else j=n_all*n_all; for(p=0.0,i=0;ieff[0]; kon1=-1.0/(2.0*residual_var[0]); kon2=sqrt(-kon1/M_PI); y=id_array[id].res[0][0]; if((k=tloc->locus.gt[id])>1) y+=eff[k-2]; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_4)) { (void)fputs("Penetrance routine\n",stdout); printf("y=%g, k=%d, eff[0]=%g, eff[1]=%g, kon1=%g, kon2=%g\n",y,k,eff[0],eff[1],kon1,kon2); } #endif val[0]*=kon2*exp(y*y*kon1); m=y-eff[0]; p=kon2*exp(m*m*kon1); val[1]*=p; val[2]*=p; m=y-eff[1]; val[3]*=kon2*exp(m*m*kon1); #ifdef DEBUG for(p=0.0,i=0;i<4;i++) p+=val[i]; if(p<=0.0) { (void)fprintf(stderr,"penetrance() returning with zero function - "); print_orig_id(stderr,id+1); (void)fprintf(stderr," y=%g, sd=%g",y,sqrt(residual_var[0])); (void)fputc('\n',stderr); ABT_FUNC("Aborting\n"); } #endif } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "q_penetrance" double q_penetrance(int id,int gt,int locus) { int k,mtype,rec,nrec,censflag,idx; double p,y,*eff,kon1,kon2,sd,wt; struct Locus *locp; if(locus<0) { eff=tlocus[-1-locus].eff[0]; locp=&tlocus[-1-locus].locus; } else { eff=marker[locus].mterm[0]->eff; locp=&marker[locus].locus; } gt--; nrec=id_array[id].n_rec; if(!nrec) nrec=1; mtype=models[0].var.type; p=0.0; kon1=1.0/(2.0*residual_var[0]); kon2=log(sqrt(kon1/M_PI)); if(!(mtype&ST_CENSORED) || censor_mode) { for(rec=0;recflag&LOCUS_SAMPLED) { k=locp->gt[id]-1; if(k) y+=eff[k-1]; } if(gt) y-=eff[gt-1]; p+=kon2-y*y*kon1*wt; } } else { sd=sqrt(residual_var[0]*2.0); idx=models[0].var.var_index; for(rec=0;recflag&LOCUS_SAMPLED) { k=locp->gt[id]-1; if(k) y+=eff[k-1]; } if(censflag) { y-=id_array[id].cens[0][rec]; if(gt) y-=eff[gt-1]; p+=log(.5*erfc(y*sqrt(wt)/sd)); } else { if(gt) y-=eff[gt-1]; p+=kon2-y*y*kon1*wt; } } } return p; } loki/lokisrc/loki_sample.c0100644000076500007650000004540310060040422015076 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - Rockefeller University * * * * October 1997 * * * * loki_sample.c: * * * * Main sampling loop * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ /* Jan 9 2004 attempted to add stat 5 code EWD */ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include #include #include #ifdef USE_MONITOR #include #include #include "count_dbr.h" #endif #include "ranlib.h" #include "utils.h" #include "libhdr.h" #include "loki.h" #include "loki_peel.h" #include "seg_pen.h" #include "gen_pen.h" #include "loki_ibd.h" #include "loki_dump.h" #include "loki_tlmoves.h" #include "sample_cens.h" #include "handle_res.h" #include "sample_effects.h" #include "sample_rand.h" #include "print_data.h" #include "calc_var_locus.h" #include "loki_output.h" #include "kinship.h" #include "genedrop.h" #include "sample_nu.h" #include "loki_monitor.h" #include "meiosis_scan.h" #include "update_segs.h" #include "loki_npl.h" #include "read_solar_idfile.h" double *tau_beta,*tau,lm_ratio; int no_overdominant,tau_mode,analysis=DEFAULT_ANALYSIS,genv_out; /* stat5 EWD */ struct lmon_param *lpar; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "SampleLoop" void SampleLoop(struct peel_mem *peel_work,int *si_mode,int read_dump_flag,int append_output_flag,loki_time *lt) { int lp,i,j,j1,j2,k,k1,k2,flag=0,comp,*perm=0,*naffect=0,**affs=0,dumped=0,ibdflag,*ntl_linked=0,*ntl_linked1=0,lp1; FILE *fptr=0,*ffreq=0,*fpos=0,*fmpos=0,*qptr=0; /* EWD */ double z,*ss=0,*ss2=0,**pairs=0,*trpos=0,*trpos1=0; struct output_gen *og; double addlog(double x1,double x2); char *mposname=0,*qname=0; /* EWD */ int *mpos_perm=0,*solar_trans,n_ibd=0; long old_pos=-1; #ifdef USE_MONITOR struct tms tms; #endif /* Output copy of phenotype data if required */ if(Output_Phen) { Print_Data(Output_Phen,lt); free(Output_Phen); } /* Output copy of genotype data if required */ while(Output_Gen) { Print_Genotypes(Output_Gen,lt); og=Output_Gen->next; free(Output_Gen->file); free(Output_Gen); Output_Gen=og; } /* Check for IBD analysis, and set up memory structures if required */ ibdflag=SetupIBD(); if(ibdflag) analysis=(IBD_ANALYSIS|ESTIMATE_IBD); else if(analysis&IBD_ANALYSIS) SetupNPL(); (void)printf("Analysis = %d\n",analysis); set_sort_sex(0); lp=lp1=0; /* Allocate space for trait loci */ TL_Alloc(); /* If standard (quantative) analysis, define normal constants */ if(!analysis) { z=RES_PRIOR_V0*.5; res_prior_konst=log(z)*z-lgamma(z)+log(RES_PRIOR_S0)*z; } if(analysis&NULL_ANALYSIS) est_aff_freq=0; #ifdef USE_MONITOR /* Set up shared memory for loki monitor */ if(n_markers>2 && lpar->dbr_flag) { if(!(init_dbr_shm()) && !(init_dbr_count())) { zero_dbr_count(); fputs("Initialized double recombinant counts\n",stdout); } else lpar->dbr_flag=0; } #endif /* Restarting ? */ if(read_dump_flag) { /* Yes - read in dump file */ (void)fputs("Retrieving program state: ",stdout); (void)fflush(stdout); j=read_dump(&lp,&lp1,&n_ibd,&old_pos,&flag,analysis,lt); if(j<0) { (void)fputs("FAILED\n",stdout); ABT_FUNC(AbMsg); } else (void)fputs("OK\n",stdout); flag&=~6; /* Need to re-do founder genes and calculate seg-probs */ } else { /* No - Get initial genotype samples for all markers */ if(!(analysis&NULL_ANALYSIS)) for(k=0;k0.0 || est_aff_freq || (analysis&IBD_ANALYSIS)) && !(analysis&NULL_ANALYSIS)) { sample_segs(); for(k=0;knum_iter=num_iter; for(i=0;i<2;i++) { lpar->sample_from[i]=sample_from[i]; lpar->sample_freq[i]=sample_freq[i]; } lpar->magic=LMON_MAGIC; for(++lp;!sig_caught && (!num_iter || lp<=num_iter);lp++) { #ifdef USE_MONITOR if(!child_alive) start_monitor(); lpar->extra_time=extra_time; lpar->extra_utime=extra_utime; num_iter=lpar->num_iter; for(i=0;i<2;i++) { sample_from[i]=lpar->sample_from[i]; sample_freq[i]=lpar->sample_freq[i]; } for(k=k1=i=0;iit=lp; lpar->nq=k; lpar->nq1=k1; lpar->utime=tms.tms_utime; switch(lpar->command && !lpar->dbr_flag) { case LMON_START_DBR: if(n_markers>2) { if(!(init_dbr_shm()) && !(init_dbr_count())) { zero_dbr_count(); fputs("Initialized double recombinant counts\n",stdout); lpar->dbr_flag=1; } } } lpar->command=0; #endif #ifdef USE_DMALLOC if(dmalloc_verify(0)==DMALLOC_ERROR) { (void)fprintf(stderr,"[%s:%d] %s(): Error returned from dmalloc_verify().\nAttempting to abort nicely.\n",__FILE__,__LINE__,FUNC_NAME); break; } #endif if(!(analysis&NULL_ANALYSIS)) { /* Sample genetic portion of model */ if(ranf()dbr_flag) { if(!(flag&1)) { sample_segs(); flag|=1; } count_dbr(); } #endif if(analysis&ESTIMATE_IBD) { if(sample_freq[1] && lp>=sample_from[1] && !(lp%sample_freq[1])) (void)printf("At: %d\n",lp); if(sample_freq[0] && lp>=sample_from[0] && !(lp%sample_freq[0])) { n_ibd++; Handle_IBD(); } } else if(analysis&IBD_ANALYSIS) { if(analysis&NULL_ANALYSIS) genedrop(0); for(k=0;k1) { z+=score_ibd(k,&k1,comp,naffect[comp],affs[comp],pairs[comp],*si_mode); k2+=k1; } } if(k2) z=sqrt(z/(double)k2); ss[k]=z; if(analysis&NULL_ANALYSIS) break; } if(sample_freq[0] && lp>=sample_from[0] && !(lp%sample_freq[0])) { (void)fprintf(fptr,"%d",lp); for(k1=0;k1=sample_from[1] && !(lp%sample_freq[1])) { (void)fprintf(stdout,"%d",lp); for(k1=0;k11.0e-8) printf("Warning: err=%g\n",z); #endif k=0; if(sample_freq[0] && lp>=sample_from[0] && !(lp%sample_freq[0])) { for(i=0;i=sample_from[1] && !(lp%sample_freq[1])) { if(!k) for(i=0;i=sample_from[0]) { for(k=0;k<=n_links;k++) ntl_linked[k]=0; for(k1=0;k1=0) (void)fseek(fpos,old_pos,SEEK_SET); else { (void)fseek(fpos,0,SEEK_END); old_pos=ftell(fpos); } if(lp1) (void)fprintf(fpos,":%d\n",lp-lp1); if(!j) { for(j1=k2=k=0;k<=n_links;k++) { ntl_linked1[k]=ntl_linked[k]; if(ntl_linked[k]) { if(j1++) (void)fputc(' ',fpos); (void)fprintf(fpos,"%d %d",k,ntl_linked[k]); if(k) for(k1=0;k1=sample_from[0]) { if(lp==1) { for(k=k1=0;k1 #include #ifdef USE_DMALLOC #include #endif #include #include #include #ifdef HAVE_LIMITS_H #include #endif #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "loki_output.h" #include "mat_utils.h" #include "sample_rand.h" int censored_flag,censor_mode; struct move_stats move_stats[N_MOVE_STATS]; static char *sexstr[2]={"female","male"}; #ifdef DEBUG int *debug_level; #endif static double kosambi_to_haldane(double x) { return x+50.0*log(cosh(.02*x)); } static void marker_outside_error(int j,int k) { int i; i=marker[j].locus.link_group; (void)fputs("Marker",stderr); print_marker_name(stderr,j); if(sex_map) (void)fprintf(stderr," located outside of %s linkage group '%s'\n",sexstr[k],linkage[i].name); else (void)fprintf(stderr," located outside of linkage group '%s'\n",linkage[i].name); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "LokiSetup" void LokiSetup(void) { int i,j,k=-1,fx,k1,k1a,k2a,k3,k2,l,er=0,n_all,comp,sire,dam,*temp_p,grp,*perm,*perm1,mod,cs,*ff; lk_ulong a,b,b1,**a_set; double p,min,max,*temp_dp,**temp_dpp,xx,x; struct Variable *group_var=0; struct Marker *mark; struct Locus *loc,*loc1; if(sex_map) { for(j=i=0;i2) { print_orig_id(stderr,i+1); (void)fputs(" has invalid sex information\n",stderr); er=1; } } } for(i=0;imax_tloci) n_tloci=max_tloci; if(n_tloci) { if(!(tlocus=malloc(sizeof(struct TraitLocus)*n_tloci))) ABT_FUNC(MMsg); for(i=0;ifreq=0; loc->flag=0; loc->seg[0]=0; loc->gt=0; loc->lk_store=0; tlocus[i].eff=0; tlocus[i].model_flag=0; } } } if(n_tloci) { ff=founder_flag[n_markers]; for(j=0;j0.0) break; if(grp==n_genetic_groups) { /* Lumped allele not used so remove */ a=~(LK_ONE<n_all) { for(k1=0;k10.0001) { for(k=j=0;jrec_flag==ST_STRING) (void)fputs(group_var->recode[grp].string,stdout); else (void)printf("%d",group_var->recode[grp].value); } for(j=0;jn_all1[comp]; for(;cs>0;cs--,j++) { mark->ngens[j]=mark->nhaps[j][0]=mark->nhaps[j][1]=mark->m_flag[j]=0; if(id_array[j].pruned_flag[i]) { mark->m_flag[j]=1; continue; } for(k1=0;k1<2;k1++) { a=req_set[k1][i][j]; if(a) { k=0; while(!(a&1)) { k++; a>>=1; } mark->lump[j][k1]=k; } else mark->lump[j][k1]=0; } k1=k1a=k2=k3=0; for(b=b1=0,k=0;k>=1; } } mark->nhaps[j][X_MAT]=k1; mark->temp[j][X_PAT]=b; mark->temp[j][X_MAT]=b1; k1a=k2a=0; while(b) { if(b&1) { k2++; k2a=k1a; } k1a++; b>>=1; } mark->nhaps[j][X_PAT]=k2; mark->ngens[j]=k3; if(k3==1) { for(k1=k=0;km_flag[j]|=1; break; } } } sire=id_array[j].sire; if(sire && id_array[sire-1].pruned_flag[i]) sire=0; dam=id_array[j].dam; if(dam && id_array[dam-1].pruned_flag[i]) dam=0; if(dam) { b=req_set[X_MAT][i][j]; b1=mark->temp[j][X_MAT]; if(b&b1) b1|=b; b=mark->temp[dam-1][X_PAT]; k1=0; if(b1&b) k1=1; b=mark->temp[dam-1][X_MAT]; if(b1&b) k1|=2; if(!k1) ABT_FUNC("Internal error - inconsistency\n"); if(k1!=3) { mark->m_flag[j]|=2; mark->locus.seg[X_MAT][j]=(k1==1?X_PAT:X_MAT); } } if(sire) { b=req_set[X_PAT][i][j]; b1=mark->temp[j][X_PAT]; if(b&b1) b1|=b; b=mark->temp[sire-1][X_PAT]; k1=0; if(b1&b) k1=1; b=mark->temp[sire-1][X_MAT]; if(b1&b) k1|=2; if(!k1) ABT_FUNC("Internal error - inconsistency\n"); if(k1!=3) { mark->m_flag[j]|=4; mark->locus.seg[X_PAT][j]=(k1==1?X_PAT:X_MAT); } } } } } if(!er) { for(j=i=0;ij) j=linkage[i].n_markers; if(j) { if(!(perm=malloc(sizeof(int)*2*j))) ABT_FUNC(MMsg); perm1=perm+j; for(i=0;ilinkage[i].r1[0])?1:0; p=marker[k].locus.pos[1]; k1^=(p>linkage[i].r1[1])?1:0; k=perm[j-1]; p=marker[k].locus.pos[0]; k1|=(ppos[k2]; if(linkage[i].range_set[k2]) { x=xx-linkage[i].r1[k2]; if(x<0.0) { marker_outside_error(k1,k2); er=1; } else loc1->pos[k2]=linkage[i].r1[k2]+kosambi_to_haldane(x); } for(k=1;kpos[k2]-xx); x+=loc1->pos[k2]; xx=loc->pos[k2]; loc->pos[k2]=x; loc1=loc; } if(linkage[i].range_set[k2]) { x=linkage[i].r2[k2]-xx; if(x<0.0) { marker_outside_error(j,k2); er=1; } else linkage[i].r2[k2]=loc1->pos[k2]+kosambi_to_haldane(x); } } if(!sex_map) { for(k=0;kmax) max=marker[j].locus.pos[k]; } if(min==DBL_MAX) min=max=0.0; linkage[i].r1[k]=min; linkage[i].r2[k]=max; if(sex_map) (void)printf("Map range (%s) for linkage group '%s' set to %g-%gcM\n",sexstr[k],linkage[i].name,linkage[i].r1[k],linkage[i].r2[k]); else { (void)printf("Map range for linkage group '%s' set to %g-%gcM\n",linkage[i].name,linkage[i].r1[0],linkage[i].r2[0]); linkage[i].r1[1]=linkage[i].r1[0]; linkage[i].r2[1]=linkage[i].r2[0]; } } else { for(j=0;jlinkage[i].r2[k]) k1=1; if(k1) { marker_outside_error(j,k); er=1; } } } } if(!fx) { /* If no marker in linkage group has a fixed position, arbitrarily fix first marker */ min=DBL_MAX; k1=-1; for(j=0;j=0) { marker[k1].pos_set=1; (void)fputs("Position for marker ",stdout); print_marker_name(stdout,k1); (void)printf(" fixed at %g",marker[k1].locus.pos[0]); if(sex_map) (void)printf(",%g",marker[k1].locus.pos[1]); (void)fputc('\n',stdout); } } } for(k=0;k<1+sex_map;k++) { p=0.0; for(i=0;i=total_maplength[k]) { if(sex_map) (void)printf("Total %s map length <= sum of linkage group sizes - no unlinked loci will be allowed\n",sexstr[k]); else (void)printf("Total map length <= sum of linkage group sizes - no unlinked loci will be allowed\n"); total_maplength[k]=p; } if(!sex_map) total_maplength[1]=total_maplength[0]; } } if(er) exit(EXIT_FAILURE); } loki/lokisrc/loki_simple_peel.c0100644000076500007650000007454410001741567016140 0ustar heathheath#include #ifdef USE_DMALLOC #include #endif #include #include #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "get_par_probs.h" #include "loki_simple_peel.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "loki_simple_peelop" /* Performs simple (i.e., nuclear family based) peeling operation */ double loki_simple_peelop(const struct Simple_Element *element,const int locus,const int s_flag,pen_func pen, lk_ulong **a_set,double **freq,struct R_Func *rf,struct peel_mem *work) { int ids,idd,i,j,k,k1,l,l1,i1,j1,m,n,pivot,fsp=0,n_off,*off,kid,gt[4],of=0,*lump,nb1,nmc,no2=0; int comp,n_all,n_idx,n_bits,*id_set1,*id_set2; double prob=0.0,*tp,p1,z,*tmp,*tmp1,*tpp1,*tpp2; double *qval,*pval,*mval,*pivval,*id_set; lk_ulong a,b,a1,b1,cm[2],*tmp_idx,*tmp_idx1,*cmm[2],mask; lk_ulong *tt_all; struct fset *peel_fs,*t_fset; pivot=element->pivot-1; if(pivot== -3) return peel_to_par(element,locus,pen,a_set,rf,work); ids=element->sire-1; if(ids>=0 && s_flag && pivot== -1) return loki_simple_sample(element,locus,pen,a_set,freq,rf,work); idd=element->dam-1; off=element->off; n_off=element->n_off; kid=off[0]-1; comp=id_array[kid].comp; n_all=marker[locus].n_all1[comp]; n_bits=num_bits(n_all); n_idx=1<<(n_bits+n_bits); mask=(LK_ONE<s2; qval=id_set+k; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%d,%p)\n",FUNC_NAME,(void *)element,locus,s_flag,(void *)pen); if(CHK_PEEL(TRACE_LEVEL_2)) { if(family_id) { print_orig_family(stdout,off[0]+1,0); (void)fputc(' ',stdout); } print_orig_id1(stdout,ids+1); (void)fputc(',',stdout); print_orig_id1(stdout,idd+1); (void)fputc(' ',stdout); for(i=0;i ",stdout); print_orig_id1(stdout,pivot+1); (void)fputc('\n',stdout); } #endif if(ids<0) { /* Peeling singletons */ for(m=0;m0.0) { p1+=qval[i]; if(z<=p1) break; } } while(i==n_idx); id_array[kid].allele[X_MAT]=1+(i&mask); id_array[kid].allele[X_PAT]=1+((i>>n_bits)&mask); id_array[kid].flag|=(SAMPLED_MAT|SAMPLED_PAT); #ifdef DEBUG if(id_array[kid].allele[X_MAT]<1 || id_array[kid].allele[X_MAT]>n_all) { ABT_FUNC("Bad sampled allele\n"); } if(id_array[kid].allele[X_PAT]<1 || id_array[kid].allele[X_PAT]>n_all) { ABT_FUNC("Bad sampled allele\n"); } #endif } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } pval=qval+n_idx; mval=pval+n_idx; pivval=mval+n_idx; peel_fs=work->s0; id_set1=work->s1; id_set2=id_set1+k; tt_all=work->s3; cmm[0]=req_set[0][locus]; cmm[1]=req_set[1][locus]; nb1=1<=0) { /* Insert Previously computed R_Func */ while(a1) { if(a1&1) { a=a_set[idd][j]; l=j; while(a) { if(a&1) mval[l]=0.0; a>>=1; l+=nb1; } } a1>>=1; j++; } for(j=0;j>=1; l+=nb1; } } a1>>=1; j++; } } } if(ids!=pivot && pivot!= -2) { p1=get_par_probs(pval,ids,locus,pen,a_set,freq,rf); prob+=log(p1); } else { a1=id_array[ids].temp[X_MAT]; j=0; if((k=id_array[ids].rfp)>=0) { /* Insert Previously computed R_Func */ while(a1) { if(a1&1) { a=a_set[ids][j]; l=j; while(a) { if(a&1) pval[l]=0.0; a>>=1; l+=nb1; } } a1>>=1; j++; } for(j=0;j>=1; l+=nb1; } } a1>>=1; j++; } } } /* Construct set of possible parental genotype combinations */ nmc=0; k=0; b1=id_array[idd].temp[X_MAT]; while(b1) { if(b1&1) { b=a_set[idd][k]; l=0; m=k; while(b) { if(b&1) { id_set1[nmc]=k; id_set2[nmc]=l; id_set[nmc++]=mval[m]; } b>>=1; l++; m+=nb1; } } b1>>=1; k++; } tmp_idx=tt_all; k1=0; for(m=0;m>=1; } } else tmp_idx[i]=a; } } tmp_idx1=tt_all; for(k=0;kpat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=id_set1[k1]; t_fset->mat_gene[X_PAT]=id_set2[k1]; (t_fset++)->p=p1*id_set[k1]; fsp++; } } a>>=1; j++; } } a1>>=1; i++; } break; case 1: while(a1) { if(a1&1) { a=a_set[ids][i]; j=0; while(a) { if(a&1) { p1=pval[(j<pat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=p1*id_set[k1]; fsp++; } } } a>>=1; j++; } } a1>>=1; i++; } break; case 2: tmp_idx=tt_all+n_all; while(a1) { if(a1&1) { a=a_set[ids][i]; j=0; while(a) { if(a&1) { p1=pval[(j<pat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=p1*id_set[k1]; fsp++; } } } a>>=1; j++; } } a1>>=1; i++; } break; default: while(a1) { if(a1&1) { a=a_set[ids][i]; j=0; while(a) { if(a&1) { p1=pval[(j<pat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=p1*id_set[k1]; fsp++; } } } a>>=1; j++; } } a1>>=1; i++; } } /* Add contributions from non-pivot offspring */ for(m=0;mpat_gene[X_MAT]; j=t_fset->pat_gene[X_PAT]; k=t_fset->mat_gene[X_MAT]; l=t_fset->mat_gene[X_PAT]; i1=i<p*=z; } } else { lump=id_array[kid].lumped; l=lump[X_PAT]<pat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; z=0.0; if((i1|k)==l1) z+=tp[X_MM_PM]; if((j1|k)==l1) z+=tp[X_MM_PP]; if((i1|l)==l1) z+=tp[X_MP_PM]; if((j1|l)==l1) z+=tp[X_MP_PP]; (t_fset++)->p*=z; } } } else { /* Kid not fixed */ if(!pen) { if((k=id_array[kid].rfp)>=0) { /* Insert Previously computed R_Func */ for(j=0;j>=1; tmp+=nb1; k++; } for(;k>=1; j++; } for(;j=0) { /* Insert Previously computed R_Func */ i1=rf[k].n_terms; tmp=rf[k].p; for(j=0;j>=1; tmp+=nb1; } } a1>>=1; j++; } } pen(qval,kid,locus,n_all,n_bits); } if(!(cm[0] || cm[1])) { for(n=0;npat_gene[X_MAT]<mat_gene[X_MAT]; j1=t_fset->pat_gene[X_PAT]<mat_gene[X_PAT]; z=tp[X_MM_PM]*qval[i1|k]+tp[X_MM_PP]*qval[j1|k]+tp[X_MP_PM]*qval[i1|l]+tp[X_MP_PP]*qval[j1|l]; (t_fset++)->p*=z; } } else { lump=id_array[kid].lumped; tpp1=id_array[kid].tpp[X_PAT]; tpp2=id_array[kid].tpp[X_MAT]; l=lump[X_PAT]<pat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; if(i1!=j1) { if(k!=l) z=tp[X_MM_PM]*qval[i1|k]+tp[X_MM_PP]*qval[j1|k]+tp[X_MP_PM]*qval[i1|l]+tp[X_MP_PP]*qval[j1|l]; else z=tpp1[X_MAT]*qval[i1|k]+tpp1[X_PAT]*qval[j1|k]; } else if(k!=l) z=tpp2[X_MAT]*qval[i1|k]+tpp2[X_PAT]*qval[i1|l]; else z=qval[i1|k]; (t_fset++)->p*=z; } } } } #ifdef debug if(!fsp) ABT_FUNC("No possible parental combinations\n"); #endif if(pivot== -2) { /* Peeling to joint on both parents */ p1=0.0; t_fset=peel_fs; for(n=0;np; prob+=log(p1); k=element->out_index; rf[k].n_ind=4; rf[k].n_terms=n; get_rf_memory(rf+k,n,MRK_MBLOCK); t_fset=peel_fs; for(n=0;nmat_gene[X_MAT]+1; gt[1]=t_fset->mat_gene[X_PAT]+1; gt[2]=t_fset->pat_gene[X_MAT]+1; gt[3]=t_fset->pat_gene[X_PAT]+1; rf[k].index[n]=get_index1(4,gt,n_bits); rf[k].p[n]=(t_fset++)->p/p1; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } /* If pivot is an offspring, bring in previous R-Function and zero out * illegal genotypes */ if(pivot>=0 && pivot!=ids && pivot!=idd) { tp=id_array[pivot].tp; cm[0]=cmm[0][pivot]; cm[1]=cmm[1][pivot]; j=0; if((k=id_array[pivot].rfp)>=0) { /* Insert Previously computed R_Func */ for(j=0;j>=1; l+=nb1; } } for(j=0;j>=1; l+=nb1; } } } of=1; } else tp=0; /* Assemble output function in qval */ t_fset=peel_fs; if(pivot<0) { p1=0.0; for(n=0;np; prob+=log(p1); } else { for(j=0;jpat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; z=(t_fset++)->p; qval[i1|k]+=tp[X_MM_PM]*z; qval[j1|k]+=tp[X_MM_PP]*z; qval[i1|l]+=tp[X_MP_PM]*z; qval[j1|l]+=tp[X_MP_PP]*z; } } else { if(idd==pivot) { for(n=0;nmat_gene[X_MAT]; l=t_fset->mat_gene[X_PAT]; z=(t_fset++)->p; qval[(l<pat_gene[X_MAT]; j=t_fset->pat_gene[X_PAT]; z=(t_fset++)->p; qval[(j<>=1; } } } else { for(j=0;j>=1; } } } #ifdef DEBUG if(p1<=0) { fprintf(stderr,"Prob. %g in peeling operation for locus %s",p1,marker[locus].name); if(marker[locus].index) fprintf(stderr,"(%d)",marker[locus].index); fputc('\n',stderr); ABT_FUNC("Aborting\n"); } #endif prob+=log(p1); k=element->out_index; id_array[pivot].rfp=k; rf[k].n_ind=2; rf[k].n_terms=i; #ifdef DEBUG if(!i) ABT_FUNC("Internal error - zero possible combinations\n"); #endif get_rf_memory(rf+k,i,MRK_MBLOCK); p1=1.0/p1; tmp1=rf[k].p; tmp_idx=rf[k].index; for(j=0;j>=1; l+=nb1; } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) { for(j=0;j>n_bits),rf[k].p[j]/p1); } } #endif } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "loki_simple_peelop_x" /* Performs simple (i.e., nuclear family based) peeling operation on x-linked data*/ double loki_simple_peelop_x(const struct Simple_Element *element,const int locus,const int s_flag,pen_func pen, lk_ulong **a_set,double **freq,struct R_Func *rf,struct peel_mem *work) { int ids,idd,i,j,k,k1,l,l1,i1,j1,m,n,pivot,fsp=0,n_off,*off,kid,gt[4],of=0,*lump,nb1,nmc,no2=0; int comp,n_all,n_idx,n_bits,*id_set1,*id_set2,sex; double prob=0.0,*tp,p1,z,*tmp,*tmp1,*tpp1,*tpp2; double *qval,*pval,*mval,*pivval,*id_set; lk_ulong a,b,a1,b1,cm[2],*tmp_idx,*tmp_idx1,*cmm[2],mask; lk_ulong *tt_all; struct fset *peel_fs,*t_fset; pivot=element->pivot-1; if(pivot== -3) return peel_to_par(element,locus,pen,a_set,rf,work); ids=element->sire-1; if(ids>=0 && s_flag && pivot== -1) return loki_simple_sample(element,locus,pen,a_set,freq,rf,work); idd=element->dam-1; off=element->off; n_off=element->n_off; kid=off[0]-1; comp=id_array[kid].comp; n_all=marker[locus].n_all1[comp]; n_bits=num_bits(n_all); n_idx=1<<(n_bits+n_bits); mask=(LK_ONE<s2; qval=id_set+k; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%d,%p)\n",FUNC_NAME,(void *)element,locus,s_flag,(void *)pen); if(CHK_PEEL(TRACE_LEVEL_2)) { if(family_id) { print_orig_family(stdout,off[0]+1,0); (void)fputc(' ',stdout); } print_orig_id1(stdout,ids+1); (void)fputc(',',stdout); print_orig_id1(stdout,idd+1); (void)fputc(' ',stdout); for(i=0;i ",stdout); print_orig_id1(stdout,pivot+1); (void)fputc('\n',stdout); } #endif if(ids<0) { /* Peeling singletons */ for(m=0;m0.0) { p1+=qval[i]; if(z<=p1) break; } } while(i==n_all); id_array[kid].allele[X_MAT]=1+i; id_array[kid].allele[X_PAT]=1; } else { do { z=ranf(); p1=0.0; for(i=0;i0.0) { p1+=qval[i]; if(z<=p1) break; } } while(i==n_idx); id_array[kid].allele[X_MAT]=1+(i&mask); id_array[kid].allele[X_PAT]=1+((i>>n_bits)&mask); } id_array[kid].flag|=(SAMPLED_MAT|SAMPLED_PAT); } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } pval=qval+n_idx; mval=pval+n_idx; pivval=mval+n_idx; peel_fs=work->s0; id_set1=work->s1; id_set2=id_set1+k; tt_all=work->s3; cmm[0]=req_set[0][locus]; cmm[1]=req_set[1][locus]; nb1=1<=0) { /* Insert Previously computed R_Func */ while(a1) { if(a1&1) { a=a_set[idd][j]; l=j; while(a) { if(a&1) mval[l]=0.0; a>>=1; l+=nb1; } } a1>>=1; j++; } for(j=0;j>=1; l+=nb1; } } a1>>=1; j++; } } } if(ids!=pivot && pivot!= -2) { p1=get_par_probs(pval,ids,locus,pen,a_set,freq,rf); prob+=log(p1); } else { a1=id_array[ids].temp[X_MAT]; j=0; if((k=id_array[ids].rfp)>=0) { /* Insert Previously computed R_Func */ while(a1) { if(a1&1) pval[j]=0.0; a1>>=1; j++; } for(j=0;j>=1; j++; } } } /* Construct set of possible parental genotype combinations */ nmc=0; k=0; /* First, collect maternal combinations */ b1=id_array[idd].temp[X_MAT]; while(b1) { if(b1&1) { b=a_set[idd][k]; l=0; m=k; while(b) { if(b&1) { id_set1[nmc]=k; id_set2[nmc]=l; id_set[nmc++]=mval[m]; } b>>=1; l++; m+=nb1; } } b1>>=1; k++; } /* Check requirements from each kid */ tmp_idx=tt_all; k1=0; for(m=0;m>=1; } } else tmp_idx[i]=a; } } tmp_idx1=tt_all; for(k=0;kpat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=id_set1[k1]; t_fset->mat_gene[X_PAT]=id_set2[k1]; (t_fset++)->p=p1*id_set[k1]; fsp++; } } a>>=1; j++; } } a1>>=1; i++; } break; case 1: while(a1) { if(a1&1) { a=a_set[ids][i]; j=0; while(a) { if(a&1) { p1=pval[(j<pat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=p1*id_set[k1]; fsp++; } } } a>>=1; j++; } } a1>>=1; i++; } break; case 2: tmp_idx=tt_all+n_all; while(a1) { if(a1&1) { a=a_set[ids][i]; j=0; while(a) { if(a&1) { p1=pval[(j<pat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=p1*id_set[k1]; fsp++; } } } a>>=1; j++; } } a1>>=1; i++; } break; default: while(a1) { if(a1&1) { p1=pval[i]; b=(LK_ONE<pat_gene[X_MAT]=i; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=p1*id_set[k1]; fsp++; } } } a1>>=1; i++; } } /* Add contributions from non-pivot offspring */ for(m=0;mpat_gene[X_MAT]; j=t_fset->pat_gene[X_PAT]; k=t_fset->mat_gene[X_MAT]; l=t_fset->mat_gene[X_PAT]; i1=i<p*=z; } } else { lump=id_array[kid].lumped; l=lump[X_PAT]<pat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; z=0.0; if((i1|k)==l1) z+=tp[X_MM_PM]; if((j1|k)==l1) z+=tp[X_MM_PP]; if((i1|l)==l1) z+=tp[X_MP_PM]; if((j1|l)==l1) z+=tp[X_MP_PP]; (t_fset++)->p*=z; } } } else { /* Kid not fixed */ if(!pen) { if((k=id_array[kid].rfp)>=0) { /* Insert Previously computed R_Func */ for(j=0;j>=1; tmp+=nb1; k++; } for(;k>=1; j++; } for(;j=0) { /* Insert Previously computed R_Func */ i1=rf[k].n_terms; tmp=rf[k].p; for(j=0;j>=1; tmp+=nb1; } } a1>>=1; j++; } } pen(qval,kid,locus,n_all,n_bits); } if(!(cm[0] || cm[1])) { for(n=0;npat_gene[X_MAT]<mat_gene[X_MAT]; j1=t_fset->pat_gene[X_PAT]<mat_gene[X_PAT]; z=tp[X_MM_PM]*qval[i1|k]+tp[X_MM_PP]*qval[j1|k]+tp[X_MP_PM]*qval[i1|l]+tp[X_MP_PP]*qval[j1|l]; (t_fset++)->p*=z; } } else { lump=id_array[kid].lumped; tpp1=id_array[kid].tpp[X_PAT]; tpp2=id_array[kid].tpp[X_MAT]; l=lump[X_PAT]<pat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; if(i1!=j1) { if(k!=l) z=tp[X_MM_PM]*qval[i1|k]+tp[X_MM_PP]*qval[j1|k]+tp[X_MP_PM]*qval[i1|l]+tp[X_MP_PP]*qval[j1|l]; else z=tpp1[X_MAT]*qval[i1|k]+tpp1[X_PAT]*qval[j1|k]; } else if(k!=l) z=tpp2[X_MAT]*qval[i1|k]+tpp2[X_PAT]*qval[i1|l]; else z=qval[i1|k]; (t_fset++)->p*=z; } } } } #ifdef debug if(!fsp) ABT_FUNC("No possible parental combinations\n"); #endif if(pivot== -2) { /* Peeling to joint on both parents */ p1=0.0; t_fset=peel_fs; for(n=0;np; prob+=log(p1); k=element->out_index; rf[k].n_ind=4; rf[k].n_terms=n; get_rf_memory(rf+k,n,MRK_MBLOCK); t_fset=peel_fs; for(n=0;nmat_gene[X_MAT]+1; gt[1]=t_fset->mat_gene[X_PAT]+1; gt[2]=t_fset->pat_gene[X_MAT]+1; gt[3]=t_fset->pat_gene[X_PAT]+1; rf[k].index[n]=get_index1(4,gt,n_bits); rf[k].p[n]=(t_fset++)->p/p1; } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } /* If pivot is an offspring, bring in previous R-Function and zero out * illegal genotypes */ if(pivot>=0 && pivot!=ids && pivot!=idd) { tp=id_array[pivot].tp; cm[0]=cmm[0][pivot]; cm[1]=cmm[1][pivot]; j=0; if((k=id_array[pivot].rfp)>=0) { /* Insert Previously computed R_Func */ for(j=0;j>=1; l+=nb1; } } for(j=0;j>=1; l+=nb1; } } } of=1; } else tp=0; /* Assemble output function in qval */ t_fset=peel_fs; if(pivot<0) { p1=0.0; for(n=0;np; prob+=log(p1); } else { for(j=0;jpat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; z=(t_fset++)->p; qval[i1|k]+=tp[X_MM_PM]*z; qval[j1|k]+=tp[X_MM_PP]*z; qval[i1|l]+=tp[X_MP_PM]*z; qval[j1|l]+=tp[X_MP_PP]*z; } } else { if(idd==pivot) { for(n=0;nmat_gene[X_MAT]; l=t_fset->mat_gene[X_PAT]; z=(t_fset++)->p; qval[(l<pat_gene[X_MAT]; j=t_fset->pat_gene[X_PAT]; z=(t_fset++)->p; qval[(j<>=1; } } } else { for(j=0;j>=1; } } } #ifdef DEBUG if(p1<=0) { fprintf(stderr,"Prob. %g in peeling operation for locus %s",p1,marker[locus].name); if(marker[locus].index) fprintf(stderr,"(%d)",marker[locus].index); fputc('\n',stderr); ABT_FUNC("Aborting\n"); } #endif prob+=log(p1); k=element->out_index; id_array[pivot].rfp=k; rf[k].n_ind=2; rf[k].n_terms=i; #ifdef DEBUG if(!i) ABT_FUNC("Internal error - zero possible combinations\n"); #endif get_rf_memory(rf+k,i,MRK_MBLOCK); p1=1.0/p1; tmp1=rf[k].p; tmp_idx=rf[k].index; for(j=0;j>=1; l+=nb1; } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_3)) { for(j=0;j>n_bits),rf[k].p[j]/p1); } } #endif } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } loki/lokisrc/loki_simple_peel.h0100644000076500007650000000103110001741572016116 0ustar heathheathdouble loki_simple_sample(const struct Simple_Element *,const int,pen_func,lk_ulong **,double **,struct R_Func *,struct peel_mem *); double loki_simple_peelop(const struct Simple_Element *,const int,const int,pen_func,lk_ulong **,double **,struct R_Func *,struct peel_mem *); double loki_simple_peelop_x(const struct Simple_Element *,const int,const int,pen_func,lk_ulong **,double **,struct R_Func *,struct peel_mem *); double peel_to_par(const struct Simple_Element *,const int,pen_func,lk_ulong **,struct R_Func *,struct peel_mem *); loki/lokisrc/loki_simple_sample.c0100644000076500007650000004141610001741567016464 0ustar heathheath#include #ifdef USE_DMALLOC #include #endif #include #include #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "get_par_probs.h" #include "loki_simple_peel.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "loki_simple_sample" /* Sample a nuclear family */ double loki_simple_sample(const struct Simple_Element *element,const int locus,pen_func pen, lk_ulong **a_set,double **freq,struct R_Func *rf,struct peel_mem *work) { int ids,idd,i,j,i1,j1,k,l,l1,m,n,fsp=0,n_off,*off,kid,*lump,*off_flag,no=0,no1=0,nb1,nmc,no2=0; int n_all,n_idx,comp,n_bits,*peel_pt2,*id_set1,*id_set2; double *tp,p1,p2,z,z1,prob=0.0,pp[4],*tmp,*tpp1,*tpp2; double *qval,*pval,*mval,*id_set; lk_ulong a,a1,b,b1,cm[2],*cm1[2],cmp,cmm,*t_cm,*t_all1,*t_all2; lk_ulong *tt_all,*peel_pt1; struct fset *peel_fs,*t_fset; ids=element->sire-1; idd=element->dam-1; comp=id_array[ids].comp; n_all=marker[locus].n_all1[comp]; n_bits=num_bits(n_all); n_idx=1<<(n_bits+n_bits); off=element->off; n_off=element->n_off; nb1=1<s0; id_set1=work->s1; id_set2=id_set1+k; id_set=work->s2; qval=id_set+k; pval=qval+n_idx; mval=pval+n_idx; tt_all=work->s3; peel_pt1=tt_all+max_peel_off*n_all; peel_pt2=work->s4; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%p)\n",FUNC_NAME,(void *)element,locus,(void *)pen); if(CHK_PEEL(TRACE_LEVEL_2)) { if(family_id) { print_orig_family(stdout,off[0]+1,0); (void)fputc(' ',stdout); } print_orig_id1(stdout,ids+1); (void)fputc(',',stdout); print_orig_id1(stdout,idd+1); (void)fputc(' ',stdout); for(i=0;i1) { for(i=1;i1) { for(i=1;i>=1; } } else t_all1[i]=a; } } t_all2=tt_all; for(k=0;kpat_gene[X_MAT]=id_array[ids].allele[X_MAT]-1; t_fset->pat_gene[X_PAT]=id_array[ids].allele[X_PAT]-1; t_fset->mat_gene[X_MAT]=id_array[idd].allele[X_MAT]-1; t_fset->mat_gene[X_PAT]=id_array[idd].allele[X_PAT]-1; t_fset->p=1.0; fsp=1; } else { i=id_array[ids].allele[X_MAT]-1; j=id_array[ids].allele[X_PAT]-1; cmp=(LK_ONE<pat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=mval[l1]; fsp++; } } } b>>=1; l++; l1+=nb1; } } } } else if(id_array[idd].flag&SAMPLED_MAT) { k=id_array[idd].allele[X_MAT]-1; l=id_array[idd].allele[X_PAT]-1; for(i=0;ipat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=pval[l1]; fsp++; } } } a>>=1; j++; l1+=nb1; } } } else { for(nmc=k=0;k>=1; l++; l1+=nb1; } } switch(no2) { case 1: for(a1=LK_ONE,i=0;ipat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=z*id_set[l1]; fsp++; } } } } a>>=1; j++; b1<<=1; } } break; case 2: t_all1=tt_all+n_all; for(a1=LK_ONE,i=0;ipat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=z*id_set[l1]; fsp++; } } } } a>>=1; j++; b1<<=1; } } break; case 0: for(a1=LK_ONE,i=0;ipat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=id_set1[l1]; t_fset->mat_gene[X_PAT]=id_set2[l1]; (t_fset++)->p=z*id_set[l1]; fsp++; } } } a>>=1; j++; b1<<=1; } } break; default: for(a1=LK_ONE,i=0;ipat_gene[X_MAT]=i; t_fset->pat_gene[X_PAT]=j; t_fset->mat_gene[X_MAT]=k; t_fset->mat_gene[X_PAT]=l; (t_fset++)->p=z*id_set[l1]; fsp++; } } } } a>>=1; j++; b1<<=1; } } } } #ifdef DEBUG if(!fsp) { ABT_FUNC(" - Internal error - no parental combinations\n"); } for(k=0;kpat_gene[X_MAT]<pat_gene[X_PAT]<p*=z; } else { lump=id_array[kid].lumped; l=lump[X_PAT]<pat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; z=0.0; if((i1|k)==l1) z+=tp[X_MM_PM]; if((j1|k)==l1) z+=tp[X_MM_PP]; if((i1|l)==l1) z+=tp[X_MP_PM]; if((j1|l)==l1) z+=tp[X_MP_PP]; (t_fset++)->p*=z; } } } else { if(!pen) { if((k=id_array[kid].rfp)>=0) {/* Insert Previously computed R_Func */ for(i1=0;i1>=1; tmp+=nb1; k++; } for(;k=0) { /* Insert Previously computed R_Func */ i1=rf[k].n_terms; tmp=rf[k].p; for(j=0;j>=1; tmp+=nb1; } } } pen(qval,kid,locus,n_all,n_bits); } if(!(cm[0] || cm[1])) for(n=0;npat_gene[X_MAT])<pat_gene[X_PAT])<mat_gene[X_MAT]; l=t_fset->mat_gene[X_PAT]; z=tp[X_MM_PM]*qval[i1|k]+tp[X_MM_PP]*qval[j1|k]+tp[X_MP_PM]*qval[i1|l]+tp[X_MP_PP]*qval[j1|l]; (t_fset++)->p*=z; } else { lump=id_array[kid].lumped; l=lump[X_PAT]<pat_gene[X_MAT]]; j1=id_set1[t_fset->pat_gene[X_PAT]]; k=id_set2[t_fset->mat_gene[X_MAT]]; l=id_set2[t_fset->mat_gene[X_PAT]]; z=tp[X_MM_PM]*qval[i1|k]+tp[X_MM_PP]*qval[j1|k]+tp[X_MP_PM]*qval[i1|l]+tp[X_MP_PP]*qval[j1|l]; (t_fset++)->p*=z; } } } #ifdef DEBUG for(k=0;kp; if(p2>=z) { id_array[ids].allele[X_MAT]=t_fset->pat_gene[X_MAT]+1; id_array[ids].allele[X_PAT]=t_fset->pat_gene[X_PAT]+1; id_array[idd].allele[X_MAT]=t_fset->mat_gene[X_MAT]+1; id_array[idd].allele[X_PAT]=t_fset->mat_gene[X_PAT]+1; id_array[ids].flag|=(SAMPLED_MAT|SAMPLED_PAT); id_array[idd].flag|=(SAMPLED_MAT|SAMPLED_PAT); #ifdef DEBUG if(id_array[ids].allele[X_MAT]<1 || id_array[ids].allele[X_MAT]>n_all) { ABT_FUNC("Bad sample allele\n"); } if(id_array[ids].allele[X_PAT]<1 || id_array[ids].allele[X_PAT]>n_all) { ABT_FUNC("Bad sample allele\n"); } if(id_array[idd].allele[X_MAT]<1 || id_array[idd].allele[X_MAT]>n_all) { ABT_FUNC("Bad sample allele\n"); } if(id_array[idd].allele[X_MAT]<1 || id_array[idd].allele[X_PAT]>n_all) { ABT_FUNC("Bad sample allele\n"); } #endif break; } } } while(n==fsp); } for(m=0;m=0) {/* Insert Previously computed R_Func */ for(i1=0;i1>=1; tmp+=nb1; k++; } for(;k=0) {/* Insert Previously computed R_Func */ i1=rf[k].n_terms; tmp=rf[k].p; for(j=0;j>=1; tmp+=nb1; } } } pen(qval,kid,locus,n_all,n_bits); } /* transmission probs */ tp=id_array[kid].tp; cm[0]=req_set[0][locus][kid]; cm[1]=req_set[1][locus][kid]; i=id_array[ids].allele[X_MAT]-1; j=id_array[ids].allele[X_PAT]-1; k=id_array[idd].allele[X_MAT]-1; l=id_array[idd].allele[X_PAT]-1; if((LK_ONE<0.0) { p2+=z1; if(z<=p2) break; } } } while(n<0); switch(n) { case X_MM_PM: id_array[kid].allele[X_MAT]=k+1; id_array[kid].allele[X_PAT]=i+1; break; case X_MM_PP: id_array[kid].allele[X_MAT]=k+1; id_array[kid].allele[X_PAT]=j+1; break; case X_MP_PM: id_array[kid].allele[X_MAT]=l+1; id_array[kid].allele[X_PAT]=i+1; break; case X_MP_PP: id_array[kid].allele[X_MAT]=l+1; id_array[kid].allele[X_PAT]=j+1; break; default: ABT_FUNC("Internal error - illegal sample\n"); } id_array[kid].flag|=(SAMPLED_MAT|SAMPLED_PAT); #ifdef DEBUG if(id_array[kid].allele[X_MAT]<1 || id_array[kid].allele[X_MAT]>n_all) { ABT_FUNC("Bad sampled allele\n"); } if(id_array[kid].allele[X_PAT]<1 || id_array[kid].allele[X_PAT]>n_all) { ABT_FUNC("Bad sampled allele\n"); } #endif } k=element->out_index; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_2)) { (void) printf("Returning from %s() with %g\n",FUNC_NAME,prob); } #endif return prob; } loki/lokisrc/loki_tlmoves.c0100644000076500007650000006163110001741567015324 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - Rockefeller University * * * * November 1997 * * * * loki_tlmoves.c: * * * * Lots of the more weird update moves * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include #include #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "loki_tlmoves.h" #include "handle_res.h" #include "sample_cens.h" static int *perm; static double *prior,*new_freq; static double safe_exp(double x) { static double max_arg; static char f=0; if(!f) { max_arg=log(DBL_MAX); f=1; } if(x>max_arg) return DBL_MAX; if(x<-max_arg) return 0.0; return exp(x); } static void Adjust_for_TL(const int tl,const double z) { int i,j,k,type; double *eff; int *gt; eff=tlocus[tl].eff[0]; gt=tlocus[tl].locus.gt; type=models[0].var.type; if(type&ST_CONSTANT) { for(i=0;i=linkage[link].r2[0]) p[2]=0.0; } if(p[0]>0.0) p[0]*=interval_size(j-1,k,link,pm); p[1]*=(z1=interval_size(j,k,link,pm)); if(p[2]>0.0) p[2]*=interval_size(j+1,k,link,pm); z=p[0]+p[1]+p[2]; for(k1=0;k1<3;k1++) p[k1]/=z; return z1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "sample_mpos" void sample_mpos(const int link) { int i,j,locus,k2=-1,k3,ids,idd,sx,**seg,s,s1; double pp[2][50],ct1[2][50],ct2[2][50],x,x1,r,z,z1; struct Locus *loc; get_locuslist(perm,link,&k3,0); gnu_qsort(perm,(size_t)k3,(size_t)sizeof(int),cmp_loci_pos); for(i=0;iseg; x=loc->pos[sx]; k2=seg[sx][i]; if(k2<0) { if(j) { r=.5*(1.0-exp(.02*(x1-x))); pp[0][j]=pp[0][j-1]*(1.0-r)+pp[1][j-1]*r; pp[1][j]=pp[1][j-1]*(1.0-r)+pp[0][j-1]*r; } else pp[0][j]=pp[1][j]=0.5; } else { #ifdef DEBUG if(k2<0 || k2>1) ABT_FUNC("OOOOK!\n"); #endif pp[k2][j]=1.0; pp[1-k2][j]=0.0; } x1=x; } if(k2<0) { z=ranf()*(pp[0][k3-1]+pp[1][k3-1]); s=(z<=pp[0][k3-1]?0:1); } else s=k2; for(j=k3-2;j>=0;j--) { s1=s; x1=x; locus=perm[j]; loc=locus<0?&tlocus[-1-locus].locus:&marker[locus].locus; seg=loc->seg; x=loc->pos[sx]; k2=seg[sx][i]; if(k2<0) { r=.5*(1.0-exp(.02*(x-x1))); pp[s1][j]*=1.0-r; pp[1-s1][j]*=r; z=ranf()*(pp[0][j]+pp[1][j]); s=(z<=pp[0][j]?0:1); } else { s=k2; } if(s!=s1) ct1[sx][j]+=1.0; else ct2[sx][j]+=1.0; } } } if(sex_map) { for(sx=0;sx<2;sx++) { for(j=0;j=0.5); x-=50.0*log(1.0-2.0*r); if(locus<0) { tlocus[-1-locus].locus.pos[sx]=x; } else { marker[locus].locus.pos[sx]=x; } } } } } else { for(j=0;j=0.5); /* x-=50.0*log(1.0-2.0*r); if(locus<0) { tlocus[-1-locus].locus.pos[0]=x; tlocus[-1-locus].locus.pos[1]=x; } else { marker[locus].locus.pos[0]=x; marker[locus].locus.pos[1]=x; } */ } } } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Sample_LinkageGroup" /* Sample genotypes for all marker loci in linkage group - trait loci are sampled during * movement step - see Sample_TL_Position() */ void Sample_LinkageGroup(const int link,struct peel_mem *work,int si) { int i,j,k1,k2,k3,*perm1; #ifdef DEBUG if((*debug_level)&4) (void)printf("[S:%d]",link); (void)fflush(stdout); #endif /* sample_mpos(link); */ k2=linkage[link].n_markers+n_tloci; perm1=perm+k2; get_locuslist(perm1,link,&k3,0); for(i=0;i=0) { (void)peel_locus(perm1,j,k3,1,work,si); } } #ifdef DEBUG if((*debug_level)&4) { (void)fputc('*',stdout); (void)fflush(stdout); } #endif } double calc_tl_like(const int tl,int *perm,const int sflag,struct peel_mem *work,int si) { int i,k,link; double l; link=tlocus[tl].locus.link_group; if(link<0) { perm[0]= -(tl+1); i=0; k=1; } else { get_locuslist(perm,link,&k,0); gnu_qsort(perm,(size_t)k,(size_t)sizeof(int),cmp_loci_pos); for(i=0;i1.0e-8) { fprintf(stderr,"%g %g %g\n",l,l1,l-l1); ABT_FUNC("Likelihood mismatch\n"); } #endif } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Sample_TL_Position" /* Sample a new position for trait locus. Allows moves to be made between * linkage groups (including to and from unlinked). * BIGMOVE_PROB is the probability of proposing a large move (uniform over entire genome) * vs. a small move (current location +/- 1 interval) * If unlinked then a move to linked is always attempted. */ void Sample_TL_Position(const int tl,struct peel_mem *work,int si) { int i,j,j2,k,k1,k2,fg,link,oldlink,step; double l,l1,old_pos[2],map_length,z,z1,z2,r,*prob,ttm,p_i[3],p_i1[3],s1,s2; /* In the case of no linkage groups, just sample genotypes for trait locus and return */ if(!n_links) { (void)calc_tl_like(tl,perm,1,work,si); return; } prob=prior+n_links+1; /* Set up prior probs. for chromosomes (and unlinked region) */ /* Note that we use the average of sex-specific maps */ for(i=0;i<=n_links;i++) prior[i]=0.0; ttm=0.0; for(k=0;k<=sex_map;k++) { z=total_maplength[k]; ttm+=z; for(i=0;i0.0 && ranf()<=BIGMOVE_PROB)) { step=5; z=0.0; for(i=0;i<=n_links;i++) { z+=prior[i]; prob[i]=z; } if(link== -1) { /* If already unlinked, prevent choosing unlinked again */ z-=prior[n_links]; prob[n_links]=z; j=n_links; } else j=n_links+1; #ifdef DEBUG if(z<=0.0) ABT_FUNC("Internal error - no possible move\n"); #endif do { r=z*safe_ranf(); for(i=0;i0.0 && r<=prob[i]) break; } while(i==j); link=i; if(link==n_links) { link= -1; tlocus[tl].locus.pos[0]=tlocus[tl].locus.pos[1]=0.0; } else { if(link) r-=prob[link-1]; /* Get position within the chromosome we've landed on relative to left of linkage map */ /* Get list of loci on linkage group (excluding current locus) */ fg=tlocus[tl].locus.flag; tlocus[tl].locus.flag&=~TL_LINKED; get_locuslist(perm,link,&k,0); gnu_qsort(perm,(size_t)k,(size_t)sizeof(int),cmp_loci_pos); tlocus[tl].locus.flag=fg; if(sex_map) { /* Find interval */ for(j=0;j=r) break; } /* Sample male and female positions (independently) within chosen interval */ for(k2=0;k2<2;k2++) { if(j=0) z1=ttm/(BIGMOVE_PROB*(ttm-prior[n_links])); else if(link>=0 && oldlink<0) z1=BIGMOVE_PROB*(ttm-prior[n_links])/ttm; } if(link<0) { tlocus[tl].locus.flag&=~TL_LINKED; tlocus[tl].locus.flag|=TL_UNLINKED; } else { tlocus[tl].locus.flag&=~TL_UNLINKED; tlocus[tl].locus.flag|=TL_LINKED; } } else { /* 'Small' move - move at most 1 interval from current location */ step=4; get_locuslist(perm,link,&k,0); gnu_qsort(perm,(size_t)k,(size_t)sizeof(int),cmp_loci_pos); for(j=0;j0.0) { z+=p_i[k2]; if(z2<=z) break; } } while(k2==3); /* Have we changed intervals? */ if(k2!=1) { j2=j+k2-1; /* Compute probs. for new interval */ s2=check_intervals(j2,k,link,perm,p_i1,SMALLMOVE_P); /* Compute proposal probability */ z1=(s2/s1)*p_i1[2-k2]/p_i[k2]; } else j2=j; /* Sample new positions */ for(k2=0;k2<=sex_map;k2++) { if(j2) { k1=perm[j2-1]; if(k1<0) z=tlocus[-1-k1].locus.pos[k2]; else z=marker[k1].locus.pos[k2]; } else z=linkage[link].r1[k2]; if(j2=z) { i=1; tlocus[tl].locus.pos[0]=old_pos[0]; tlocus[tl].locus.pos[1]=old_pos[1]; link=oldlink; tlocus[tl].locus.link_group=link; if(link<0) { tlocus[tl].locus.flag&=~TL_LINKED; tlocus[tl].locus.flag|=TL_UNLINKED; } else { tlocus[tl].locus.flag&=~TL_UNLINKED; tlocus[tl].locus.flag|=TL_LINKED; } #ifdef DEBUG if((*debug_level)&4) (void)fputc('F',stdout); #endif } else { #ifdef DEBUG if((*debug_level)&4) (void)fputc('S',stdout); #endif move_stats[step].success++; } /* Always sample genotypes before returning */ #ifdef DEBUG z=calc_tl_like(tl,perm,1,work,si); if(z== -DBL_MAX) ABT_FUNC("Internal error - zero probability at end of Move Step\n"); if((*debug_level)&4) (void)fflush(stdout); #else (void)calc_tl_like(tl,perm,1,work,si); #endif } int get_tl_position(double *pos) { int i,j,k,k1,k2,link; double z,z1,z2,map_length; if(!n_markers) { pos[0]=pos[1]=0; return -1; } for(i=0;i<=n_links;i++) prior[i]=0.0; z1=0.0; for(k=0;k<=sex_map;k++) { z=total_maplength[k]; z1+=z; for(i=0;i0.0) { z+=prior[i]; if(z2<=z) { z1=z2+prior[i]-z; break; } } } } while(i==n_links+1); link=(i==n_links?-1:i); if(link<0) pos[0]=pos[1]=0.0; else if(sex_map) { /* Get list of loci on linkage group */ get_locuslist(perm,link,&k,0); gnu_qsort(perm,(size_t)k,(size_t)sizeof(int),cmp_loci_pos); /* Find interval */ for(j=0;j=z1) break; } /* Sample male and female positions (independently) within chosen interval */ for(k2=0;k2<2;k2++) { if(jmin_tloci?DEATH_STEP:0.0; /* Death step possible if no. QTL not at minimum */ for(z=0.0,i=0;i<2;i++) z+=pp[i]; /* We have a fixed no. loci - can't change anything */ if(z<=0.0) return; step=(ranf()*z<=pp[0])?0:1; r=pp[step]/z; /* Proposal probability for step */ if(!step) { /* Get position for new TL */ newlink=get_tl_position(newpos); } else { newlink=0; newpos[0]=newpos[1]=0.0; } va_prop=residual_var[0]*PROP_RATIO; vd_prop=residual_var[0]*PROP_RATIO; /* Find proposal distribution for next time if current step was to be accepted */ if(step) { /* Death steps reduce QTL numbers by 1 */ pp[0]=BIRTH_STEP; pp[1]=((nq-1)>min_tloci)?DEATH_STEP:0.0; } else { /* Birth steps increase QTL numbers by 1 */ pp[0]=(j-1)?BIRTH_STEP:0.0; pp[1]=DEATH_STEP; } for(z=0.0,i=0;i<2;i++) z+=pp[i]; #ifdef DEBUG if((*debug_level)&4) (void)printf("[%d]",step); #endif move_stats[step].n++; mtype=models[0].var.type; if(!censor_mode && (mtype&ST_CENSORED)) { cens_flag=1; res_fn=&Calc_CensResLike; } else { cens_flag=0; res_fn=&Calc_ResLike; } old_res=res_fn(); #ifdef DEBUG if(old_res== -DBL_MAX) ABT_FUNC("Internal error - zero probability at start of Birth/Death step\n"); #endif /* If censoring and integrating over censored values, the sampled censored * values will be invalid here, and will need to be sampled */ if(cens_flag) Sample_Censored(); old_res_var=residual_var[0]; /* If censoring and integrating over censored values, the sampled censored * values will be invalid here, and will need to be sampled */ if(cens_flag) Sample_Censored(); if(!step) { /* Birth Step */ r=pp[1]/(z*r); /* Proposal ratio q(death)/q(birth) */ /* Factor in Poisson prior on number of loci */ if(tloci_mean_set) r*=tloci_mean/(double)(1+nq); u1=genexp(va_prop); u2=genexp(vd_prop); for(u3=0.0,i=0;ifabs(a)) { #ifdef DEBUG if((*debug_level)&4) { (void)fputc('f',stdout); (void)fflush(stdout); } #endif return; } q1=Calc_Resprop(); /* Find next available unused QTL */ x=get_new_traitlocus(2); tlocus[x].model_flag=1; tlocus[x].locus.pos[0]=newpos[0]; tlocus[x].locus.pos[1]=newpos[1]; tlocus[x].locus.link_group=newlink; tlocus[x].locus.flag=(newlink<0?TL_UNLINKED:TL_LINKED); /* Get likelihood for QTL not in models[0] */ l=old_res; for(i=0;i(effect[0],effect[1],p) */ z1+=.5*(log(2.0*u1*u2)+3.0*(log(u3)+log(1.0-u3))); /* Acceptance ratio */ alpha=safe_exp(l1+z-l-z1+q1); #ifdef DEBUG if((*debug_level)&8) {(void)printf("<%g,%g,%g,%g,%g>",l,l1,z,z1,q1);} #endif if(alpha1.0e-8) { (void)printf("Birth: %g %g %g %d\n",old_res,l,z,er); ABT_FUNC("aborting\n"); } } if((*debug_level)&4) (void)fputc('F',stdout); #endif } } else if(step==1) { /* Death_Step */ r=pp[0]/(z*r); /* Proposal ratio q(birth)/q(death) */ /* Factor in Poisson prior on number of loci */ if(tloci_mean_set) r*=(double)nq/tloci_mean; /* Pick a non-blank QTL at random */ i=(int)(safe_ranf()*(double)nq); for(x=0;x(effect[0],effect[1],p) */ z1+=.5*(log(2.0*u1*u2)+3.0*(log(u3)+log(1.0-u3))); /* Acceptance ratio */ alpha=safe_exp(l1-l-z+z1+q1); if(alpha1.0e-8) { (void)printf("Death 1: %g %g %g %d\n",old_res,l,z,er); ABT_FUNC("aborting\n"); } l=calc_tl_like(x,perm,0,work,si); z=fabs(l-old_l); if(z>1.0e-8) { (void)printf("Death 2: %g %g %g %d\n",old_l,l,z,er); ABT_FUNC("aborting\n"); } } if((*debug_level)&4) (void)fputc('F',stdout); #endif } } } loki/lokisrc/loki_tlmoves.h0100644000076500007650000000315510001741572015322 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - Rockefeller University * * * * November1997 * * * * loki_tlmoves.h: * * * * Defines for move probabilities * * * ****************************************************************************/ #define BIGMOVE_PROB .25 #define SMALLMOVE_P 0.5 #define BETA_A 5.75 #define BETA_B 1.25 #define BIRTH_STEP 0.5 #define DEATH_STEP 0.5 #define PROP_RATIO 0.1 extern void Sample_LinkageGroup(const int,struct peel_mem *,int); extern void Sample_TL_Position(const int,struct peel_mem *,int); extern void TL_Birth_Death(struct peel_mem *,int); extern void TL_Alloc(void),TL_Free(void); extern double calc_tl_like(const int,int *,const int,struct peel_mem *,int); extern int get_tl_position(double *); #ifdef DEBUG extern void Flip_TL_Alleles(const int,int,struct peel_mem *); #else extern void Flip_TL_Alleles(const int); #endif loki/lokisrc/loki_trait_simple_peel.c0100644000076500007650000002261310001741567017331 0ustar heathheath#include #ifdef USE_DMALLOC #include #endif #include #include #include #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "get_par_probs.h" #include "loki_trait_simple_peel.h" #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "loki_trait_simple_peelop" /* Similar to loki_simple_peelop, but for a trait locus */ double loki_trait_simple_peelop(const struct Simple_Element *element,const int locus,const int s_flag,double **freq,struct R_Func *rf,trait_pen_func *trait_pen,struct peel_mem *work) { int ids,idd,i,j,k,m,n,pivot,n_off,*off,kid,*ix,link,n_all,n_idx; int ix1[]={0,3,12,15}; int ix2[]={0,4,8,12,1,5,9,13,2,6,10,14,3,7,11,15}; int ix3[]={5,6,9,10}; double prob=0.0,*tp,*tpp,p1,z,z1,*tmp,*tmp1,*qval,*mval,*pval,*peel_famval; pivot=element->pivot-1; #ifdef DEBUG if(pivot== -3) ABT_FUNC("Internal error - this peeling operation should not occur with a trait locus\n"); #endif ids=element->sire-1; idd=element->dam-1; off=element->off; n_off=element->n_off; n_all=tlocus[-1-locus].locus.n_alleles; n_idx=n_all*n_all; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("%s(%p,%d,%d)\n",FUNC_NAME,(void *)element,locus,s_flag); if(CHK_PEEL(TRACE_LEVEL_2)) { if(family_id) { print_orig_family(stdout,off[0]+1,0); (void)fputc(' ',stdout); } print_orig_id1(stdout,ids+1); (void)fputc(',',stdout); print_orig_id1(stdout,idd+1); (void)fputc(' ',stdout); for(i=0;i ",stdout); if(pivot==-2) { print_orig_id1(stdout,ids+1); (void)fputc(',',stdout); print_orig_id1(stdout,idd+1); } else if(pivot<-2) printf("[%d]",pivot); else print_orig_id1(stdout,pivot+1); (void)fputc('\n',stdout); } #endif peel_famval=work->s2; qval=peel_famval+16; if(ids<0) { /* Peeling singletons */ for(m=0;mpivot)) return loki_trait_simple_sample(element,locus,s_flag,freq,rf,trait_pen,work); pval=qval+n_idx; mval=pval+n_idx; if(idd!=pivot && pivot!= -2) { p1=get_trait_par_probs(mval,idd,locus,trait_pen,freq,rf); #ifdef DEBUG if(isnan(p1)) ABT_FUNC("Floating point error\n"); #endif if(p1<=0.0) { if(!(s_flag&1)) { return -DBL_MAX; } ABT_FUNC("Zero probability in peeling operation\n"); } prob+=log(p1); } else { tmp=mval; if((k=id_array[idd].rfp)>=0) { /* Insert Previously computed R_Func */ tmp1=rf[k].p; for(j=0;j<4;j++) *(tmp++)=(*tmp1++); } else for(j=0;j<4;j++) *(tmp++)=1.0; } if(ids!=pivot && pivot!= -2) { p1=get_trait_par_probs(pval,ids,locus,trait_pen,freq,rf); #ifdef DEBUG if(isnan(p1)) ABT_FUNC("Floating point error\n"); #endif if(p1<=0.0) { if(!(s_flag&1)) { return -DBL_MAX; } ABT_FUNC("Zero probability in peeling operation\n"); } prob+=log(p1); } else { tmp=pval; if((k=id_array[ids].rfp)>=0) { /* Insert Previously computed R_Func */ tmp1=rf[k].p; for(j=0;j=0) { /* Insert Previously computed R_Func */ tmp1=rf[k].p; for(j=0;j<4;j++) *(tmp++)=(*tmp1++); } else for(j=0;j<4;j++) *(tmp++)=1.0; if(id_array[kid].res[0]) trait_pen(qval,kid,locus); p1=0.0; tmp=qval; for(k=0;k<4;k++) p1+=*(tmp++); #ifdef DEBUG if(isnan(p1)) ABT_FUNC("Floating point error\n"); #endif if(p1<=0.0) { if(!(s_flag&1)) { return -DBL_MAX; } ABT_FUNC("Zero probability in peeling operation\n"); } prob+=log(p1); z=1.0/p1; /* First do double homozygote configs */ tmp=qval; ix=ix1; for(i=0;i<4;i++) peel_famval[*(ix++)]*=z*(*tmp++); if(link<0) { /* unlinked */ /* Then do pat_hom / mat_het configs */ z*=.5; z1=z*(qval[0]+qval[1]); peel_famval[1]*=z1; peel_famval[2]*=z1; z1=z*(qval[2]+qval[3]); peel_famval[13]*=z1; peel_famval[14]*=z1; /* Then do pat_het / mat_hom configs */ z1=z*(qval[0]+qval[2]); peel_famval[4]*=z1; peel_famval[8]*=z1; z1=z*(qval[1]+qval[3]); peel_famval[7]*=z1; peel_famval[11]*=z1; /* Then do double het configs */ ix=ix3; for(i=0;i<4;i++) peel_famval[*(ix++)]*=.25; } else { /* linked */ tp=id_array[kid].tp; /* Then do pat_hom / mat_het configs */ tpp=id_array[kid].tpp[X_MAT]; peel_famval[1]*=z*(tpp[X_MAT]*qval[1]+tpp[X_PAT]*qval[0]); peel_famval[2]*=z*(tpp[X_MAT]*qval[0]+tpp[X_PAT]*qval[1]); peel_famval[13]*=z*(tpp[X_MAT]*qval[3]+tpp[X_PAT]*qval[2]); peel_famval[14]*=z*(tpp[X_MAT]*qval[2]+tpp[X_PAT]*qval[3]); /* Then do pat_het / mat_hom configs */ tpp=id_array[kid].tpp[X_PAT]; peel_famval[4]*=z*(tpp[X_MAT]*qval[2]+tpp[X_PAT]*qval[0]); peel_famval[8]*=z*(tpp[X_MAT]*qval[0]+tpp[X_PAT]*qval[2]); peel_famval[7]*=z*(tpp[X_MAT]*qval[3]+tpp[X_PAT]*qval[1]); peel_famval[11]*=z*(tpp[X_MAT]*qval[1]+tpp[X_PAT]*qval[3]); /* Then do double het configs */ peel_famval[5]*=z*(tp[X_MM_PM]*qval[3]+tp[X_MP_PM]*qval[2]+tp[X_MM_PP]*qval[1]+tp[X_MP_PP]*qval[0]); peel_famval[6]*=z*(tp[X_MM_PM]*qval[2]+tp[X_MP_PM]*qval[3]+tp[X_MM_PP]*qval[0]+tp[X_MP_PP]*qval[1]); peel_famval[9]*=z*(tp[X_MM_PM]*qval[1]+tp[X_MP_PM]*qval[0]+tp[X_MM_PP]*qval[3]+tp[X_MP_PP]*qval[2]); peel_famval[10]*=z*(tp[X_MM_PM]*qval[0]+tp[X_MP_PM]*qval[1]+tp[X_MM_PP]*qval[2]+tp[X_MP_PP]*qval[3]); } } if(pivot== -2) { p1=0.0; tmp=peel_famval; for(n=0;n<16;n++) p1+=*(tmp++); #ifdef DEBUG if(isnan(p1)) ABT_FUNC("Floating point error\n"); #endif if(p1<=0.0) { if(!(s_flag&1)) { return -DBL_MAX; } ABT_FUNC("Zero probability in peeling operation\n"); } prob+=log(p1); k=element->out_index; rf[k].n_ind=4; get_rf_memory(rf+k,16,TRT_MBLOCK); tmp=peel_famval; tmp1=rf[k].p; z=1.0/p1; for(n=0;n<16;n++) *(tmp1++)=*(tmp++)*z; return prob; } p1=0.0; tmp=peel_famval; if(pivot<0) { for(i=0;i<16;i++) p1+=*(tmp++); #ifdef DEBUG if(p1<0.0 || isnan(p1)) ABT_FUNC("Internal error - zero prob\n"); #endif prob+=log(p1); } else { if(ids==pivot) { tmp1=qval; for(i=0;i<4;i++) { z=0.0; for(j=0;j<4;j++) z+=*(tmp++); *(tmp1++)=z; p1+=z; } } else if(idd==pivot) { tmp1=qval; ix=ix2; for(i=0;i<4;i++) { z=0.0; for(j=0;j<4;j++) z+=peel_famval[*(ix++)]; *(tmp1++)=z; p1+=z; } } else { if((k=id_array[pivot].rfp)>=0) { /* Insert Previously computed R_Func */ for(j=0;jout_index; id_array[pivot].rfp=k; rf[k].n_ind=2; get_rf_memory(rf+k,n_idx,TRT_MBLOCK); for(j=0;j #ifdef USE_DMALLOC #include #endif #include #include #include #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "get_par_probs.h" #include "loki_trait_simple_peel.h" #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "loki_trait_simple_sample" /* Similar to loki_simple_sample, but for a trait locus */ double loki_trait_simple_sample(const struct Simple_Element *element,const int locus,const int s_flag,double **freq,struct R_Func *rf,trait_pen_func *trait_pen,struct peel_mem *work) { int ids,idd,is1,id1,i,j,k,m,n,n_off,*off,kid,*ix,link; int i1,i2,j1,j2,k1,k2,l1,l2,jj,n_all,n_idx; int ix1[]={0,3,12,15}; int ix3[]={5,6,9,10}; int par_type[]={0,1,1,0,2,3,3,2,2,3,3,2,0,1,1,0}; double *tp,p1,p2,z,z1,prob=0.0,pp[4],*tmp,*tmp1,*tpp,*qval,*pval,*mval,*peel_famval; ids=element->sire-1; idd=element->dam-1; off=element->off; n_off=element->n_off; n_all=tlocus[-1-locus].locus.n_alleles; n_idx=n_all*n_all; peel_famval=work->s2; qval=peel_famval+16; pval=qval+n_idx; mval=pval+n_idx; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%d)\n",FUNC_NAME,(void *)element,locus,s_flag); if(CHK_PEEL(TRACE_LEVEL_2)) { if(family_id) { print_orig_family(stdout,off[0]+1,0); (void)fputc(' ',stdout); } print_orig_id1(stdout,ids+1); (void)fputc(',',stdout); print_orig_id1(stdout,idd+1); (void)fputc(' ',stdout); for(i=0;i=0 || id1>=0) { tmp=peel_famval; for(j=0;j<16;j++) *(tmp++)=0.0; if(is1>=0) { if(id1>=0) { peel_famval[(is1<<2)|id1]=mval[id1]*pval[is1]; } else { tmp=peel_famval+(is1<<2); tmp1=mval; for(m=0;m<4;m++) *(tmp++)=*(tmp1++); } } else { tmp1=pval; for(m=id1;m<16;m+=4) peel_famval[m]=*(tmp1++); } } else { tmp=peel_famval; for(n=0;n<4;n++) { p1=pval[n]; tmp1=mval; for(m=0;m<4;m++) *(tmp++)=*(tmp1++)*p1; } } for(m=0;m=0) { /* Insert Previously computed R_Func */ tmp1=rf[k].p; for(j=0;j0.0) { p2+=p1; if(p2>=z) { id_array[idd].allele[X_MAT]=(i&1)?2:1; id_array[idd].allele[X_PAT]=(i&2)?2:1; id_array[ids].allele[X_MAT]=(i&4)?2:1; id_array[ids].allele[X_PAT]=(i&8)?2:1; id_array[ids].flag|=(SAMPLED_MAT|SAMPLED_PAT); id_array[idd].flag|=(SAMPLED_MAT|SAMPLED_PAT); break; } } } } while(i==16); jj=par_type[i]; if(!jj) { /* Double Homozygotic parents */ i2=id_array[ids].allele[X_MAT]; k2=id_array[idd].allele[X_MAT]; for(m=0;m=0) { /* Insert Previously computed R_Func */ tmp1=rf[k].p; for(j=0;j<4;j++) *(tmp++)=*(tmp1++); } else for(j=0;j<4;j++) *(tmp++)=1.0; if(id_array[kid].res[0]) trait_pen(qval,kid,locus); if(jj==1) { tpp=id_array[kid].tpp[X_MAT]; pp[X_MAT]=tpp[X_MAT]*qval[i1]; pp[X_PAT]=tpp[X_PAT]*qval[k1]; p1=pp[X_MAT]+pp[X_PAT]; #ifdef DEBUG if(p1<=0.0) ABT_FUNC("Internal error - no offspring combination possible\n"); #endif z=ranf()*p1; id_array[kid].allele[X_MAT]=(z<=pp[X_MAT])?k2:l2; id_array[kid].allele[X_PAT]=i2; } else if(jj==2) { tpp=id_array[kid].tpp[X_PAT]; pp[X_MAT]=tpp[X_MAT]*qval[i1]; pp[X_PAT]=tpp[X_PAT]*qval[j1]; p1=pp[X_MAT]+pp[X_PAT]; #ifdef DEBUG if(p1<=0.0) ABT_FUNC("Internal error - no offspring combination possible\n"); #endif z=ranf()*p1; id_array[kid].allele[X_PAT]=(z<=pp[X_MAT])?i2:j2; id_array[kid].allele[X_MAT]=k2; } else { /* transmission probs */ tp=id_array[kid].tp; p1=(pp[X_MM_PM]=tp[X_MM_PM]*qval[i1]); p1+=(pp[X_MM_PP]=tp[X_MM_PP]*qval[j1]); p1+=(pp[X_MP_PM]=tp[X_MP_PM]*qval[k1]); p1+=(pp[X_MP_PP]=tp[X_MP_PP]*qval[l1]); #ifdef DEBUG if(p1<=0.0) ABT_FUNC("Internal error - no offspring combination possible\n"); #endif z=safe_ranf()*p1; p2=0.0; for(n=0;n<4;n++) { if(pp[n]>0.0) { p2+=pp[n]; if(z<=p2) break; } } switch(n) { case X_MM_PM: id_array[kid].allele[X_MAT]=k2; id_array[kid].allele[X_PAT]=i2; break; case X_MM_PP: id_array[kid].allele[X_MAT]=k2; id_array[kid].allele[X_PAT]=j2; break; case X_MP_PM: id_array[kid].allele[X_MAT]=l2; id_array[kid].allele[X_PAT]=i2; break; case X_MP_PP: id_array[kid].allele[X_MAT]=l2; id_array[kid].allele[X_PAT]=j2; break; #ifdef DEBUG default: ABT_FUNC("Internal error - illegal sample\n"); #endif } } id_array[kid].flag|=(SAMPLED_MAT|SAMPLED_PAT); } } return prob; } loki/lokisrc/loki_utils.c0100644000076500007650000001412210016647646014775 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * August 1997 * * * * loki_utils.c: * * * * Utility routines for loki * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #include #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" static int sort_sex; size_t print_orig_family(FILE *fptr,const int id,const int fg) { int fam; size_t sz; fam=id>0?id_array[id-1].fam_code:0; if(!fam) sz=1; else if(fam_recode.flag==ST_STRING) sz=strlen(fam_recode.recode[fam-1].string); else sz=(size_t)(1.000001+log((double)fam_recode.recode[fam-1].value)/log(10.0)); if(fg) sz+=3; if(fptr) { if(fg) { if(!fam) (void)fputs("[*]:",fptr); else if(fam_recode.flag==ST_STRING) (void)fprintf(fptr,"[%s]:",fam_recode.recode[fam-1].string); else (void)fprintf(fptr,"[%d]:",fam_recode.recode[fam-1].value); } else { if(!fam) (void)fputs("*",fptr); else if(fam_recode.flag==ST_STRING) (void)fprintf(fptr,"%s",fam_recode.recode[fam-1].string); else (void)fprintf(fptr,"%d",fam_recode.recode[fam-1].value); } } return sz; } void print_marker_name(FILE *fptr,const int i) { if(marker[i].index) fprintf(fptr,"%s(%d)",marker[i].name,marker[i].index); else fputs(marker[i].name,fptr); } int has_orig_id(int i) { int j=0; if(i) { if(id_recode.flag==ST_STRING) { if(id_recode.recode[i-1].string) j=1; } else if(id_recode.recode[i-1].value!=INT_MAX) j=1; } return j; } size_t print_orig_id1(FILE *fptr,const int i) { size_t sz; int j; double z; char *s; if(!i) sz=1; else if(id_recode.flag==ST_STRING) { s=id_recode.recode[i-1].string; sz=s?strlen(s):1; } else { j=id_recode.recode[i-1].value; if(j==INT_MAX) sz=1; else { z=(double)abs(j); sz=(size_t)(1.000001+log(z)/log(10.0)); if(j<0) sz++; } } if(fptr) { if(!i) (void)fputc('*',fptr); else { if(id_recode.flag==ST_STRING) { s=id_recode.recode[i-1].string; (void)fprintf(fptr,"%s",s?s:"*"); } else { j=id_recode.recode[i-1].value; if(j==INT_MAX) (void)fputc('*',fptr); else (void)fprintf(fptr,"%d",j); } } } return sz; } size_t print_orig_id(FILE *fptr,const int i) { size_t sz=0; if(family_id) sz=print_orig_family(fptr,i,1); sz+=print_orig_id1(fptr,i); return sz; } size_t get_max_idlen(void) { int i; size_t sz; static size_t max; if(!max) { for(i=0;imax) max=sz; } } return max; } void print_orig_triple(FILE *fptr,const int i) { if(family_id) { (void)print_orig_family(fptr,i,0); (void)fputc(' ',fptr); } if(i) { (void)print_orig_id1(fptr,i); (void)fputc(' ',fptr); (void)print_orig_id1(fptr,id_array[i-1].sire); (void)fputc(' ',fptr); (void)print_orig_id1(fptr,id_array[i-1].dam); } else (void)fputs("* * *",fptr); } void print_orig_allele_id(FILE *fptr,const int i) { if(i>0) { (void)print_orig_id(fptr,i); (void)fputc('m',fptr); } else { (void)print_orig_id(fptr,-i); (void)fputc('p',fptr); } } void print_allele_type1(FILE *fptr,const int locus,const int j) { if(j==marker[locus].lumped) (void)fputs(LUMPED_ALLELE,fptr); else if(marker[locus].rec_flag==ST_STRING) (void)fputs(marker[locus].recode[j].string,fptr); else (void)fprintf(fptr,"%d",marker[locus].recode[j].value); } /* Print the original allele code for (recoded) allele i */ void print_allele_type(FILE *fptr,const int locus,const int comp,const int i) { print_allele_type1(fptr,locus,allele_trans[locus][comp][i]); } /* Print original code for maternal or paternal allele (depending on flag) for * individual id. Takes account of set recoding */ void print_allele_name(FILE *fptr,const int id,const int locus,const int flag) { lk_ulong c; int i,j,allele,comp; comp=id_array[id].comp; allele=id_array[id].allele[flag]-1; c=LK_ONE<>=1; } (void)fputc(']',fptr); } else print_allele_type(fptr,locus,comp,allele); } void set_sort_sex(const int s) { sort_sex=s; } /* Comparison function for qsort(), used to sort loci into position * order within a linkage group */ int cmp_loci_pos(const void *s1,const void *s2) { double x1,x2; int i; i=*((const int *)s1); if(i>=0) x1=marker[i].locus.pos[sort_sex]; else x1=tlocus[-1-i].locus.pos[sort_sex]; i=*((const int *)s2); if(i>=0) x2=marker[i].locus.pos[sort_sex]; else x2=tlocus[-1-i].locus.pos[sort_sex]; if(x1x2) return 1; return 0; } /* Get list of loci (marker + trait) in linkage group. Returns number found * in count */ void get_locuslist(int *perm,const int link,int *count,int flag) { int i,j; for(i=0;i #include "mat_utils.h" /* * Compute Cholesky factorization of symmetric matrix. * Inputs: a - Lower triangle of matrix * n - Size of matrix * * Outputs: b - Cholesky factor of a * det - log determinant of a * * Returns 1 if a is not positive definite, otherwise returns 0 * * Note that b can point to the same location as a, otherwise a is unmodified */ int chol_fact(double *a, double *b, int n, double *ldet) { int i, j, k, kk; double zz, piv; kk=n*(n+1)/2; *ldet=0.0; for(i=n-1;i>=0;i--) { zz=a[--kk]; for(k=i+1;k=0;j--) { zz=a[--kk]; for(k=i+1;k=0;i--) { zz=y[i]; for(j=i+1;j=0;i--) { zz=BB(a,i,i); b[--kk]=1.0/zz; for(j=i-1;j>=0;j--) { zz=0.0; for(k=i;k>j;k--) zz-=BB(a,k,j)*BB(b,i,k); b[--kk]=zz/BB(a,j,j); } } kk=n*(n+1)/2; for(i=n-1;i>=0;i--) { for(j=i;j>=0;j--) { zz=0.0; for(k=j;k>=0;k--) zz+=BB(b,i,k)*BB(b,j,k); b[--kk]=zz; } } } loki/lokisrc/mat_utils.h0100644000076500007650000000040210001741572014604 0ustar heathheath#define BB(b,i,j) ((b)[i*(i+1)/2+j]) #define BB1(b,i,j) ((i #include #ifdef USE_DMALLOC #include #endif #include #include #include "ranlib.h" #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "seg_pen.h" #include "gen_pen.h" #include "meiosis_scan.h" static int *nnfd_st,*par_st,*gpfam_st,*fam_st,mem_list_size,mem_list_ptr; static int *nnfd_list,*par_list,*fam_list,*gpfam_list,*temp_list; static struct nuc_family *families; static void **mem_list; double mscan_prob[]={MSCAN_INDIVIDUAL, MSCAN_HS_FAMILY, MSCAN_GP_FAMILY, MSCAN_FS_FAMILY}; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "malloc_and_remember" static void *malloc_and_remember(size_t size) { void *p; if(mem_list_ptr==mem_list_size) { if(mem_list_size) { mem_list_size*=1.5; if(!(mem_list=realloc(mem_list,sizeof(void *)*mem_list_size))) ABT_FUNC(MMsg); } else { mem_list_size=16; if(!(mem_list=malloc(sizeof(void *)*mem_list_size))) ABT_FUNC(MMsg); } } p=malloc(size); if(p) mem_list[mem_list_ptr++]=p; return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_families" static void init_families(void) { int j,i1,cs,comp,nnfd,npar,nfam,ngpfam; int k,k1,k2,nk,kid,ids,idd,*kid_list; if(!(nnfd_st=malloc_and_remember(sizeof(int)*(n_comp+1)*4))) ABT_FUNC(MMsg); par_st=nnfd_st+n_comp+1; fam_st=par_st+n_comp+1; gpfam_st=fam_st+n_comp+1; if(!(nnfd_list=malloc_and_remember(sizeof(int)*3*ped_size))) ABT_FUNC(MMsg); par_list=nnfd_list+ped_size; temp_list=par_list+ped_size; for(j=0;jj) j=k; } j+=max_tloci; if(!(pp[0]=malloc_and_remember(sizeof(double)*(14*j-1)))) ABT_FUNC(MMsg); pen[0]=pp[0]+4*j; lks[0]=pen[0]+4*j; recom[0]=lks[0]+4*j; recom[1]=recom[0]+j; for(i=1;i<4;i++) { pp[i]=pp[i-1]+j; pen[i]=pen[i-1]+j; lks[i]=lks[i-1]+j; } if(!(seg_list=malloc_and_remember(sizeof(void *)*j*2))) ABT_FUNC(MMsg); lk_store=(void *)(seg_list+j); if(!(loci=malloc_and_remember(sizeof(int)*j*2))) ABT_FUNC(MMsg); loc_fg=loci+j; if(!(loci1=malloc_and_remember(sizeof(void *)*j))) ABT_FUNC(MMsg); init_families(); /* Normalize mscan type probabilities */ for(z1=0.0,update_type=0;update_type<4;update_type++) z1+=mscan_prob[update_type]; if(z1<=0.0) ABT_FUNC("Invalid probabilities set for mscan_prob[]\n"); z1=1.0/z1; for(update_type=0;update_type<4;update_type++) mscan_prob[update_type]*=z1; atexit(free_meiosis_scan); } z=safe_ranf(); for(z1=0.0,update_type=0;update_type<4;update_type++) { z1+=mscan_prob[update_type]; if(z<=z1) break; } switch(update_type) { case 0: memcpy(temp_list,nnfd_list,sizeof(int)*nnfd_st[n_comp]); break; case 1: memcpy(temp_list,par_list,sizeof(int)*par_st[n_comp]); break; case 2: memcpy(temp_list,gpfam_list,sizeof(int)*gpfam_st[n_comp]); break; case 3: memcpy(temp_list,fam_list,sizeof(int)*fam_st[n_comp]); break; } n_comp1=singleton_flag?n_comp-1:n_comp; for(comp=0;comp=2 */ n_qtl=k1=0; for(k2=0;k2=2) loci[k1++]=locus; } if(!k1) continue; n_loci=k1; /* If we have >1 linked QTL, then pick one to update conditional on trait data alone, * the others will be updated conditional on sampled genotypes for observed individuals */ if(n_qtl>1) { k1=(int)(safe_ranf()*(double)n_qtl); for(i1=k2=0;k2=0?&marker[locus].locus:&tlocus[-1-locus].locus; } for(s=0;s<2;s++) { x=loci1[0]->pos[s]; for(k=1;kpos[s]; recom[s][k-1]=.5*(1.0-exp(0.02*(x-x1))); x=x1; } } for(k=0;kseg; lk_store[k]=loci1[k]->lk_store; } if(!update_type) { /* Update both segs of each non-founder individual */ cs=nnfd_st[comp+1]; i1=nnfd_st[comp]; zz=(double)(cs-i1); for(;i1=0)?locus:n_markers; if(id_array[i].pruned_flag[locus1]) { /* Individual pruned for this locus - * seg has no effect on penetrance */ for(k1=0;k1<4;k1++) pen[k1][k]=0.25; continue; } seg=seg_list[k]; if(locus>=0) { mf=marker[locus].m_flag[i]&6; /* marker[locus].m_flag[i] is a flag where the following bits mean: * 0 i is homozygous at locus * 1 maternal seg is forced by the data * 2 paternal seg is forced by the data * * Note: this is all based on the original marker data */ if(marker[locus].m_flag[idd-1]&1) mf|=8; if(marker[locus].m_flag[ids-1]&1) mf|=16; } else mf=0; if(!id_array[idd-1].sire && id_array[idd-1].nkids==1) mf|=8; if(!id_array[ids-1].sire && id_array[ids-1].nkids==1) mf|=16; s1=s1a=seg[X_MAT][i]; s2=s2a=seg[X_PAT][i]; #ifdef DEBUG if(s1<0 || s2<0) ABT_FUNC("Illegal seg.\n"); #endif s=(s1<<1)|s2; scl=0; xx2=xx1=lk_store[k][comp]; if(!mf) { /* Default case - both segs must be checked */ /* Current state */ lks[s][k]=xx1; ffg[s]=0; ss=s; for(k2=k1=0;k1<3;k1++) { /* Flip maternal bit once */ if(k1&1) { seg[X_MAT][i]=(s1a^=1); ss^=2; if(pass_founder_genes1(locus,i,X_MAT)) { xx=xx1=seg_pen1(locus,qtl,comp,ffg+ss,0,si); } else { xx=xx1; ffg[ss]=ffg[ss^2]; } } else { /* Flip paternal bit twice */ seg[X_PAT][i]=(s2a^=1); ss^=1; if(pass_founder_genes1(locus,i,X_PAT)) { xx=xx1=seg_pen1(locus,qtl,comp,ffg+ss,0,si); } else { xx=xx1; ffg[ss]=ffg[ss^1]; } } lks[ss][k]=xx; /* Get maximum value(for scaling purposes) */ if(!ffg[ss] && xx>xx2) xx2=xx; } scl=1; } else if(mf==6) { /* Both segs fixed */ for(k1=0;k1<4;k1++) pen[k1][k]=0.0; pen[s][k]=1.0; lks[s][k]=xx1; } else if(mf==24) { /* Both segs indetermined by data * (because parents are homozygous) */ for(k1=0;k1<4;k1++) pen[k1][k]=0.25; for(k1=0;k1<4;k1++) lks[k1][k]=xx1; } else if(mf==18) { /* Mat seg fixed, pat seg indetermined */ s=s1<<1; for(k1=0;k1<2;k1++) { pen[s|k1][k]=0.5; lks[s|k1][k]=xx1; } s=(s1^1)<<1; for(k1=0;k1<2;k1++) pen[s|k1][k]=0.0; } else if(mf==12) { /* Pat seg fixed, mat seg indetermined */ for(k1=0;k1<4;k1+=2) { pen[s2|k1][k]=0.5; lks[s2|k1][k]=xx1; pen[(s2^1)|k1][k]=0.0; } } else if(mf&10) { /* Don't need to vary mat seg */ /* Current state */ xx2=xx1=lk_store[k][comp]; lks[s][k]=xx1; ffg[s]=0; seg[X_PAT][i]=(s2a^=1); ss=(s1<<1)|s2a; if(pass_founder_genes1(locus,i,X_PAT)) xx=xx1=seg_pen1(locus,qtl,comp,ffg+ss,0,si); else xx=xx1; lks[ss][k]=xx; if(!ffg[ss] && xx>xx2) xx2=xx; k1=(s1^1)<<1; if(mf&2) { for(k2=0;k2<2;k2++) ffg[k1|k2]=1.0; } else { for(k2=0;k2<2;k2++) { lks[k1|k2][k]=lks[(s1<<1)|k2][k]; ffg[k1|k2]=ffg[(s1<<1)|k2]; } } scl=1; } else if(mf&20) { /* Don't need to vary pat seg */ /* Current state */ xx2=xx1=lk_store[k][comp]; lks[s][k]=xx1; ffg[s]=0; seg[X_MAT][i]=(s1a^=1); ss=(s1a<<1)|s2; if(pass_founder_genes1(locus,i,X_MAT)) xx=xx1=seg_pen1(locus,qtl,comp,ffg+ss,0,si); else xx=xx1; lks[ss][k]=xx; if(!ffg[ss] && xx>xx2) xx2=xx; k2=s2^1; if(mf&4) { for(k1=0;k1<4;k1+=2) ffg[k1|k2]=-1; } else { for(k1=0;k1<4;k1+=2) { lks[k1|k2][k]=lks[k1|s2a][k]; ffg[k1|k2]=ffg[k1|s2a]; } } scl=1; } else ABT_FUNC("Internal error - illegal flag\n"); if(scl) { /* Convert from log to normal scale */ for(z=0.0,k1=0;k1<4;k1++) { if(!ffg[k1]) pen[k1][k]=exp(lks[k1][k]-xx2); else pen[k1][k]=0.0; z+=pen[k1][k]; } #ifdef DEBUG if(z<=0.0) { ABT_FUNC("Internal error - zero prob.\n"); } #endif z=1.0/z; for(k1=0;k1<4;k1++) pen[k1][k]*=z; } } /* Forward phase */ for(k1=0;k1<4;k1++) pp[k1][0]=pen[k1][0]; for(k=1;k0.0) { z1=0.0; for(k2=0;k2<4;k2++) { if((z=pp[k2][k-1])>0.0) { z*=((k1&1)!=(k2&1))?rr[1]:1.0-rr[1]; z*=((k1&2)!=(k2&2))?rr[0]:1.0-rr[0]; z1+=z; } } z2*=z1; } xx+=(pp[k1][k]=z2); } xx=1.0/xx; for(k1=0;k1<4;k1++) pp[k1][k]*=xx; } /* Backwards phase */ k=n_loci-1; locus=loci[k]; locus1=locus>=0?locus:n_markers; seg=seg_list[k]; if(!(id_array[i].pruned_flag[locus1])) { s1=seg[X_MAT][i]; s2=seg[X_PAT][i]; s=(s1<<1)|s2; z=safe_ranf(); for(z1=0.0,k1=0;k1<4;k1++) if(pp[k1][k]>0.0) { z1+=pp[k1][k]; if(z<=z1) break; } if(k1!=s) { s1a=seg[X_MAT][i]=(k1&2)>>1; s2a=seg[X_PAT][i]=k1&1; if(s1a!=s1) (void)pass_founder_genes1(locus,i,X_MAT); if(s2a!=s2) (void)pass_founder_genes1(locus,i,X_PAT); } lk_store[k][comp]=lks[k1][k]; } else { s1a=seg[X_MAT][i]=ranf()<.5?0:1; s2a=seg[X_PAT][i]=ranf()<.5?0:1; } for(k=n_loci-2;k>=0;k--) { rr[0]=recom[0][k]; rr[1]=recom[1][k]; for(xx=0.0,k1=0;k1<4;k1++) { if((z2=pp[k1][k])) { z2*=((k1&1)!=s2a)?rr[1]:1.0-rr[1]; z2*=(((k1&2)>>1)!=s1a)?rr[0]:1.0-rr[0]; } xx+=(pp[k1][k]=z2); } z=safe_ranf()*xx; for(z1=0.0,k1=0;k1<4;k1++) if(pp[k1][k]>0.0) { z1+=pp[k1][k]; if(z<=z1) break; } s1a=(k1&2)>>1; s2a=k1&1; locus=loci[k]; locus1=locus>=0?locus:n_markers; seg=seg_list[k]; if(!(id_array[i].pruned_flag[locus1])) { s1=seg[X_MAT][i]; s2=seg[X_PAT][i]; s=(s1<<1)|s2; if(k1!=s) { seg[X_MAT][i]=s1a; seg[X_PAT][i]=s2a; if(s1a!=s1) (void)pass_founder_genes1(locus,i,X_MAT); if(s2a!=s2) (void)pass_founder_genes1(locus,i,X_PAT); } lk_store[k][comp]=lks[k1][k]; } else { seg[X_MAT][i]=s1a; seg[X_PAT][i]=s2a; } } } } else if(update_type==1) { ctr++; /* Try to flip all maternal or all paternal segs in a half sib family */ i1=par_st[comp]; cs=par_st[comp+1]; zz=(double)(cs-i1); for(;i1=0 && marker[locus].m_flag[i]&1)) { pen[0][k]=pen[1][k]=0.5; lks[1][k]=lks[0][k]; } else { if(locus>=0) { k2=sex==1?4:2; for(k1=0;k1z1) { z1=exp(z1-z); z=1.0; } else { z=exp(z-z1); z1=1.0; } z2=z+z1; pen[0][k]=z/z2; pen[1][k]=z1/z2; } else { pen[0][k]=1.0; pen[1][k]=0.0; } } else { lks[1][k]=lks[0][k]; pen[0][k]=pen[1][k]=0.5; } } } } /* Forward phase */ k2=2-sex; for(k1=0;k1<2;k1++) pp[k1][0]=pen[k1][0]; seg=seg_list[0]; for(k=1;k0.0) { rr[1]=recom[k2][k-1]; rr[0]=1.0-rr[1]; z1=z2=1.0; for(k1=0;k1=0;k--) { seg1=seg; seg=seg_list[k]; if(pp[1][k]>0.0) { rr[1]=recom[k2][k]; rr[0]=1.0-rr[1]; z1=z2=1.0; for(k1=0;k1=0) { if(!marker[locus].haplo[ids] && !marker[locus].haplo[idd]) { if(marker[locus].mterm && marker[locus].mterm[0]) { if(!(id_array[ids].res[0] || id_array[idd].res[0])) k1=1; } else k1=1; } } else { if(!(id_array[ids].res[0] || id_array[idd].res[0])) k1=1; } } if(k1) { pen[0][k]=pen[1][k]=0.5; lks[1][k]=lks[0][k]; continue; } if(locus>=0) { /* Check if we can switch at this locus */ for(k1=0;k1z1) { z1=exp(z1-z); z=1.0; } else { z=exp(z-z1); z1=1.0; } z2=z+z1; pen[0][k]=z/z2; pen[1][k]=z1/z2; } else { pen[0][k]=1.0; pen[1][k]=0.0; } } else { lks[1][k]=lks[0][k]; pen[0][k]=pen[1][k]=0.5; } } } /* Forward phase */ for(k1=0;k1<2;k1++) pp[k1][0]=pen[k1][0]; seg=seg_list[0]; for(k=1;k0.0) { rr[0]=recom[0][k-1]; rr[1]=recom[1][k-1]; z1=z2=1.0; for(k1=0;k1=0;k--) { locus=loci[k]; seg1=seg; seg=seg_list[k]; if(pp[1][k]>0.0) { rr[0]=recom[0][k]; rr[1]=recom[1][k]; z1=z2=1.0; for(k1=0;k1=0) { /* Check if we can switch at this locus */ /* If any kid has a seg fixed, then we can't switch that seg */ for(mf=0,k1=0;k1xx2) xx2=xx; } else { /* Nothing changed */ lks[state][k]=xx; ffg[state]=lffg; } } else if(mf&2) { /* Maternal seg can not be switched */ lks[state][k]=lks[state^1][k]=16; ffg[state]=ffg[state^1]=-1; kk=2; } else if(mf&8) { /* Maternal seg has equal likelihood if switched */ lks[state][k]=lks[state^2][k]; ffg[state]=ffg[state^2]; } } else { /* Flip paternal segs */ state^=1; if(!(mf&20)) { for(k3=0;k3xx2) xx2=xx; } else { lks[state][k]=xx; ffg[state]=lffg; } } else if(mf&4) { /* Paternal seg can not be switched */ lks[state][k]=lks[state^2][k]=17; ffg[state]=ffg[state^2]=-1; state^=1; kk=2; } else if(mf&16) { /* Paternal seg has equal likelihood if switched */ lks[state][k]=lks[state^1][k]; ffg[state]=ffg[state^1]; } } } /* Convert from log to normal scale */ for(z=0.0,k1=0;k1<4;k1++) { if(!ffg[k1]) pen[k1][k]=exp(lks[k1][k]-xx2); else pen[k1][k]=0.0; z+=pen[k1][k]; } #ifdef DEBUG if(z<=0.0) { ABT_FUNC("Internal error - zero prob.\n"); } #endif z=1.0/z; for(k1=0;k1<4;k1++) pen[k1][k]*=z; } /* Forward phase */ for(k1=0;k1<4;k1++) pp[k1][0]=pen[k1][0]; seg=seg_list[0]; for(k=1;k0.0) { for(k2=0;k2<4;k2++) { zz1[k2]=pp[k2][k-1]; if(zz1[k2]>0.0) { for(z=1.0,k3=0;k30.0) { z1+=pp[k1][k]; if(z<=z1) break; } if(k1!=loc_fg[k]) { mf=loc_fg[k]^k1; if(mf) { for(k3=0;k3=0;k--) { seg1=seg; locus=loci[k]; seg=seg_list[k]; rr[0]=recom[0][k]; rr[1]=recom[1][k]; for(xx=0.0,k1=0;k1<4;k1++) { if((z2=pp[k1][k])) { mf=loc_fg[k]^k1; for(k3=0;k30.0) { z1+=pp[k1][k]; if(z<=z1) break; } if(k1!=loc_fg[k]) { mf=loc_fg[k]^k1; if(mf) { for(k3=0;k31.0e-8) { (void)fprintf(stderr,"Seg. prob mismatch %g %g (comp=%d, locus=%d, type=%d, n_qtl=%d)\n",z,tlocus[k].locus.lk_store[comp],comp,k,update_type,n_qtl); ABT_FUNC("Aborting\n"); } #endif for(k2=0;k2=0?seg_pen(loc,a,b,c,d):(loc==loc1?gen_pen(-1-loc,a,b,c,d):seg_pen(loc,a,b,c,d))) loki/lokisrc/output_recomb.c0100644000076500007650000000553410001741567015504 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * January 2002 * * * * output_recomb.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "output_recomb.h" int output_recomb; char *Recombfile; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "print_recomb" /* Print recombinations forced by the data */ void print_recomb(void) { int id,i,j,link,k,k1,s; int *perm,sg[2],flag[2]; size_t max,sz; FILE *fptr; if(!n_markers) return; if(!Recombfile) ABT_FUNC("Internal error - null file name\n"); if(!(fptr=fopen(Recombfile,"w"))) { fputs("Couldn't open file ",stderr); perror(Recombfile); return; } if(!(perm=malloc(sizeof(int)*n_markers))) ABT_FUNC(MMsg); max=get_max_idlen(); for(link=0;link=0) { if(s!=sg[k1]) { flag[k1]=1; } } else sg[k1]=s; } } } for(k1=0;k1<2;k1++) if(flag[k1]) { sz=print_orig_id(fptr,id+1); for(;sz #else #define __unused #endif #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) __unused; static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 15 #define YY_END_OF_BUFFER 16 static yyconst short int yy_accept[74] = { 0, 0, 0, 0, 0, 0, 0, 16, 14, 2, 1, 14, 14, 14, 14, 14, 14, 13, 11, 5, 6, 5, 14, 2, 3, 14, 14, 14, 14, 14, 14, 13, 11, 0, 1, 3, 0, 1, 9, 0, 1, 0, 1, 10, 0, 13, 12, 4, 0, 13, 0, 11, 7, 0, 9, 0, 8, 0, 10, 0, 13, 12, 4, 0, 13, 0, 11, 12, 0, 12, 12, 0, 12, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 1, 1, 1, 6, 1, 1, 7, 8, 1, 8, 9, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 1, 1, 1, 14, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[15] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3 } ; static yyconst short int yy_base[84] = { 0, 0, 0, 12, 13, 20, 0, 133, 129, 128, 0, 14, 127, 32, 36, 33, 34, 39, 44, 134, 134, 119, 134, 134, 0, 39, 125, 43, 50, 116, 119, 53, 0, 122, 134, 0, 64, 134, 121, 120, 134, 48, 134, 100, 60, 0, 61, 91, 62, 0, 71, 0, 134, 72, 134, 90, 134, 74, 134, 81, 72, 73, 134, 80, 0, 77, 0, 84, 82, 81, 67, 58, 49, 134, 95, 98, 101, 104, 107, 110, 113, 116, 119, 37 } ; static yyconst short int yy_def[84] = { 0, 73, 1, 74, 74, 73, 5, 73, 75, 75, 76, 77, 78, 79, 75, 75, 75, 14, 14, 73, 73, 73, 73, 73, 76, 80, 81, 82, 73, 73, 73, 73, 83, 75, 73, 76, 77, 73, 75, 78, 73, 79, 73, 75, 75, 14, 17, 75, 75, 17, 75, 18, 73, 80, 73, 81, 73, 82, 73, 73, 73, 73, 73, 73, 31, 73, 83, 75, 50, 50, 73, 73, 73, 0, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73 } ; static yyconst short int yy_nxt[149] = { 0, 8, 9, 10, 11, 12, 13, 8, 14, 15, 16, 17, 18, 18, 8, 20, 20, 37, 38, 21, 21, 22, 23, 24, 25, 26, 27, 22, 28, 29, 30, 31, 32, 32, 22, 42, 34, 34, 43, 34, 66, 47, 54, 54, 46, 44, 58, 45, 48, 58, 49, 42, 50, 33, 43, 51, 51, 51, 51, 59, 72, 60, 63, 34, 64, 34, 65, 37, 38, 72, 33, 67, 46, 46, 34, 54, 54, 58, 70, 68, 58, 59, 69, 60, 61, 71, 65, 34, 72, 33, 33, 61, 70, 56, 34, 67, 19, 19, 19, 33, 33, 33, 35, 34, 35, 36, 36, 36, 39, 39, 39, 41, 41, 41, 53, 53, 53, 55, 55, 55, 57, 57, 57, 40, 34, 34, 62, 61, 56, 52, 40, 34, 34, 73, 7, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73 } ; static yyconst short int yy_chk[149] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 11, 11, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 13, 15, 16, 13, 14, 83, 16, 25, 25, 15, 14, 27, 14, 17, 27, 17, 41, 17, 18, 41, 18, 18, 18, 18, 28, 72, 28, 31, 44, 31, 48, 31, 36, 36, 71, 46, 44, 46, 48, 50, 53, 53, 57, 70, 50, 57, 60, 50, 60, 61, 65, 61, 67, 65, 69, 68, 63, 59, 55, 47, 67, 74, 74, 74, 75, 75, 75, 76, 43, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 39, 38, 33, 30, 29, 26, 21, 12, 9, 8, 7, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "param_lex.l" #define INITIAL 0 #line 2 "param_lex.l" /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * param_lex.l: * * * * flex (NOT lex!) source for parameter file lexer. * * * ****************************************************************************/ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include "param_parse.h" #include "loki_scan.h" #include "utils.h" #ifndef YY_STACK_USED #define YY_STACK_USED 0 #endif #ifndef YY_ALWAYS_INTERACTIVE #define YY_ALWAYS_INTERACTIVE 0 #endif #ifndef YY_NEVER_INTERACTIVE #define YY_NEVER_INTERACTIVE 0 #endif #ifndef YY_MAIN #define YY_MAIN 0 #endif extern void yyerror(char *s),print_scan_err(char *fmt, ...); extern int scan_error_n; static int token,i; int tokenpos,lineno=1,lineno1=1; char linebuf[512],linebuf1[512]; static int symbol_lookup(const char *p); static char *get_string(const char *p); static YY_BUFFER_STATE bufstate_list[MAX_INCLUDE]; char *fname_list[MAX_INCLUDE+1]; int list_ptr; static int ln_list[MAX_INCLUDE],ln1_list[MAX_INCLUDE]; #define COMMENT 1 #define ISTATE 2 /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 61 "param_lex.l" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 74 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 134 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 63 "param_lex.l" { (void)strncpy(linebuf,yytext,512); (void)strcpy(linebuf1,linebuf); yyless((int)0); BEGIN ISTATE; } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(ISTATE): #line 70 "param_lex.l" { if(iflag) { iflag=0; } else { if(--list_ptr<0) yyterminate(); else { free(fname_list[list_ptr+1]); yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(bufstate_list[list_ptr]); lineno=ln_list[list_ptr]; lineno1=ln1_list[list_ptr]; linebuf[0]=linebuf1[0]=0; } } } YY_BREAK case 2: YY_RULE_SETUP #line 86 "param_lex.l" {tokenpos+=yyleng;} YY_BREAK case 3: YY_RULE_SETUP #line 88 "param_lex.l" { lineno++; tokenpos=0; (void)strncpy(linebuf,yytext+1,512); yyless((int)1); } YY_BREAK case 4: YY_RULE_SETUP #line 95 "param_lex.l" BEGIN(COMMENT); YY_BREAK case 5: YY_RULE_SETUP #line 96 "param_lex.l" {tokenpos+=yyleng;} YY_BREAK case 6: YY_RULE_SETUP #line 97 "param_lex.l" {lineno++; tokenpos=0;} YY_BREAK case 7: YY_RULE_SETUP #line 98 "param_lex.l" {BEGIN(ISTATE); tokenpos+=yyleng;} YY_BREAK case 8: *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 100 "param_lex.l" ; YY_BREAK case 9: YY_RULE_SETUP #line 102 "param_lex.l" { tokenpos+=yyleng; yylval.string=get_string(yytext+1); i=strlen(yylval.string); if(i) yylval.string[i-1]='\0'; return STRING; } YY_BREAK case 10: YY_RULE_SETUP #line 108 "param_lex.l" { tokenpos+=yyleng; yylval.string=get_string(yytext+1); i=strlen(yylval.string); if(i) yylval.string[i-1]='\0'; return STRING; } YY_BREAK case 11: YY_RULE_SETUP #line 114 "param_lex.l" { token=symbol_lookup(yytext); tokenpos+=yyleng; if(token==STRING) yylval.string=get_string(yytext); return token; } YY_BREAK case 12: YY_RULE_SETUP #line 119 "param_lex.l" { tokenpos+=yyleng; yylval.rvalue=atof(yytext); return REAL; } YY_BREAK case 13: YY_RULE_SETUP #line 122 "param_lex.l" { tokenpos+=yyleng; yylval.value=atoi(yytext); return INTEGER; } YY_BREAK case 14: YY_RULE_SETUP #line 124 "param_lex.l" { tokenpos+=yyleng; return yytext[0]; } YY_BREAK case 15: YY_RULE_SETUP #line 126 "param_lex.l" ECHO; YY_BREAK case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 74 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 74 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 73); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 126 "param_lex.l" void yy_cleanup(void) { yy_delete_buffer(yy_current_buffer); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_string" static char *get_string(const char *s) { char *s1; size_t size; size=strlen(s)+1; if(!(s1=malloc(size))) ABT_FUNC(MMsg); (void)memcpy(s1,s,size); return s1; } static int symbol_lookup(const char *p) { static char *Coms[] = {"RESIDUAL","GENETIC","VARIANCE","POSITION","FREQUENCY", "START","ITERATIONS","SAMPLE","FROM","OUTPUT","MEAN","MAP","TOTAL", "SEED","FILE","SEEDFILE","TRAIT","LOCI","SET","ESTIMATE","IBD", "GROUP","ORDER","MALE","FEMALE","LIMIT","PHENOTYPE", "PHENOTYPES","PHENO","GENOTYPE","GENOTYPES","GENO","COUNTS","DUMP", "TYPE","ANALYZE","NORMAL","STUDENT_T","HAPLO","HAPLOTYPES","INCLUDE", "FUNCTION","HALDANE","KOSAMBI","RECOMB","RECOMBINATION","RECOMBINATIONS", "POLYGENIC","AFFECTED","TIME","VIRTUAL","MARKERS","GRID","COMPRESS","DIR",(char *)0}; static int Com_token[] = {RESIDUAL,GENETIC,VARIANCE,POSITION,FREQUENCY, START,ITERATIONS,SAMPLE,FROM,OUTPUT,MEAN,MAP,TOTAL, SEED,SFILE,SEEDFILE,TRAIT,LOCI,SET,ESTIMATE,IBD, GROUP,ORDER,MALE,FEMALE,LIMIT,PHENO,PHENO,PHENO,GENO,GENO,GENO, COUNTS,DUMP,TYPE,ANALYZE,NORMAL,STUDENT_T,HAPLO,HAPLO,INCLUDE,FUNCTION, HALDANE,KOSAMBI,RECOMB,RECOMB,RECOMB,POLYGENIC,AFFECTED, TIMECOM,VIRTUAL,MARKERS,GRID,COMPRESS,DIR,SYSTEM_VAR,STRING}; static char *Syst[] = {"NO_OVERDOMINANT","TAU_BETA","TAU_MODE","CENSOR_MODE", "DEBUG_LEVEL","LM_RATIO","PEEL_TRACE","BACKUPS", "SI_MODE","IBD_OUTPUT","RNG","GENV_OUT",(char *)0}; int i=0,j; while(Coms[i]) { if(!strcasecmp(Coms[i],p)) break; i++; } if(Com_token[i]==SYSTEM_VAR) { i++; j=0; while(Syst[j]) { if(!strcasecmp(Syst[j],p)) { yylval.value=j; i--; break; } j++; } } return Com_token[i]; } void include_param_file(char *fname) { FILE *fptr; YY_BUFFER_STATE ystate; int i,j; struct stat st1,st2; if(fname) { if(!fname[0]) yyerror("Null filename from INCLUDE command\n"); if(stat(fname,&st1)) { (void)fprintf(stderr,"File: %s\n",fname); yyerror("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } for(i=0;i<=list_ptr;i++) { if(stat(fname_list[i],&st2)) { (void)fprintf(stderr,"File: %s\n",fname_list[i]); yyerror("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } if(st1.st_ino==st2.st_ino && st1.st_dev==st2.st_dev) { for(j=0;j<=list_ptr;j++) { if(j==i) (void)fprintf(stderr,"*%s* -> ",fname_list[j]); else (void)fprintf(stderr,"%s -> ",fname_list[j]); } (void)fprintf(stderr,"%s\n",fname); yyerror("Recursive include files!\n"); exit(EXIT_FAILURE); } } if(list_ptr #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include "param_parse.h" #include "loki_scan.h" #include "utils.h" #ifndef YY_STACK_USED #define YY_STACK_USED 0 #endif #ifndef YY_ALWAYS_INTERACTIVE #define YY_ALWAYS_INTERACTIVE 0 #endif #ifndef YY_NEVER_INTERACTIVE #define YY_NEVER_INTERACTIVE 0 #endif #ifndef YY_MAIN #define YY_MAIN 0 #endif extern void yyerror(char *s),print_scan_err(char *fmt, ...); extern int scan_error_n; static int token,i; int tokenpos,lineno=1,lineno1=1; char linebuf[512],linebuf1[512]; static int symbol_lookup(const char *p); static char *get_string(const char *p); static YY_BUFFER_STATE bufstate_list[MAX_INCLUDE]; char *fname_list[MAX_INCLUDE+1]; int list_ptr; static int ln_list[MAX_INCLUDE],ln1_list[MAX_INCLUDE]; %} %x COMMENT %s ISTATE %% .*\n { (void)strncpy(linebuf,yytext,512); (void)strcpy(linebuf1,linebuf); yyless((int)0); BEGIN ISTATE; } <> { if(iflag) { iflag=0; } else { if(--list_ptr<0) yyterminate(); else { free(fname_list[list_ptr+1]); yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(bufstate_list[list_ptr]); lineno=ln_list[list_ptr]; lineno1=ln1_list[list_ptr]; linebuf[0]=linebuf1[0]=0; } } } [\t ] {tokenpos+=yyleng;} \n.* { lineno++; tokenpos=0; (void)strncpy(linebuf,yytext+1,512); yyless((int)1); } "/*" BEGIN(COMMENT); . {tokenpos+=yyleng;} \n {lineno++; tokenpos=0;} "*/" {BEGIN(ISTATE); tokenpos+=yyleng;} #.*$ ; \"[^\"\n]*[\n\"] { tokenpos+=yyleng; yylval.string=get_string(yytext+1); i=strlen(yylval.string); if(i) yylval.string[i-1]='\0'; return STRING; } \'[^\'\n]*[\n\'] { tokenpos+=yyleng; yylval.string=get_string(yytext+1); i=strlen(yylval.string); if(i) yylval.string[i-1]='\0'; return STRING; } [a-zA-Z][a-zA-Z0-9_]* { token=symbol_lookup(yytext); tokenpos+=yyleng; if(token==STRING) yylval.string=get_string(yytext); return token; } [+-]?([0-9]*\.[0-9]+)|(([0-9]+|([0-9]*\.[0-9]+))E[-+]?[0-9]+) { tokenpos+=yyleng; yylval.rvalue=atof(yytext); return REAL; } [+-]?[0-9]+ { tokenpos+=yyleng; yylval.value=atoi(yytext); return INTEGER; } . { tokenpos+=yyleng; return yytext[0]; } %% void yy_cleanup(void) { yy_delete_buffer(yy_current_buffer); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_string" static char *get_string(const char *s) { char *s1; size_t size; size=strlen(s)+1; if(!(s1=malloc(size))) ABT_FUNC(MMsg); (void)memcpy(s1,s,size); return s1; } static int symbol_lookup(const char *p) { static char *Coms[] = {"RESIDUAL","GENETIC","VARIANCE","POSITION","FREQUENCY", "START","ITERATIONS","SAMPLE","FROM","OUTPUT","MEAN","MAP","TOTAL", "SEED","FILE","SEEDFILE","TRAIT","LOCI","SET","ESTIMATE","IBD", "GROUP","ORDER","MALE","FEMALE","LIMIT","PHENOTYPE", "PHENOTYPES","PHENO","GENOTYPE","GENOTYPES","GENO","COUNTS","DUMP", "TYPE","ANALYZE","NORMAL","STUDENT_T","HAPLO","HAPLOTYPES","INCLUDE", "FUNCTION","HALDANE","KOSAMBI","RECOMB","RECOMBINATION","RECOMBINATIONS", "POLYGENIC","AFFECTED","TIME","VIRTUAL","MARKERS","GRID","COMPRESS","DIR",(char *)0}; static int Com_token[] = {RESIDUAL,GENETIC,VARIANCE,POSITION,FREQUENCY, START,ITERATIONS,SAMPLE,FROM,OUTPUT,MEAN,MAP,TOTAL, SEED,SFILE,SEEDFILE,TRAIT,LOCI,SET,ESTIMATE,IBD, GROUP,ORDER,MALE,FEMALE,LIMIT,PHENO,PHENO,PHENO,GENO,GENO,GENO, COUNTS,DUMP,TYPE,ANALYZE,NORMAL,STUDENT_T,HAPLO,HAPLO,INCLUDE,FUNCTION, HALDANE,KOSAMBI,RECOMB,RECOMB,RECOMB,POLYGENIC,AFFECTED, TIMECOM,VIRTUAL,MARKERS,GRID,COMPRESS,DIR,SYSTEM_VAR,STRING}; static char *Syst[] = {"NO_OVERDOMINANT","TAU_BETA","TAU_MODE","CENSOR_MODE", "DEBUG_LEVEL","LM_RATIO","PEEL_TRACE","BACKUPS", "SI_MODE","IBD_OUTPUT","RNG","GENV_OUT",(char *)0}; int i=0,j; while(Coms[i]) { if(!strcasecmp(Coms[i],p)) break; i++; } if(Com_token[i]==SYSTEM_VAR) { i++; j=0; while(Syst[j]) { if(!strcasecmp(Syst[j],p)) { yylval.value=j; i--; break; } j++; } } return Com_token[i]; } void include_param_file(char *fname) { FILE *fptr; YY_BUFFER_STATE ystate; int i,j; struct stat st1,st2; if(fname) { if(!fname[0]) yyerror("Null filename from INCLUDE command\n"); if(stat(fname,&st1)) { (void)fprintf(stderr,"File: %s\n",fname); yyerror("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } for(i=0;i<=list_ptr;i++) { if(stat(fname_list[i],&st2)) { (void)fprintf(stderr,"File: %s\n",fname_list[i]); yyerror("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } if(st1.st_ino==st2.st_ino && st1.st_dev==st2.st_dev) { for(j=0;j<=list_ptr;j++) { if(j==i) (void)fprintf(stderr,"*%s* -> ",fname_list[j]); else (void)fprintf(stderr,"%s -> ",fname_list[j]); } (void)fprintf(stderr,"%s\n",fname); yyerror("Recursive include files!\n"); exit(EXIT_FAILURE); } } if(list_ptr #include #ifdef USE_DMALLOC #include #endif #include #include #include #include #include "utils.h" #include "loki_scan.h" #include "loki_ibd.h" #include "shared_peel.h" #include "mat_utils.h" #include "loki.h" #include "ranlib.h" #include "output_recomb.h" #ifndef YYDEBUG #define YYDEBUG 0 #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 0 #endif #ifndef __GNUC__ #define __GNUC__ 0 #endif extern FILE *yyin; double *residual_var,*residual_var_limit,*additive_var,*additive_var_limit,*grand_mean,limit_time,tloci_mean; int *res_var_set,*add_var_set,*grand_mean_set,num_iter,max_tloci=16,min_tloci,sex_map,iflag; int tloci_mean_set,start_tloci=-1,dump_freq,output_type=DEFAULT_OUTPUT_TYPE,limit_timer_type; int sample_from[2]={0,0}; int sample_freq[2]={1,1}; static int start_flag=1,compress_ibd,ibd_mode; static struct Marker *freq_marker; static int check_variance(double,int); static void set_position(struct lk_variable *, double, double); static struct lk_variable *find_var(char *, int, int); static struct Marker *check_marker(struct lk_variable *); static int find_allele(char *, struct Marker *,int, int); static int find_group(char *,int, int); static int find_trait(struct lk_variable *); static void set_output_gen(char *,char *); static struct IBD_List *add_ibd_list(double,struct IBD_List *); static void set_freq(struct Marker *, double,int); static void set_map_range(char *,double,double, int); static void set_tloci(int,int); static void set_ibd_list(char *,struct IBD_List *,int); static void set_ibd_markers(char *); static void set_output(struct lk_variable *); static void set_group_order(int); static void set_analyze(char *); static void set_ibd_mode(char *); static struct Variable *group_var; static int group_ptr,*group_order,group_counter,freq_allele,c_flag; extern void yyerror(char *s),print_scan_err(char *fmt, ...); extern int yyparse(void),yylex(void),lineno,lineno1,tokenpos; extern char *yytext,linebuf[]; char *Output_Phen,*Outputfile,*Dumpfile,*Freqfile,*Haplofile,*Polyfile; char *OutputPosfile,*OutputIBDfile,*OutputIBDdir; struct output_gen *Output_Gen; static int max_scan_errors=30; static int scan_warn_n,max_scan_warnings=30; static int *ran_flag; int scan_error_n,output_haplo; struct id_data syst_var[NUM_SYSTEM_VAR]; #line 90 "param_parse.y" #ifndef YYSTYPE typedef union { char *string; int value; double rvalue; struct IBD_List *rlist; struct lk_variable *lk_var; } yystype; # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #ifndef YYDEBUG # define YYDEBUG 0 #endif #define YYFINAL 293 #define YYFLAG -32768 #define YYNTBASE 59 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ #define YYTRANSLATE(x) ((unsigned)(x) <= 308 ? yytranslate[x] : 109) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 56, 57, 58, 2, 55, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 }; #if YYDEBUG static const short yyprhs[] = { 0, 0, 1, 4, 6, 7, 11, 14, 16, 18, 19, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 69, 75, 79, 85, 89, 93, 97, 98, 102, 103, 105, 111, 115, 120, 124, 131, 136, 140, 144, 148, 150, 152, 154, 156, 160, 161, 165, 169, 173, 178, 183, 186, 191, 195, 201, 204, 210, 217, 224, 228, 234, 239, 244, 248, 254, 259, 264, 268, 272, 276, 281, 287, 292, 295, 299, 305, 309, 313, 319, 323, 327, 333, 336, 340, 344, 349, 354, 359, 363, 367, 371, 374, 378, 382, 386, 392, 396, 401, 406, 412, 417, 423, 427, 432, 437, 443, 448, 454, 457, 461, 465, 471, 472, 477, 478, 484, 485, 490, 492, 494, 499, 501, 505, 507, 508, 513, 515, 517, 519, 521, 525, 527, 529, 531, 532, 537, 538, 544, 546, 548, 552, 556, 558, 562, 564 }; static const short yyrhs[] = { -1, 60, 62, 0, 1, 0, 0, 59, 61, 62, 0, 59, 1, 0, 64, 0, 65, 0, 0, 9, 63, 64, 0, 84, 0, 86, 0, 89, 0, 90, 0, 88, 0, 82, 0, 66, 0, 83, 0, 80, 0, 79, 0, 81, 0, 67, 0, 71, 0, 98, 0, 85, 0, 87, 0, 76, 0, 68, 0, 73, 0, 78, 0, 72, 0, 12, 13, 53, 0, 12, 13, 53, 70, 53, 0, 9, 14, 53, 0, 9, 14, 53, 70, 53, 0, 22, 23, 53, 0, 22, 23, 54, 0, 22, 52, 108, 0, 0, 42, 69, 52, 0, 0, 55, 0, 25, 26, 52, 70, 107, 0, 25, 26, 107, 0, 25, 26, 48, 52, 0, 25, 26, 48, 0, 25, 26, 49, 52, 70, 107, 0, 25, 26, 49, 107, 0, 50, 26, 14, 0, 50, 14, 26, 0, 25, 32, 7, 0, 52, 0, 32, 0, 26, 0, 74, 0, 75, 55, 74, 0, 0, 38, 77, 75, 0, 24, 31, 108, 0, 31, 24, 108, 0, 31, 8, 24, 108, 0, 8, 24, 31, 108, 0, 19, 52, 0, 19, 52, 55, 53, 0, 17, 18, 52, 0, 17, 18, 52, 55, 53, 0, 17, 53, 0, 15, 52, 108, 55, 108, 0, 29, 15, 52, 108, 55, 108, 0, 30, 15, 52, 108, 55, 108, 0, 16, 15, 108, 0, 16, 15, 108, 55, 108, 0, 16, 29, 15, 108, 0, 16, 30, 15, 108, 0, 15, 16, 108, 0, 15, 16, 108, 55, 108, 0, 29, 15, 16, 108, 0, 30, 15, 16, 108, 0, 15, 43, 44, 0, 15, 43, 45, 0, 20, 21, 53, 0, 9, 20, 21, 53, 0, 20, 21, 53, 55, 53, 0, 20, 21, 10, 108, 0, 11, 53, 0, 14, 7, 53, 0, 14, 7, 53, 55, 53, 0, 14, 7, 52, 0, 12, 7, 53, 0, 12, 7, 53, 55, 53, 0, 14, 33, 52, 0, 14, 34, 52, 0, 14, 34, 52, 55, 52, 0, 14, 96, 0, 14, 37, 53, 0, 14, 18, 52, 0, 14, 6, 18, 52, 0, 14, 26, 18, 52, 0, 14, 26, 51, 52, 0, 36, 18, 52, 0, 36, 7, 53, 0, 14, 41, 52, 0, 14, 41, 0, 14, 46, 52, 0, 14, 47, 52, 0, 14, 26, 52, 0, 14, 26, 52, 55, 52, 0, 3, 5, 108, 0, 3, 5, 94, 108, 0, 3, 5, 31, 108, 0, 3, 5, 31, 94, 108, 0, 31, 3, 5, 108, 0, 31, 3, 5, 94, 108, 0, 4, 5, 108, 0, 4, 5, 94, 108, 0, 4, 5, 31, 108, 0, 4, 5, 31, 94, 108, 0, 31, 4, 5, 108, 0, 31, 4, 5, 94, 108, 0, 10, 108, 0, 10, 94, 108, 0, 6, 95, 108, 0, 6, 95, 108, 55, 108, 0, 0, 7, 91, 97, 103, 0, 0, 7, 92, 35, 97, 103, 0, 0, 35, 93, 97, 103, 0, 95, 0, 52, 0, 52, 56, 53, 57, 0, 95, 0, 96, 55, 95, 0, 95, 0, 0, 27, 28, 99, 101, 0, 53, 0, 54, 0, 52, 0, 100, 0, 101, 55, 100, 0, 53, 0, 54, 0, 52, 0, 0, 102, 55, 104, 106, 0, 0, 103, 102, 55, 105, 106, 0, 108, 0, 58, 0, 106, 55, 108, 0, 106, 55, 58, 0, 108, 0, 107, 55, 108, 0, 54, 0, 53, 0 }; #endif #if YYDEBUG /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { 0, 116, 116, 117, 118, 118, 119, 122, 123, 124, 124, 127, 128, 129, 130, 131, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 158, 159, 160, 163, 163, 166, 167, 170, 171, 172, 173, 174, 175, 178, 179, 182, 185, 186, 187, 190, 191, 194, 194, 197, 198, 199, 200, 203, 204, 205, 206, 207, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 230, 231, 232, 233, 236, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 262, 263, 266, 267, 268, 269, 272, 273, 276, 277, 278, 279, 282, 284, 287, 288, 291, 291, 292, 292, 293, 293, 296, 298, 299, 302, 303, 306, 308, 308, 311, 312, 313, 316, 317, 320, 321, 322, 325, 325, 326, 326, 329, 330, 331, 332, 335, 336, 339, 340 }; #endif #if (YYDEBUG) || defined YYERROR_VERBOSE /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ static const char *const yytname[] = { "$", "error", "$undefined.", "RESIDUAL", "GENETIC", "VARIANCE", "POSITION", "FREQUENCY", "VIRTUAL", "START", "MEAN", "ITERATIONS", "SAMPLE", "FROM", "OUTPUT", "MAP", "TOTAL", "SEED", "SFILE", "SEEDFILE", "TRAIT", "LOCI", "SET", "SYSTEM_VAR", "TIMECOM", "ESTIMATE", "IBD", "GROUP", "ORDER", "MALE", "FEMALE", "LIMIT", "AFFECTED", "PHENO", "GENO", "COUNTS", "DUMP", "TYPE", "ANALYZE", "NORMAL", "STUDENT_T", "HAPLO", "INCLUDE", "FUNCTION", "HALDANE", "KOSAMBI", "RECOMB", "POLYGENIC", "MARKERS", "GRID", "COMPRESS", "DIR", "STRING", "INTEGER", "REAL", "','", "'('", "')'", "'*'", "parmfile", "@1", "@2", "command1", "@3", "command", "command_a", "samplecommand", "setcommand", "includecommand", "@4", "opt_comma", "ibdcommand", "compresscommand", "aff_freqcommand", "analyzecom", "analyzelist", "analyzecommand", "@5", "limit_timecommand", "seedcommand", "mapcommand", "tlocicommand", "itercommand", "outputcommand", "resvarcommand", "limitresvarcommand", "addvarcommand", "limitaddvarcommand", "meancommand", "positioncommand", "frequencycommand", "@6", "@7", "@8", "trait_var", "lkvar", "lkvarlist", "lkmarker", "groupcommand", "@9", "group", "grouplist", "allele", "freqlist", "@10", "@11", "freqlist1", "ibdlist", "rnum", 0 }; #endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const short yyr1[] = { 0, 60, 59, 59, 61, 59, 59, 62, 62, 63, 62, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 67, 67, 67, 69, 68, 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 73, 74, 74, 74, 75, 75, 77, 76, 78, 78, 78, 78, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 85, 85, 85, 85, 86, 86, 87, 87, 87, 87, 88, 88, 89, 89, 91, 90, 92, 90, 93, 90, 94, 95, 95, 96, 96, 97, 99, 98, 100, 100, 100, 101, 101, 102, 102, 102, 104, 103, 105, 103, 106, 106, 106, 106, 107, 107, 108, 108 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const short yyr2[] = { 0, 0, 2, 1, 0, 3, 2, 1, 1, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 3, 5, 3, 3, 3, 0, 3, 0, 1, 5, 3, 4, 3, 6, 4, 3, 3, 3, 1, 1, 1, 1, 3, 0, 3, 3, 3, 4, 4, 2, 4, 3, 5, 2, 5, 6, 6, 3, 5, 4, 4, 3, 5, 4, 4, 3, 3, 3, 4, 5, 4, 2, 3, 5, 3, 3, 5, 3, 3, 5, 2, 3, 3, 4, 4, 4, 3, 3, 3, 2, 3, 3, 3, 5, 3, 4, 4, 5, 4, 5, 3, 4, 4, 5, 4, 5, 2, 3, 3, 5, 0, 4, 0, 5, 0, 4, 1, 1, 4, 1, 3, 1, 0, 4, 1, 1, 1, 1, 3, 1, 1, 1, 0, 4, 0, 5, 1, 1, 3, 3, 1, 3, 1, 1 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const short yydefact[] = { 0, 3, 0, 0, 6, 0, 0, 0, 0, 124, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 57, 39, 0, 2, 7, 8, 17, 22, 28, 23, 31, 29, 27, 30, 20, 19, 21, 16, 18, 11, 25, 12, 26, 15, 13, 14, 24, 5, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 157, 156, 0, 130, 120, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 0, 0, 133, 94, 0, 0, 0, 0, 0, 0, 0, 67, 63, 0, 0, 0, 0, 0, 0, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, 114, 0, 122, 135, 0, 0, 0, 34, 0, 0, 0, 10, 121, 89, 32, 0, 88, 86, 96, 0, 0, 106, 91, 92, 95, 102, 104, 105, 0, 75, 79, 80, 0, 71, 0, 0, 65, 0, 0, 81, 36, 37, 38, 59, 46, 0, 41, 44, 154, 51, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 101, 100, 54, 53, 52, 55, 58, 40, 50, 49, 0, 110, 109, 0, 116, 115, 0, 0, 145, 143, 144, 0, 125, 0, 62, 42, 0, 82, 0, 0, 0, 0, 97, 0, 98, 99, 0, 0, 134, 0, 0, 0, 73, 74, 0, 64, 84, 0, 45, 41, 48, 0, 0, 140, 138, 139, 141, 137, 77, 0, 78, 0, 0, 112, 0, 118, 61, 129, 0, 111, 117, 132, 123, 146, 0, 127, 35, 90, 33, 87, 107, 93, 76, 68, 72, 66, 83, 0, 43, 155, 0, 0, 0, 113, 119, 56, 0, 148, 47, 142, 69, 70, 151, 147, 150, 0, 0, 149, 153, 152, 0, 0 }; static const short yydefgoto[] = { 2, 3, 5, 33, 67, 34, 35, 36, 37, 38, 114, 208, 39, 40, 41, 187, 188, 42, 113, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 62, 63, 110, 118, 71, 87, 126, 56, 172, 238, 239, 203, 204, 278, 287, 285, 169, 170 }; static const short yypact[] = { 322,-32768, 277, 359,-32768, 359, 10, 14, -29, 5, 33, 50, 85, -17, 55, 48, -9, 89, -14, 23, 59, 4, 52, 39, 68, 84, 92, 69,-32768, 11, -32768,-32768, 12,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -21, 38, 56, 7, -29, 82, 91, 74, 102, 18,-32768,-32768, 7,-32768,-32768,-32768, 80, 90, 117, 49, 97, -10, 98, 106, 107, 116, 120, 121,-32768, 104, 7, 70, 7, 7, 154, 159, 123,-32768, 122, -8, 93, 7, 7, 72, 169,-32768, -4, -2, 173, 174, 157, 7, -29, 129, 132, -15, 133, 160, 175, 85, 7,-32768, 85, 7,-32768, 135, 136,-32768, 88, -29, 7, 31, 137, 187, 188,-32768,-32768, 139, 31, 143,-32768, 141, -32768, 145, 148, 146,-32768, 147,-32768,-32768,-32768,-32768, -29, 150,-32768,-32768, 151, 152, 7, 7, 153, 161, 7, 158,-32768,-32768,-32768,-32768, 163, 100, 162, 164, -32768,-32768, 103, 7, 7, 7, 7, 85, 85, 7, -32768, 88,-32768,-32768,-32768,-32768,-32768,-32768, 165,-32768, -32768,-32768, 7,-32768,-32768, 7,-32768,-32768, 155, 7, -32768,-32768,-32768, 166, 88, 88,-32768,-32768, 170,-32768, 85, 85, 171, 172,-32768, 176,-32768,-32768, 178, 179, -32768, 7, 7, 7,-32768,-32768, 180,-32768,-32768, 182, -32768, 162, 164, 7, 7,-32768,-32768,-32768,-32768, 181, -32768, 183,-32768, 184, 7,-32768, 7,-32768,-32768, 88, -15,-32768,-32768,-32768,-32768,-32768, 185, 88,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 7, 164,-32768, 103, 7, 7,-32768,-32768,-32768, 76,-32768, 164,-32768,-32768,-32768,-32768, 186,-32768, 76, 78, 186, -32768,-32768, 203,-32768 }; static const short yypgoto[] = { -32768,-32768,-32768, 211,-32768, 177,-32768,-32768,-32768,-32768, -32768, -133,-32768,-32768,-32768, -32,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768, -7, 1,-32768, -97,-32768, -32768, -46,-32768, -198, -161,-32768,-32768, -60, -166, -12 }; #define YYLAST 409 static const short yytable[] = { 72, 232, 160, 213, 94, 70, 256, 88, 141, 61, 117, 184, 173, 181, 175, 58, 86, 185, 111, 59, 249, 131, 132, 60, 8, 9, 115, 98, 12, 112, 205, 60, 68, 69, 89, 233, 73, 186, 116, 95, -126, 142, 143, 90, 257, 161, 119, 122, 174, 124, 176, 256, 121, 28, 76, 77, 99, 64, 134, 256, 68, 69, 74, 125, 65, 101, 78, 270, 75, 120, 66, 102, 106, 107, 79, 96, 151, 108, 154, 155, 97, 80, 81, 100, -41, 82, 207, 164, 165, 83, 60, 68, 69, 109, 84, 85, 103, 180, 269, 104, 60, 138, 139, 280, 91, 193, 194, 105, 196, 197, 192, 125, 123, 195, 152, 153, 206, 127, 92, 93, 166, 167, 128, 130, 168, 68, 69, 129, 125, 68, 69, 68, 69, 135, 284, 137, 290, 60, 68, 69, 200, 201, 202, 136, 224, 225, 162, 163, 228, 140, 144, 220, 231, 68, 69, 235, 236, 237, 145, 150, 146, 240, 241, 242, 243, 245, 247, 248, 147, 156, 244, 246, 148, 149, 157, 158, 171, 159, 177, 178, 251, 179, 182, 252, 183, 189, 190, 254, 198, 191, 209, 199, 210, 211, 212, 214, 215, 216, 119, 122, 217, 218, 219, 293, 121, 221, 222, 223, 226, 264, 265, 266, 253, 229, 227, 230, 57, 207, 277, 234, 250, 255, 271, 258, 259, 260, 281, 289, 0, 261, 262, 263, 275, 267, 276, 268, 272, 0, 273, 274, 279, 288, 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282, 283, 0, 0, 0, 286, 0, 0, 0, 0, 0, 0, 0, 0, 286, 291, 292, 4, 0, -4, -4, 0, -4, -4, -4, -4, -4, -4, -4, 0, -4, -4, -4, -4, 0, -4, -4, 0, -4, 0, -4, -4, 0, -4, 0, -4, -4, -4, 0, 0, 0, -4, -4, 0, -4, 0, 0, 0, -4, 0, 0, 0, 1, 0, -1, -1, -4, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 0, -1, -1, 0, -1, 0, -1, -1, 0, -1, 0, -1, -1, -1, 0, 0, 0, -1, -1, 0, -1, 0, 6, 7, -1, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16, 17, 18, 0, 19, 20, 0, 21, 0, 22, 23, 0, 24, 0, 25, 26, 27, 0, 0, 0, 28, 29, 0, 30, 0, 0, 0, 31, 0, 0, 0, 0, 0, 0, 0, 32 }; static const short yycheck[] = { 12, 167, 10, 136, 18, 12, 204, 16, 18, 8, 31, 26, 16, 110, 16, 5, 15, 32, 7, 5, 181, 3, 4, 52, 6, 7, 14, 23, 10, 18, 127, 52, 53, 54, 43, 168, 53, 52, 26, 53, 35, 51, 52, 52, 205, 53, 58, 59, 52, 61, 52, 249, 59, 35, 6, 7, 52, 24, 70, 257, 53, 54, 7, 62, 14, 26, 18, 233, 13, 31, 20, 32, 3, 4, 26, 52, 88, 8, 90, 91, 21, 33, 34, 31, 53, 37, 55, 99, 100, 41, 52, 53, 54, 24, 46, 47, 28, 109, 231, 15, 52, 52, 53, 269, 15, 117, 118, 15, 120, 121, 117, 110, 56, 120, 44, 45, 128, 35, 29, 30, 48, 49, 31, 21, 52, 53, 54, 53, 127, 53, 54, 53, 54, 53, 58, 18, 58, 52, 53, 54, 52, 53, 54, 53, 156, 157, 53, 54, 160, 52, 52, 150, 52, 53, 54, 52, 53, 54, 52, 55, 53, 173, 174, 175, 176, 177, 178, 179, 52, 15, 177, 178, 52, 52, 15, 52, 7, 55, 5, 5, 192, 24, 53, 195, 52, 52, 26, 199, 53, 14, 53, 55, 5, 5, 55, 52, 55, 52, 210, 211, 52, 55, 55, 0, 211, 55, 55, 55, 55, 221, 222, 223, 57, 55, 53, 52, 5, 55, 250, 55, 55, 55, 234, 53, 53, 53, 272, 287, -1, 53, 52, 52, 244, 53, 246, 53, 55, -1, 55, 55, 55, 55, -1, -1, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273, 274, -1, -1, -1, 278, -1, -1, -1, -1, -1, -1, -1, -1, 287, 288, 0, 1, -1, 3, 4, -1, 6, 7, 8, 9, 10, 11, 12, -1, 14, 15, 16, 17, -1, 19, 20, -1, 22, -1, 24, 25, -1, 27, -1, 29, 30, 31, -1, -1, -1, 35, 36, -1, 38, -1, -1, -1, 42, -1, -1, -1, 1, -1, 3, 4, 50, 6, 7, 8, 9, 10, 11, 12, -1, 14, 15, 16, 17, -1, 19, 20, -1, 22, -1, 24, 25, -1, 27, -1, 29, 30, 31, -1, -1, -1, 35, 36, -1, 38, -1, 3, 4, 42, 6, 7, 8, 9, 10, 11, 12, 50, 14, 15, 16, 17, -1, 19, 20, -1, 22, -1, 24, 25, -1, 27, -1, 29, 30, 31, -1, -1, -1, 35, 36, -1, 38, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, 50 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison/bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; # if YYLSP_NEEDED YYLTYPE yyls; # endif }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # if YYLSP_NEEDED # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + 2 * YYSTACK_GAP_MAX) # else # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) # endif /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #if YYPURE # if YYLSP_NEEDED # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) # else # define YYLEX yylex (&yylval, &yylloc) # endif # else /* !YYLSP_NEEDED */ # ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) # else # define YYLEX yylex (&yylval) # endif # endif /* !YYLSP_NEEDED */ #else /* !YYPURE */ # define YYLEX yylex () #endif /* !YYPURE */ /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #ifdef YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif #line 315 "/usr/local/share/bison/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* YY_DECL_VARIABLES -- depending whether we use a pure parser, variables are global, or local to YYPARSE. */ #define YY_DECL_NON_LSP_VARIABLES \ /* The lookahead symbol. */ \ int yychar; \ \ /* The semantic value of the lookahead symbol. */ \ YYSTYPE yylval; \ \ /* Number of parse errors so far. */ \ int yynerrs; #if YYLSP_NEEDED # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES \ \ /* Location data for the lookahead symbol. */ \ YYLTYPE yylloc; #else # define YY_DECL_VARIABLES \ YY_DECL_NON_LSP_VARIABLES #endif /* If nonreentrant, generate the variables here. */ #if !YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { /* If reentrant, generate the variables here. */ #if YYPURE YY_DECL_VARIABLES #endif /* !YYPURE */ register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #if YYLSP_NEEDED /* The location stack. */ YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #endif #if YYLSP_NEEDED # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else # define YYPOPSTACK (yyvsp--, yyssp--) #endif YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYLSP_NEEDED YYLTYPE yyloc; #endif /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; #if YYLSP_NEEDED yylsp = yyls; #endif goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ # if YYLSP_NEEDED YYLTYPE *yyls1 = yyls; /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); yyls = yyls1; # else yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); # endif yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # if YYLSP_NEEDED YYSTACK_RELOCATE (yyls); # endif # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; #if YYLSP_NEEDED yylsp = yyls + yysize - 1; #endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { YYFPRINTF (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ # ifdef YYPRINT YYPRINT (stderr, yychar, yylval); # endif YYFPRINTF (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to the semantic value of the lookahead token. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYLSP_NEEDED /* Similarly for the default location. Let the user run additional commands if for instance locations are ranges. */ yyloc = yylsp[1-yylen]; YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 116 "param_parse.y" {lineno1=lineno;} break; case 2: #line 116 "param_parse.y" {iflag=0;} break; case 3: #line 117 "param_parse.y" {iflag=0;} break; case 4: #line 118 "param_parse.y" {lineno1=lineno;} break; case 5: #line 118 "param_parse.y" {iflag=0;} break; case 6: #line 119 "param_parse.y" {iflag=0;} break; case 9: #line 124 "param_parse.y" {start_flag=2;} break; case 10: #line 124 "param_parse.y" {start_flag=1;} break; case 32: #line 152 "param_parse.y" {sample_from[0]=sample_from[1]=yyvsp[0].value;} break; case 33: #line 153 "param_parse.y" {sample_from[0]=yyvsp[-2].value; sample_from[1]=yyvsp[0].value;} break; case 34: #line 154 "param_parse.y" {sample_from[0]=sample_from[1]=yyvsp[0].value;} break; case 35: #line 155 "param_parse.y" {sample_from[0]=yyvsp[-2].value; sample_from[1]=yyvsp[0].value;} break; case 36: #line 158 "param_parse.y" { syst_var[yyvsp[-1].value].data.value=yyvsp[0].value; syst_var[yyvsp[-1].value].flag=ST_INTEGER; } break; case 37: #line 159 "param_parse.y" { syst_var[yyvsp[-1].value].data.rvalue=yyvsp[0].rvalue; syst_var[yyvsp[-1].value].flag=ST_REAL; } break; case 38: #line 160 "param_parse.y" { free(yyvsp[-1].string); yyerror("Unrecognized system variable"); } break; case 39: #line 163 "param_parse.y" {iflag=1;} break; case 40: #line 163 "param_parse.y" {include_param_file(yyvsp[0].string);} break; case 43: #line 170 "param_parse.y" { set_ibd_list(yyvsp[-2].string,yyvsp[0].rlist,IBD_EST_DISCRETE); free(yyvsp[-2].string);} break; case 44: #line 171 "param_parse.y" { set_ibd_list(0,yyvsp[0].rlist,IBD_EST_DISCRETE); } break; case 45: #line 172 "param_parse.y" { set_ibd_markers(yyvsp[0].string); free(yyvsp[0].string);} break; case 46: #line 173 "param_parse.y" { set_ibd_markers(0); } break; case 47: #line 174 "param_parse.y" { set_ibd_list(yyvsp[-2].string,yyvsp[0].rlist,IBD_EST_GRID); free(yyvsp[-2].string);} break; case 48: #line 175 "param_parse.y" { set_ibd_list(0,yyvsp[0].rlist,IBD_EST_GRID); } break; case 49: #line 178 "param_parse.y" {compress_ibd=1;} break; case 50: #line 179 "param_parse.y" {compress_ibd=1;} break; case 51: #line 182 "param_parse.y" {est_aff_freq=1;} break; case 52: #line 185 "param_parse.y" {set_analyze(yyvsp[0].string); free(yyvsp[0].string);} break; case 53: #line 186 "param_parse.y" {set_analyze("AFFECTED");} break; case 54: #line 187 "param_parse.y" {set_analyze("IBD");} break; case 57: #line 194 "param_parse.y" {analysis=0;} break; case 59: #line 197 "param_parse.y" {limit_time=yyvsp[0].rvalue,limit_timer_type=ITIMER_REAL;} break; case 60: #line 198 "param_parse.y" {limit_time=yyvsp[0].rvalue,limit_timer_type=ITIMER_REAL;} break; case 61: #line 199 "param_parse.y" {limit_time=yyvsp[0].rvalue,limit_timer_type=ITIMER_VIRTUAL;} break; case 62: #line 200 "param_parse.y" {limit_time=yyvsp[0].rvalue,limit_timer_type=ITIMER_VIRTUAL;} break; case 63: #line 203 "param_parse.y" {if(Seedfile) free(Seedfile); Seedfile=yyvsp[0].string;} break; case 64: #line 204 "param_parse.y" {if(Seedfile) free(Seedfile); Seedfile=yyvsp[-2].string; if(yyvsp[0].value) *ran_flag|=1; else *ran_flag&=~1;} break; case 65: #line 205 "param_parse.y" {if(Seedfile) free(Seedfile); Seedfile=yyvsp[0].string;} break; case 66: #line 206 "param_parse.y" {if(Seedfile) free(Seedfile); Seedfile=yyvsp[-2].string; if(yyvsp[0].value) *ran_flag|=1; else *ran_flag&=~1;} break; case 67: #line 207 "param_parse.y" { if(yyvsp[0].value<0) yyerror("Seedvalue out of range"); else { init_ranf(yyvsp[0].value); *ran_flag|=2; } } break; case 68: #line 215 "param_parse.y" {set_map_range(yyvsp[-3].string,yyvsp[-2].rvalue,yyvsp[0].rvalue,-1); free(yyvsp[-3].string);} break; case 69: #line 216 "param_parse.y" {set_map_range(yyvsp[-3].string,yyvsp[-2].rvalue,yyvsp[0].rvalue,X_PAT); free(yyvsp[-3].string); } break; case 70: #line 217 "param_parse.y" {set_map_range(yyvsp[-3].string,yyvsp[-2].rvalue,yyvsp[0].rvalue,X_MAT); free(yyvsp[-3].string); } break; case 71: #line 218 "param_parse.y" {set_map_range(0,yyvsp[0].rvalue,yyvsp[0].rvalue,-1);} break; case 72: #line 219 "param_parse.y" {set_map_range(0,yyvsp[-2].rvalue,yyvsp[0].rvalue,-2);} break; case 73: #line 220 "param_parse.y" {set_map_range(0,yyvsp[0].rvalue,yyvsp[0].rvalue,X_PAT);} break; case 74: #line 221 "param_parse.y" {set_map_range(0,yyvsp[0].rvalue,yyvsp[0].rvalue,X_MAT);} break; case 75: #line 222 "param_parse.y" {set_map_range(0,yyvsp[0].rvalue,yyvsp[0].rvalue,-1);} break; case 76: #line 223 "param_parse.y" {set_map_range(0,yyvsp[-2].rvalue,yyvsp[0].rvalue,-2);} break; case 77: #line 224 "param_parse.y" {set_map_range(0,yyvsp[0].rvalue,yyvsp[0].rvalue,X_PAT);} break; case 78: #line 225 "param_parse.y" {set_map_range(0,yyvsp[0].rvalue,yyvsp[0].rvalue,X_MAT);} break; case 79: #line 226 "param_parse.y" {map_function=MAP_HALDANE;} break; case 80: #line 227 "param_parse.y" {map_function=MAP_KOSAMBI;} break; case 81: #line 230 "param_parse.y" {set_tloci(-1,yyvsp[0].value);} break; case 82: #line 231 "param_parse.y" {set_tloci(-2,yyvsp[0].value);} break; case 83: #line 232 "param_parse.y" {set_tloci(yyvsp[-2].value,yyvsp[0].value);} break; case 84: #line 233 "param_parse.y" {tloci_mean=yyvsp[0].rvalue; tloci_mean_set=1;} break; case 85: #line 236 "param_parse.y" { num_iter=yyvsp[0].value; } break; case 86: #line 238 "param_parse.y" {sample_freq[0]=sample_freq[1]=yyvsp[0].value;} break; case 87: #line 239 "param_parse.y" {sample_freq[0]=yyvsp[-2].value; sample_freq[1]=yyvsp[0].value;} break; case 88: #line 240 "param_parse.y" {if(Freqfile) free(Freqfile); Freqfile=yyvsp[0].string;} break; case 89: #line 241 "param_parse.y" {sample_freq[0]=sample_freq[1]=yyvsp[0].value;} break; case 90: #line 242 "param_parse.y" {sample_freq[0]=yyvsp[-2].value; sample_freq[1]=yyvsp[0].value;} break; case 91: #line 243 "param_parse.y" {Output_Phen=yyvsp[0].string; } break; case 92: #line 244 "param_parse.y" {set_output_gen(yyvsp[0].string,0);} break; case 93: #line 245 "param_parse.y" {set_output_gen(yyvsp[-2].string,yyvsp[0].string); free(yyvsp[0].string); } break; case 95: #line 247 "param_parse.y" {output_type=yyvsp[0].value;} break; case 96: #line 248 "param_parse.y" {if(Outputfile) free(Outputfile); Outputfile=yyvsp[0].string;} break; case 97: #line 249 "param_parse.y" {if(OutputPosfile) free(OutputPosfile); OutputPosfile=yyvsp[0].string;} break; case 98: #line 250 "param_parse.y" {if(OutputIBDfile) free(OutputIBDfile); OutputIBDfile=yyvsp[0].string;} break; case 99: #line 251 "param_parse.y" {if(OutputIBDdir) free(OutputIBDdir); OutputIBDdir=yyvsp[0].string;} break; case 100: #line 252 "param_parse.y" {if(Dumpfile) free(Dumpfile); Dumpfile=yyvsp[0].string;} break; case 101: #line 253 "param_parse.y" {dump_freq=yyvsp[0].value;} break; case 102: #line 254 "param_parse.y" {output_haplo=1;if(Haplofile) free(Haplofile); Haplofile=yyvsp[0].string;} break; case 103: #line 255 "param_parse.y" {output_haplo=1;} break; case 104: #line 256 "param_parse.y" {output_recomb=1;if(Recombfile) free(Recombfile); Recombfile=yyvsp[0].string;} break; case 105: #line 257 "param_parse.y" {if(Polyfile) free(Polyfile); Polyfile=yyvsp[0].string;} break; case 106: #line 258 "param_parse.y" {set_ibd_mode(yyvsp[0].string); free(yyvsp[0].string);} break; case 107: #line 259 "param_parse.y" {set_ibd_mode(yyvsp[-2].string); free(yyvsp[-2].string); set_ibd_mode(yyvsp[0].string); free(yyvsp[0].string);} break; case 108: #line 262 "param_parse.y" { if(!check_variance(yyvsp[0].rvalue,0)) {res_var_set[0]=start_flag; residual_var[0]=yyvsp[0].rvalue;} } break; case 109: #line 263 "param_parse.y" { if(yyvsp[-1].value>=0 && !check_variance(yyvsp[0].rvalue,1)) {res_var_set[yyvsp[-1].value]=start_flag; BB(residual_var,yyvsp[-1].value,yyvsp[-1].value)=yyvsp[0].rvalue;} } break; case 110: #line 266 "param_parse.y" { if(!check_variance(yyvsp[0].rvalue,0)) residual_var_limit[0]=yyvsp[0].rvalue; } break; case 111: #line 267 "param_parse.y" { if(yyvsp[-1].value>=0 && !check_variance(yyvsp[0].rvalue,0)) residual_var_limit[yyvsp[-1].value]=yyvsp[0].rvalue; } break; case 112: #line 268 "param_parse.y" { if(!check_variance(yyvsp[0].rvalue,0)) residual_var_limit[0]=yyvsp[0].rvalue; } break; case 113: #line 269 "param_parse.y" { if(yyvsp[-1].value>=0 && !check_variance(yyvsp[0].rvalue,0)) residual_var_limit[yyvsp[-1].value]=yyvsp[0].rvalue; } break; case 114: #line 272 "param_parse.y" { if(!check_variance(yyvsp[0].rvalue,0)) {add_var_set[0]=start_flag; additive_var[0]=yyvsp[0].rvalue;} } break; case 115: #line 273 "param_parse.y" { if(yyvsp[-1].value>=0 && !check_variance(yyvsp[0].rvalue,0)) {add_var_set[yyvsp[-1].value]=start_flag; BB(additive_var,yyvsp[-1].value,yyvsp[-1].value)=yyvsp[0].rvalue;} } break; case 116: #line 276 "param_parse.y" { if(!check_variance(yyvsp[0].rvalue,0)) additive_var_limit[0]=yyvsp[0].rvalue; } break; case 117: #line 277 "param_parse.y" { if(yyvsp[-1].value>=0 && !check_variance(yyvsp[0].rvalue,0)) additive_var_limit[yyvsp[-1].value]=yyvsp[0].rvalue; } break; case 118: #line 278 "param_parse.y" { if(!check_variance(yyvsp[0].rvalue,0)) additive_var_limit[0]=yyvsp[0].rvalue; } break; case 119: #line 279 "param_parse.y" { if(yyvsp[-1].value>=0 && !check_variance(yyvsp[0].rvalue,0)) additive_var_limit[yyvsp[-1].value]=yyvsp[0].rvalue; } break; case 120: #line 282 "param_parse.y" { if(n_models>1) yyerror("Model must be specified when multiple models are present"); else {grand_mean_set[0]=start_flag; grand_mean[0]=yyvsp[0].rvalue; } } break; case 121: #line 284 "param_parse.y" { if(yyvsp[-1].value>=0) {grand_mean_set[yyvsp[-1].value]=start_flag; grand_mean[yyvsp[-1].value]=yyvsp[0].rvalue;} } break; case 122: #line 287 "param_parse.y" { set_position(yyvsp[-1].lk_var,yyvsp[0].rvalue,yyvsp[0].rvalue); } break; case 123: #line 288 "param_parse.y" { sex_map=1; set_position(yyvsp[-3].lk_var,yyvsp[-2].rvalue,yyvsp[0].rvalue); } break; case 124: #line 291 "param_parse.y" {c_flag=0;} break; case 126: #line 292 "param_parse.y" {c_flag=1;} break; case 128: #line 293 "param_parse.y" {c_flag=1;} break; case 130: #line 296 "param_parse.y" {yyval.value=find_trait(yyvsp[0].lk_var);} break; case 131: #line 298 "param_parse.y" { yyval.lk_var=find_var(yyvsp[0].string,0,0); free(yyvsp[0].string);} break; case 132: #line 299 "param_parse.y" { yyval.lk_var=find_var(yyvsp[-3].string,yyvsp[-1].value,1); free(yyvsp[-3].string);} break; case 133: #line 302 "param_parse.y" { if(yyvsp[0].lk_var) {set_output(yyvsp[0].lk_var); free(yyvsp[0].lk_var);} } break; case 134: #line 303 "param_parse.y" { if(yyvsp[0].lk_var) {set_output(yyvsp[0].lk_var); free(yyvsp[0].lk_var);} } break; case 135: #line 306 "param_parse.y" { freq_marker=check_marker(yyvsp[0].lk_var); } break; case 136: #line 308 "param_parse.y" {group_ptr=0;} break; case 137: #line 308 "param_parse.y" {if(group_var && group_ptrn_levels) print_scan_err("Line %d: Too few groups in order statement\n",lineno1);} break; case 138: #line 311 "param_parse.y" { yyval.value=find_group(yytext,yyvsp[0].value,1); } break; case 139: #line 312 "param_parse.y" { yyval.value=find_group(yytext,0,0); } break; case 140: #line 313 "param_parse.y" { yyval.value=find_group(yyvsp[0].string,0,0); free(yyvsp[0].string);} break; case 141: #line 316 "param_parse.y" {set_group_order(yyvsp[0].value);} break; case 142: #line 317 "param_parse.y" {set_group_order(yyvsp[0].value);} break; case 143: #line 320 "param_parse.y" { yyval.value=find_allele(yytext,freq_marker,yyvsp[0].value,1); } break; case 144: #line 321 "param_parse.y" { yyval.value=find_allele(yytext,freq_marker,0,0); } break; case 145: #line 322 "param_parse.y" { yyval.value=find_allele(yyvsp[0].string,freq_marker,0,0); free(yyvsp[0].string); } break; case 146: #line 325 "param_parse.y" {group_counter=0; freq_allele=yyvsp[-1].value;} break; case 147: #line 325 "param_parse.y" {if(freq_marker && group_var && group_countern_levels) print_scan_err("Line %d: Too few frequencies specified\n",lineno);} break; case 148: #line 326 "param_parse.y" {group_counter=0; freq_allele=yyvsp[-1].value;} break; case 149: #line 326 "param_parse.y" {if(freq_marker && group_var && group_countern_levels) print_scan_err("Line %d: Too few frequencies specified\n",lineno);} break; case 150: #line 329 "param_parse.y" {set_freq(freq_marker,yyvsp[0].rvalue,freq_allele);} break; case 151: #line 330 "param_parse.y" {group_counter++;} break; case 152: #line 331 "param_parse.y" {set_freq(freq_marker,yyvsp[0].rvalue,freq_allele);} break; case 153: #line 332 "param_parse.y" {group_counter++;} break; case 154: #line 335 "param_parse.y" { yyval.rlist=add_ibd_list(yyvsp[0].rvalue,0); } break; case 155: #line 336 "param_parse.y" { yyval.rlist=add_ibd_list(yyvsp[0].rvalue,yyvsp[-2].rlist); } break; case 157: #line 340 "param_parse.y" { yyval.rvalue=(double)yyvsp[0].value; } break; } #line 705 "/usr/local/share/bison/bison.simple" yyvsp -= yylen; yyssp -= yylen; #if YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; #if YYLSP_NEEDED *++yylsp = yyloc; #endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { YYSIZE_T yysize = 0; char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* defined (YYERROR_VERBOSE) */ yyerror ("parse error"); } goto yyerrlab1; /*--------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action | `--------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; /*-------------------------------------------------------------------. | yyerrdefault -- current state does not do anything special for the | | error token. | `-------------------------------------------------------------------*/ yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ /* If its default is to accept any token, ok. Otherwise pop it. */ yyn = yydefact[yystate]; if (yyn) goto yydefault; #endif /*---------------------------------------------------------------. | yyerrpop -- pop the current state because it cannot handle the | | error token | `---------------------------------------------------------------*/ yyerrpop: if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED yylsp--; #endif #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif /*--------------. | yyerrhandle. | `--------------*/ yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; #if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; /*---------------------------------------------. | yyoverflowab -- parser overflow comes here. | `---------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 343 "param_parse.y" static int find_trait(struct lk_variable *lkv) { int i,type,mod; struct Variable *var; if(!n_models || (lkv->type!=LK_TYPE_IDVAR && lkv->type!=LK_TYPE_NONIDVAR)) { yyerror("Not a trait variable"); return -1; } for(mod=0;modvar.var) break; } if(mod==n_models) { yyerror("Not a trait variable"); mod= -1; } return mod; } static void set_analyze(char *p) { int i; char *com[]={"AFFECTED","NULL","IBD",0}; if(p) { i=0; while(com[i]) { if(!strcasecmp(com[i],p)) break; i++; } if(com[i]) analysis|=(1<=group_var->n_levels) yyerror("Too many groups - internal error?"); else group_order[group_ptr++]=gp; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_output_gen" static void set_output_gen(char *file,char *link) { int i; struct output_gen *p; if(link) { for(i=0;inext=p; Output_Gen->file=file; Output_Gen->link_group=i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_ibd_list" static struct IBD_List *add_ibd_list(double x,struct IBD_List *p) { if(!p) { if(!(p=malloc(sizeof(struct IBD_List)))) ABT_FUNC(MMsg); p->idx=0; p->size=32; if(!(p->pos=malloc(sizeof(double)*p->size))) ABT_FUNC(MMsg); } if(p->size==p->idx) { p->size*=2; if(!(p->pos=realloc(p->pos,sizeof(double)*p->size))) ABT_FUNC(MMsg); } p->pos[p->idx++]=x; return p; } static int check_link_name(char *name,int flag) { int i=0; if(name) { for(i=0;i1 && !flag) { i= -1; (void)fprintf(stderr,"Warning: linkage group not specified when number of linkage groups >1; IBD positions ignored\n"); } } return i; } static void check_previous_list(int i) { if(linkage[i].ibd_est_type) { (void)fprintf(stderr,"Warning: overwriting previous IBD settings for linkage group %s\n",linkage[i].name); if(linkage[i].ibd_list) { free(linkage[i].ibd_list->pos); free(linkage[i].ibd_list); } linkage[i].ibd_list=0; linkage[i].ibd_est_type=0; } } static void set_ibd_list(char *name,struct IBD_List *p,int type) { int i=0,k; if(type==IBD_EST_GRID) { i=-1; if(p->idx<3) (void)fprintf(stderr,"Warning: too few parameters (%d) for IBD Grid (3 required); IBD request ignored\n",p->idx); else if(p->idx>3) (void)fprintf(stderr,"Warning: too many parameters (%d) for IBD Grid (3 required); IBD request ignored\n",p->idx); else if(fabs(p->pos[2])pos[2],IBD_MIN_GRID_STEP); else { k=1+(int)(.5+(p->pos[1]-p->pos[0])/p->pos[2]); if(k>IBD_MAX_GRID) (void)fprintf(stderr,"Warning: grid evaluations requested (%d) for IBD Grid > IBD_MAX_GRID (%d) in loki_ibd.h ; IBD request ignored\n",k,IBD_MAX_GRID); else i=0; } } if(!i) i=check_link_name(name,0); if(i<0) { free(p->pos); free(p); } else { check_previous_list(i); linkage[i].ibd_list=p; linkage[i].ibd_est_type=type; } } static void set_ibd_markers(char *name) { int i; i=check_link_name(name,1); if(i>=0) { for(;itype!=LK_TYPE_MARKER) yyerror("Attempting to set frequency of a non-marker"); else mk=lkvar->var.marker; free(lkvar); return mk; } static void set_output(struct lk_variable *lkvar) { int i,j,type,mod; struct Variable *var; if(!lkvar) return; for(mod=0;modtype==LK_TYPE_MARKER && lkvar->var.marker==marker+j) { models[mod].term[i].out_flag=1; } } else if(type&(ST_TRAITLOCUS|ST_ID|ST_SIRE|ST_DAM)) continue; else { if(type&ST_CONSTANT) var=id_variable+j; else var=nonid_variable+j; if((lkvar->type==LK_TYPE_IDVAR || lkvar->type==LK_TYPE_NONIDVAR) && lkvar->var.var==var) { models[mod].term[i].out_flag=1; } } } } } static void set_map_range( char *name,double r1,double r2, int flag) { int i; double t; static char *sexstr[2]={"female","male"}; if(flag!= -1) sex_map=1; if(name) { for(i=0;in_levels; if(group_var->rec_flag==ST_STRING) { for(i=0;irecode[i].string))) return i; } else { if(!flag) { gp=strtol(p,&s,10); if(!(*s)) for(i=0;irecode[i].value) return i; } else for(i=0;irecode[i].value) return i; } yyerror("Group not found\n"); return -1; } static int find_allele( char *p, struct Marker *mk,int all, int flag) { int i,j; char *s; if(!mk) return -1; j=extra_allele_flag?mk->locus.n_alleles:mk->locus.n_alleles-1; if(mk->rec_flag==ST_STRING) { for(i=0;irecode[i].string))) return i; } else { if(!flag) { all=strtol(p,&s,10); if(!(*s)) for(i=0;irecode[i].value) return i; } else for(i=0;irecode[i].value) return i; } return -1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_var" static struct lk_variable *find_var( char *p, int idx, int flag) { int i,j=0; struct lk_variable *lkv=0; if(flag) if(idx<1) { yyerror("Illegal array index"); return 0; } for(i=0;itype=j; switch(j) { case LK_TYPE_MARKER: lkv->var.marker=marker+i; break; case LK_TYPE_LINK: lkv->var.link=linkage+i; break; case LK_TYPE_IDVAR: lkv->var.var=id_variable+i; break; case LK_TYPE_NONIDVAR: lkv->var.var=nonid_variable+i; break; } } return lkv; } static void set_freq(struct Marker *mk, double freq,int allele) { static int fg,fg1; int i=0; group_counter++; if(mk) { if(group_var) { if(!group_ptr) { if(!fg) yyerror("Genetic group order not set"); fg=1; return; } if(group_counter>group_var->n_levels) { if(!fg1) yyerror("Too many frequencies specified (only 1 per genetic group)"); fg1=1; return; } i=group_order[group_counter-1]; if(i<0) return; } if(freq<0.0) { yyerror("Invalid (negative) frequency"); return; } if(allele>=0 && freq==0.0) { yyerror("Can not set frequency of observed allele to zero\n"); return; } if(allele>=0) { mk->locus.freq[i][allele]=freq; } else { if(extra_allele_flag) { yyerror("Cannot set frequency of unknown allele\n"); return; } allele=mk->locus.n_alleles-1; mk->locus.freq[i][allele]+=freq; } mk->freq_set[i][allele]=start_flag; mk->count_flag[i]=c_flag; } fg1=0; } static void set_position(struct lk_variable *lkvar, double pos1, double pos2) { if(lkvar) { if(lkvar->type!=LK_TYPE_MARKER) { yyerror("Attempting to set position of a non-marker"); return; } lkvar->var.marker->locus.pos[X_PAT]=pos1; lkvar->var.marker->locus.pos[X_MAT]=pos2; lkvar->var.marker->pos_set=start_flag; free(lkvar); } } static int check_variance(const double v,const int fg) { if(v<=0.0) { yyerror("Variance must be positive"); return 1; } if(n_models>1 && !fg) { yyerror("Must specify which model when multiple models are present"); return 1; } return 0; } void print_scan_err(char *fmt, ...) { va_list args; va_start(args,fmt); (void)vfprintf(stderr,fmt,args); va_end(args); if((++scan_error_n)>=max_scan_errors) abt(__FILE__,__LINE__,"Too many errors - aborting\n"); } void print_scan_warn(char *fmt, ...) { va_list args; if(scan_warn_nn_levels; if(!(group_order=malloc(sizeof(int)*j))) ABT_FUNC(MMsg); break; } yyin=fptr; if((i=yyparse())) { (void)fprintf(stderr,"Error: yyparse returned error %d\n",i); scan_error_n++; } yy_cleanup(); if(group_order) free(group_order); if(start_tloci<0) start_tloci=min_tloci; else if(start_tlocimax_tloci) { (void)fprintf(stderr,"ReadParam(): Starting no. trait loci (%d) is outside set range (%d-%d)\n",start_tloci,min_tloci,max_tloci); scan_error_n++; } if(n_models>1 && output_type<2) { (void)fprintf(stderr,"ReadParam(): Ouput type %d not supported with multilpe trait loci\n",output_type); scan_error_n++; } if(!syst_var[SYST_IBD_OUTPUT].flag) { j=ibd_mode; if(compress_ibd) j|=COMPRESS_IBD; if(j) { syst_var[SYST_IBD_OUTPUT].flag=ST_INTEGER; syst_var[SYST_IBD_OUTPUT].data.value=j; } } if(scan_error_n) return 1; return 0; } loki/lokisrc/param_parse.h0100644000076500007650000000250310001741572015101 0ustar heathheath#ifndef BISON_Y_TAB_H # define BISON_Y_TAB_H #ifndef YYSTYPE typedef union { char *string; int value; double rvalue; struct IBD_List *rlist; struct lk_variable *lk_var; } yystype; # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif # define RESIDUAL 257 # define GENETIC 258 # define VARIANCE 259 # define POSITION 260 # define FREQUENCY 261 # define VIRTUAL 262 # define START 263 # define MEAN 264 # define ITERATIONS 265 # define SAMPLE 266 # define FROM 267 # define OUTPUT 268 # define MAP 269 # define TOTAL 270 # define SEED 271 # define SFILE 272 # define SEEDFILE 273 # define TRAIT 274 # define LOCI 275 # define SET 276 # define SYSTEM_VAR 277 # define TIMECOM 278 # define ESTIMATE 279 # define IBD 280 # define GROUP 281 # define ORDER 282 # define MALE 283 # define FEMALE 284 # define LIMIT 285 # define AFFECTED 286 # define PHENO 287 # define GENO 288 # define COUNTS 289 # define DUMP 290 # define TYPE 291 # define ANALYZE 292 # define NORMAL 293 # define STUDENT_T 294 # define HAPLO 295 # define INCLUDE 296 # define FUNCTION 297 # define HALDANE 298 # define KOSAMBI 299 # define RECOMB 300 # define POLYGENIC 301 # define MARKERS 302 # define GRID 303 # define COMPRESS 304 # define DIR 305 # define STRING 306 # define INTEGER 307 # define REAL 308 extern YYSTYPE yylval; #endif /* not BISON_Y_TAB_H */ loki/lokisrc/param_parse.y0100644000076500007650000006271607577336325015162 0ustar heathheath%{ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * param_parse.y: * * * * yacc source for parameter file parser. * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include #include "utils.h" #include "loki_scan.h" #include "loki_ibd.h" #include "shared_peel.h" #include "mat_utils.h" #include "loki.h" #include "ranlib.h" #include "output_recomb.h" #ifndef YYDEBUG #define YYDEBUG 0 #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 0 #endif #ifndef __GNUC__ #define __GNUC__ 0 #endif extern FILE *yyin; double *residual_var,*residual_var_limit,*additive_var,*additive_var_limit,*grand_mean,limit_time,tloci_mean; int *res_var_set,*add_var_set,*grand_mean_set,num_iter,max_tloci=16,min_tloci,sex_map,iflag; int tloci_mean_set,start_tloci=-1,dump_freq,output_type=DEFAULT_OUTPUT_TYPE,limit_timer_type; int sample_from[2]={0,0}; int sample_freq[2]={1,1}; static int start_flag=1,compress_ibd,ibd_mode; static struct Marker *freq_marker; static int check_variance(double,int); static void set_position(struct lk_variable *, double, double); static struct lk_variable *find_var(char *, int, int); static struct Marker *check_marker(struct lk_variable *); static int find_allele(char *, struct Marker *,int, int); static int find_group(char *,int, int); static int find_trait(struct lk_variable *); static void set_output_gen(char *,char *); static struct IBD_List *add_ibd_list(double,struct IBD_List *); static void set_freq(struct Marker *, double,int); static void set_map_range(char *,double,double, int); static void set_tloci(int,int); static void set_ibd_list(char *,struct IBD_List *,int); static void set_ibd_markers(char *); static void set_output(struct lk_variable *); static void set_group_order(int); static void set_analyze(char *); static void set_ibd_mode(char *); static struct Variable *group_var; static int group_ptr,*group_order,group_counter,freq_allele,c_flag; extern void yyerror(char *s),print_scan_err(char *fmt, ...); extern int yyparse(void),yylex(void),lineno,lineno1,tokenpos; extern char *yytext,linebuf[]; char *Output_Phen,*Outputfile,*Dumpfile,*Freqfile,*Haplofile,*Polyfile; char *OutputPosfile,*OutputIBDfile,*OutputIBDdir; struct output_gen *Output_Gen; static int max_scan_errors=30; static int scan_warn_n,max_scan_warnings=30; static int *ran_flag; int scan_error_n,output_haplo; struct id_data syst_var[NUM_SYSTEM_VAR]; %} %union { char *string; int value; double rvalue; struct IBD_List *rlist; struct lk_variable *lk_var; } %token RESIDUAL GENETIC VARIANCE POSITION FREQUENCY VIRTUAL %token START MEAN ITERATIONS SAMPLE FROM OUTPUT MAP TOTAL %token SEED SFILE SEEDFILE TRAIT LOCI SET SYSTEM_VAR TIMECOM %token ESTIMATE IBD GROUP ORDER MALE FEMALE LIMIT AFFECTED %token PHENO GENO COUNTS DUMP TYPE ANALYZE NORMAL STUDENT_T %token HAPLO INCLUDE FUNCTION HALDANE KOSAMBI RECOMB POLYGENIC %token MARKERS GRID COMPRESS DIR %token STRING %token INTEGER SYSTEM_VAR %token REAL %type rnum %type ibdlist %type lkvar %type allele,group,trait_var %% parmfile: {lineno1=lineno;} command1 {iflag=0;} | error {iflag=0;} | parmfile {lineno1=lineno;} command1 {iflag=0;} | parmfile error {iflag=0;} ; command1: command | command_a | START {start_flag=2;} command {start_flag=1;} ; command: resvarcommand | addvarcommand | positioncommand | frequencycommand | meancommand ; command_a: itercommand | samplecommand | outputcommand | mapcommand | seedcommand | tlocicommand | setcommand | ibdcommand | groupcommand | limitresvarcommand | limitaddvarcommand | analyzecommand | includecommand | aff_freqcommand | limit_timecommand | compresscommand ; samplecommand: SAMPLE FROM INTEGER {sample_from[0]=sample_from[1]=$3;} | SAMPLE FROM INTEGER opt_comma INTEGER {sample_from[0]=$3; sample_from[1]=$5;} | START OUTPUT INTEGER {sample_from[0]=sample_from[1]=$3;} | START OUTPUT INTEGER opt_comma INTEGER {sample_from[0]=$3; sample_from[1]=$5;} ; setcommand: SET SYSTEM_VAR INTEGER { syst_var[$2].data.value=$3; syst_var[$2].flag=ST_INTEGER; } | SET SYSTEM_VAR REAL { syst_var[$2].data.rvalue=$3; syst_var[$2].flag=ST_REAL; } | SET STRING rnum { free($2); yyerror("Unrecognized system variable"); } ; includecommand: INCLUDE {iflag=1;} STRING {include_param_file($3);} ; opt_comma: | ',' ; ibdcommand: ESTIMATE IBD STRING opt_comma ibdlist { set_ibd_list($3,$5,IBD_EST_DISCRETE); free($3);} | ESTIMATE IBD ibdlist { set_ibd_list(0,$3,IBD_EST_DISCRETE); } | ESTIMATE IBD MARKERS STRING { set_ibd_markers($4); free($4);} | ESTIMATE IBD MARKERS { set_ibd_markers(0); } | ESTIMATE IBD GRID STRING opt_comma ibdlist { set_ibd_list($4,$6,IBD_EST_GRID); free($4);} | ESTIMATE IBD GRID ibdlist { set_ibd_list(0,$4,IBD_EST_GRID); } ; compresscommand: COMPRESS IBD OUTPUT {compress_ibd=1;} | COMPRESS OUTPUT IBD {compress_ibd=1;} ; aff_freqcommand: ESTIMATE AFFECTED FREQUENCY {est_aff_freq=1;} ; analyzecom: STRING {set_analyze($1); free($1);} | AFFECTED {set_analyze("AFFECTED");} | IBD {set_analyze("IBD");} ; analyzelist: analyzecom | analyzelist ',' analyzecom ; analyzecommand: ANALYZE {analysis=0;} analyzelist ; limit_timecommand: TIMECOM LIMIT rnum {limit_time=$3,limit_timer_type=ITIMER_REAL;} | LIMIT TIMECOM rnum {limit_time=$3,limit_timer_type=ITIMER_REAL;} | LIMIT VIRTUAL TIMECOM rnum {limit_time=$4,limit_timer_type=ITIMER_VIRTUAL;} | VIRTUAL TIMECOM LIMIT rnum {limit_time=$4,limit_timer_type=ITIMER_VIRTUAL;} ; seedcommand: SEEDFILE STRING {if(Seedfile) free(Seedfile); Seedfile=$2;} | SEEDFILE STRING ',' INTEGER {if(Seedfile) free(Seedfile); Seedfile=$2; if($4) *ran_flag|=1; else *ran_flag&=~1;} | SEED SFILE STRING {if(Seedfile) free(Seedfile); Seedfile=$3;} | SEED SFILE STRING ',' INTEGER {if(Seedfile) free(Seedfile); Seedfile=$3; if($5) *ran_flag|=1; else *ran_flag&=~1;} | SEED INTEGER { if($2<0) yyerror("Seedvalue out of range"); else { init_ranf($2); *ran_flag|=2; } } ; mapcommand: MAP STRING rnum ',' rnum {set_map_range($2,$3,$5,-1); free($2);} | MALE MAP STRING rnum ',' rnum {set_map_range($3,$4,$6,X_PAT); free($3); } | FEMALE MAP STRING rnum ',' rnum {set_map_range($3,$4,$6,X_MAT); free($3); } | TOTAL MAP rnum {set_map_range(0,$3,$3,-1);} | TOTAL MAP rnum ',' rnum {set_map_range(0,$3,$5,-2);} | TOTAL MALE MAP rnum {set_map_range(0,$4,$4,X_PAT);} | TOTAL FEMALE MAP rnum {set_map_range(0,$4,$4,X_MAT);} | MAP TOTAL rnum {set_map_range(0,$3,$3,-1);} | MAP TOTAL rnum ',' rnum {set_map_range(0,$3,$5,-2);} | MALE MAP TOTAL rnum {set_map_range(0,$4,$4,X_PAT);} | FEMALE MAP TOTAL rnum {set_map_range(0,$4,$4,X_MAT);} | MAP FUNCTION HALDANE {map_function=MAP_HALDANE;} | MAP FUNCTION KOSAMBI {map_function=MAP_KOSAMBI;} ; tlocicommand: TRAIT LOCI INTEGER {set_tloci(-1,$3);} | START TRAIT LOCI INTEGER {set_tloci(-2,$4);} | TRAIT LOCI INTEGER ',' INTEGER {set_tloci($3,$5);} | TRAIT LOCI MEAN rnum {tloci_mean=$4; tloci_mean_set=1;} ; itercommand: ITERATIONS INTEGER { num_iter=$2; }; outputcommand: OUTPUT FREQUENCY INTEGER {sample_freq[0]=sample_freq[1]=$3;} | OUTPUT FREQUENCY INTEGER ',' INTEGER {sample_freq[0]=$3; sample_freq[1]=$5;} | OUTPUT FREQUENCY STRING {if(Freqfile) free(Freqfile); Freqfile=$3;} | SAMPLE FREQUENCY INTEGER {sample_freq[0]=sample_freq[1]=$3;} | SAMPLE FREQUENCY INTEGER ',' INTEGER {sample_freq[0]=$3; sample_freq[1]=$5;} | OUTPUT PHENO STRING {Output_Phen=$3; } | OUTPUT GENO STRING {set_output_gen($3,0);} | OUTPUT GENO STRING ',' STRING {set_output_gen($3,$5); free($5); } | OUTPUT lkvarlist | OUTPUT TYPE INTEGER {output_type=$3;} | OUTPUT SFILE STRING {if(Outputfile) free(Outputfile); Outputfile=$3;} | OUTPUT POSITION SFILE STRING {if(OutputPosfile) free(OutputPosfile); OutputPosfile=$4;} | OUTPUT IBD SFILE STRING {if(OutputIBDfile) free(OutputIBDfile); OutputIBDfile=$4;} | OUTPUT IBD DIR STRING {if(OutputIBDdir) free(OutputIBDdir); OutputIBDdir=$4;} | DUMP SFILE STRING {if(Dumpfile) free(Dumpfile); Dumpfile=$3;} | DUMP FREQUENCY INTEGER {dump_freq=$3;} | OUTPUT HAPLO STRING {output_haplo=1;if(Haplofile) free(Haplofile); Haplofile=$3;} | OUTPUT HAPLO {output_haplo=1;} | OUTPUT RECOMB STRING {output_recomb=1;if(Recombfile) free(Recombfile); Recombfile=$3;} | OUTPUT POLYGENIC STRING {if(Polyfile) free(Polyfile); Polyfile=$3;} | OUTPUT IBD STRING {set_ibd_mode($3); free($3);} | OUTPUT IBD STRING ',' STRING {set_ibd_mode($3); free($3); set_ibd_mode($5); free($5);} ; resvarcommand: RESIDUAL VARIANCE rnum { if(!check_variance($3,0)) {res_var_set[0]=start_flag; residual_var[0]=$3;} } | RESIDUAL VARIANCE trait_var rnum { if($3>=0 && !check_variance($4,1)) {res_var_set[$3]=start_flag; BB(residual_var,$3,$3)=$4;} } ; limitresvarcommand: RESIDUAL VARIANCE LIMIT rnum { if(!check_variance($4,0)) residual_var_limit[0]=$4; } | RESIDUAL VARIANCE LIMIT trait_var rnum { if($4>=0 && !check_variance($5,0)) residual_var_limit[$4]=$5; } | LIMIT RESIDUAL VARIANCE rnum { if(!check_variance($4,0)) residual_var_limit[0]=$4; } | LIMIT RESIDUAL VARIANCE trait_var rnum { if($4>=0 && !check_variance($5,0)) residual_var_limit[$4]=$5; } ; addvarcommand: GENETIC VARIANCE rnum { if(!check_variance($3,0)) {add_var_set[0]=start_flag; additive_var[0]=$3;} } | GENETIC VARIANCE trait_var rnum { if($3>=0 && !check_variance($4,0)) {add_var_set[$3]=start_flag; BB(additive_var,$3,$3)=$4;} } ; limitaddvarcommand: GENETIC VARIANCE LIMIT rnum { if(!check_variance($4,0)) additive_var_limit[0]=$4; } | GENETIC VARIANCE LIMIT trait_var rnum { if($4>=0 && !check_variance($5,0)) additive_var_limit[$4]=$5; } | LIMIT GENETIC VARIANCE rnum { if(!check_variance($4,0)) additive_var_limit[0]=$4; } | LIMIT GENETIC VARIANCE trait_var rnum { if($4>=0 && !check_variance($5,0)) additive_var_limit[$4]=$5; } ; meancommand: MEAN rnum { if(n_models>1) yyerror("Model must be specified when multiple models are present"); else {grand_mean_set[0]=start_flag; grand_mean[0]=$2; } } | MEAN trait_var rnum { if($2>=0) {grand_mean_set[$2]=start_flag; grand_mean[$2]=$3;} } ; positioncommand: POSITION lkvar rnum { set_position($2,$3,$3); } | POSITION lkvar rnum ',' rnum { sex_map=1; set_position($2,$3,$5); } ; frequencycommand: FREQUENCY {c_flag=0;} lkmarker freqlist | FREQUENCY {c_flag=1;} COUNTS lkmarker freqlist | COUNTS {c_flag=1;} lkmarker freqlist ; trait_var: lkvar {$$=find_trait($1);} ; lkvar: STRING { $$=find_var($1,0,0); free($1);} | STRING '(' INTEGER ')' { $$=find_var($1,$3,1); free($1);} ; lkvarlist: lkvar { if($1) {set_output($1); free($1);} } | lkvarlist ',' lkvar { if($3) {set_output($3); free($3);} } ; lkmarker: lkvar { freq_marker=check_marker($1); } ; groupcommand: GROUP ORDER {group_ptr=0;} grouplist {if(group_var && group_ptrn_levels) print_scan_err("Line %d: Too few groups in order statement\n",lineno1);} ; group: INTEGER { $$=find_group(yytext,$1,1); } | REAL { $$=find_group(yytext,0,0); } | STRING { $$=find_group($1,0,0); free($1);} ; grouplist: group {set_group_order($1);} | grouplist ',' group {set_group_order($3);} ; allele: INTEGER { $$=find_allele(yytext,freq_marker,$1,1); } | REAL { $$=find_allele(yytext,freq_marker,0,0); } | STRING { $$=find_allele($1,freq_marker,0,0); free($1); } ; freqlist: allele ',' {group_counter=0; freq_allele=$1;} freqlist1 {if(freq_marker && group_var && group_countern_levels) print_scan_err("Line %d: Too few frequencies specified\n",lineno);} | freqlist allele ',' {group_counter=0; freq_allele=$2;} freqlist1 {if(freq_marker && group_var && group_countern_levels) print_scan_err("Line %d: Too few frequencies specified\n",lineno);} ; freqlist1: rnum {set_freq(freq_marker,$1,freq_allele);} | '*' {group_counter++;} | freqlist1 ',' rnum {set_freq(freq_marker,$3,freq_allele);} | freqlist1 ',' '*' {group_counter++;} ; ibdlist: rnum { $$=add_ibd_list($1,0); } | ibdlist ',' rnum { $$=add_ibd_list($3,$1); } ; rnum: REAL | INTEGER { $$=(double)$1; } ; %% static int find_trait(struct lk_variable *lkv) { int i,type,mod; struct Variable *var; if(!n_models || (lkv->type!=LK_TYPE_IDVAR && lkv->type!=LK_TYPE_NONIDVAR)) { yyerror("Not a trait variable"); return -1; } for(mod=0;modvar.var) break; } if(mod==n_models) { yyerror("Not a trait variable"); mod= -1; } return mod; } static void set_analyze(char *p) { int i; char *com[]={"AFFECTED","NULL","IBD",0}; if(p) { i=0; while(com[i]) { if(!strcasecmp(com[i],p)) break; i++; } if(com[i]) analysis|=(1<=group_var->n_levels) yyerror("Too many groups - internal error?"); else group_order[group_ptr++]=gp; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_output_gen" static void set_output_gen(char *file,char *link) { int i; struct output_gen *p; if(link) { for(i=0;inext=p; Output_Gen->file=file; Output_Gen->link_group=i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_ibd_list" static struct IBD_List *add_ibd_list(double x,struct IBD_List *p) { if(!p) { if(!(p=malloc(sizeof(struct IBD_List)))) ABT_FUNC(MMsg); p->idx=0; p->size=32; if(!(p->pos=malloc(sizeof(double)*p->size))) ABT_FUNC(MMsg); } if(p->size==p->idx) { p->size*=2; if(!(p->pos=realloc(p->pos,sizeof(double)*p->size))) ABT_FUNC(MMsg); } p->pos[p->idx++]=x; return p; } static int check_link_name(char *name,int flag) { int i=0; if(name) { for(i=0;i1 && !flag) { i= -1; (void)fprintf(stderr,"Warning: linkage group not specified when number of linkage groups >1; IBD positions ignored\n"); } } return i; } static void check_previous_list(int i) { if(linkage[i].ibd_est_type) { (void)fprintf(stderr,"Warning: overwriting previous IBD settings for linkage group %s\n",linkage[i].name); if(linkage[i].ibd_list) { free(linkage[i].ibd_list->pos); free(linkage[i].ibd_list); } linkage[i].ibd_list=0; linkage[i].ibd_est_type=0; } } static void set_ibd_list(char *name,struct IBD_List *p,int type) { int i=0,k; if(type==IBD_EST_GRID) { i=-1; if(p->idx<3) (void)fprintf(stderr,"Warning: too few parameters (%d) for IBD Grid (3 required); IBD request ignored\n",p->idx); else if(p->idx>3) (void)fprintf(stderr,"Warning: too many parameters (%d) for IBD Grid (3 required); IBD request ignored\n",p->idx); else if(fabs(p->pos[2])pos[2],IBD_MIN_GRID_STEP); else { k=1+(int)(.5+(p->pos[1]-p->pos[0])/p->pos[2]); if(k>IBD_MAX_GRID) (void)fprintf(stderr,"Warning: grid evaluations requested (%d) for IBD Grid > IBD_MAX_GRID (%d) in loki_ibd.h ; IBD request ignored\n",k,IBD_MAX_GRID); else i=0; } } if(!i) i=check_link_name(name,0); if(i<0) { free(p->pos); free(p); } else { check_previous_list(i); linkage[i].ibd_list=p; linkage[i].ibd_est_type=type; } } static void set_ibd_markers(char *name) { int i; i=check_link_name(name,1); if(i>=0) { for(;itype!=LK_TYPE_MARKER) yyerror("Attempting to set frequency of a non-marker"); else mk=lkvar->var.marker; free(lkvar); return mk; } static void set_output(struct lk_variable *lkvar) { int i,j,type,mod; struct Variable *var; if(!lkvar) return; for(mod=0;modtype==LK_TYPE_MARKER && lkvar->var.marker==marker+j) { models[mod].term[i].out_flag=1; } } else if(type&(ST_TRAITLOCUS|ST_ID|ST_SIRE|ST_DAM)) continue; else { if(type&ST_CONSTANT) var=id_variable+j; else var=nonid_variable+j; if((lkvar->type==LK_TYPE_IDVAR || lkvar->type==LK_TYPE_NONIDVAR) && lkvar->var.var==var) { models[mod].term[i].out_flag=1; } } } } } static void set_map_range( char *name,double r1,double r2, int flag) { int i; double t; static char *sexstr[2]={"female","male"}; if(flag!= -1) sex_map=1; if(name) { for(i=0;in_levels; if(group_var->rec_flag==ST_STRING) { for(i=0;irecode[i].string))) return i; } else { if(!flag) { gp=strtol(p,&s,10); if(!(*s)) for(i=0;irecode[i].value) return i; } else for(i=0;irecode[i].value) return i; } yyerror("Group not found\n"); return -1; } static int find_allele( char *p, struct Marker *mk,int all, int flag) { int i,j; char *s; if(!mk) return -1; j=extra_allele_flag?mk->locus.n_alleles:mk->locus.n_alleles-1; if(mk->rec_flag==ST_STRING) { for(i=0;irecode[i].string))) return i; } else { if(!flag) { all=strtol(p,&s,10); if(!(*s)) for(i=0;irecode[i].value) return i; } else for(i=0;irecode[i].value) return i; } return -1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_var" static struct lk_variable *find_var( char *p, int idx, int flag) { int i,j=0; struct lk_variable *lkv=0; if(flag) if(idx<1) { yyerror("Illegal array index"); return 0; } for(i=0;itype=j; switch(j) { case LK_TYPE_MARKER: lkv->var.marker=marker+i; break; case LK_TYPE_LINK: lkv->var.link=linkage+i; break; case LK_TYPE_IDVAR: lkv->var.var=id_variable+i; break; case LK_TYPE_NONIDVAR: lkv->var.var=nonid_variable+i; break; } } return lkv; } static void set_freq(struct Marker *mk, double freq,int allele) { static int fg,fg1; int i=0; group_counter++; if(mk) { if(group_var) { if(!group_ptr) { if(!fg) yyerror("Genetic group order not set"); fg=1; return; } if(group_counter>group_var->n_levels) { if(!fg1) yyerror("Too many frequencies specified (only 1 per genetic group)"); fg1=1; return; } i=group_order[group_counter-1]; if(i<0) return; } if(freq<0.0) { yyerror("Invalid (negative) frequency"); return; } if(allele>=0 && freq==0.0) { yyerror("Can not set frequency of observed allele to zero\n"); return; } if(allele>=0) { mk->locus.freq[i][allele]=freq; } else { if(extra_allele_flag) { yyerror("Cannot set frequency of unknown allele\n"); return; } allele=mk->locus.n_alleles-1; mk->locus.freq[i][allele]+=freq; } mk->freq_set[i][allele]=start_flag; mk->count_flag[i]=c_flag; } fg1=0; } static void set_position(struct lk_variable *lkvar, double pos1, double pos2) { if(lkvar) { if(lkvar->type!=LK_TYPE_MARKER) { yyerror("Attempting to set position of a non-marker"); return; } lkvar->var.marker->locus.pos[X_PAT]=pos1; lkvar->var.marker->locus.pos[X_MAT]=pos2; lkvar->var.marker->pos_set=start_flag; free(lkvar); } } static int check_variance(const double v,const int fg) { if(v<=0.0) { yyerror("Variance must be positive"); return 1; } if(n_models>1 && !fg) { yyerror("Must specify which model when multiple models are present"); return 1; } return 0; } void print_scan_err(char *fmt, ...) { va_list args; va_start(args,fmt); (void)vfprintf(stderr,fmt,args); va_end(args); if((++scan_error_n)>=max_scan_errors) abt(__FILE__,__LINE__,"Too many errors - aborting\n"); } void print_scan_warn(char *fmt, ...) { va_list args; if(scan_warn_nn_levels; if(!(group_order=malloc(sizeof(int)*j))) ABT_FUNC(MMsg); break; } yyin=fptr; if((i=yyparse())) { (void)fprintf(stderr,"Error: yyparse returned error %d\n",i); scan_error_n++; } yy_cleanup(); if(group_order) free(group_order); if(start_tloci<0) start_tloci=min_tloci; else if(start_tlocimax_tloci) { (void)fprintf(stderr,"ReadParam(): Starting no. trait loci (%d) is outside set range (%d-%d)\n",start_tloci,min_tloci,max_tloci); scan_error_n++; } if(n_models>1 && output_type<2) { (void)fprintf(stderr,"ReadParam(): Ouput type %d not supported with multilpe trait loci\n",output_type); scan_error_n++; } if(!syst_var[SYST_IBD_OUTPUT].flag) { j=ibd_mode; if(compress_ibd) j|=COMPRESS_IBD; if(j) { syst_var[SYST_IBD_OUTPUT].flag=ST_INTEGER; syst_var[SYST_IBD_OUTPUT].data.value=j; } } if(scan_error_n) return 1; return 0; } loki/lokisrc/pass_founder_genes.c0100644000076500007650000002704610001741567016470 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * July 2001 * * * * pass_founder_genes.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "seg_pen.h" static struct cg_stack *stack; static int stack_size=256; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "pass_founder_genes" void pass_founder_genes(const int locus) { int i,i1,j,s,**genes,**seg,comp,cs,nc,locus1; struct Locus *loc; loc=locus>=0?&marker[locus].locus:&tlocus[-1-locus].locus; if(locus<0) { loc=&tlocus[-1-locus].locus; locus1=n_markers+1; } else { loc=&marker[locus].locus; locus1=locus; } genes=loc->genes; seg=loc->seg; nc=singleton_flag?n_comp-1:n_comp; for(i=comp=0;comp=0) { genes[X_PAT][i]=genes[s][id_array[i].sire-1]; } else { #ifdef DEBUG if(id_array[i].sire) { ABT_FUNC("Internal error - not a founder\n"); } #endif genes[X_PAT][i]= ++j; } s=seg[X_MAT][i]; if(s<-1) ABT_FUNC("Shouldn't happen!\n"); if(s>=0) { genes[X_MAT][i]=genes[s][id_array[i].dam-1]; } else { #ifdef DEBUG if(id_array[i].dam) { ABT_FUNC("Internal error - not a founder\n"); } #endif genes[X_MAT][i]= ++j; } } #ifdef DEBUG if(j>comp_ngenes[comp]) { ABT_FUNC("Mismatch in founder gene number\n"); } #endif } if(singleton_flag) { cs=comp_size[comp]; for(i1=j=0;i1=0) { loc=&marker[locus].locus; hap=marker[locus].haplo; if(marker[locus].mterm && marker[locus].mterm[0]) locus_type=1; else locus_type=0; genes=loc->genes; seg=loc->seg; g=genes[par_flag][i]; genes[par_flag][i]=genes[seg[par_flag][i]][par]; if(genes[par_flag][i]!=g) { if(hap[i] || (locus_type && id_array[i].res[0])) fg=1; if(id_array[i].nkids) { for(;;) { k=id_array[i].sex==1?X_PAT:X_MAT; k1=0; for(;jgenes; seg=loc->seg; g=genes[par_flag][i]; genes[par_flag][i]=genes[seg[par_flag][i]][par]; if(genes[par_flag][i]!=g) { if(id_array[i].res[0]) fg=1; if(id_array[i].nkids) { for(;;) { k=id_array[i].sex==1?X_PAT:X_MAT; k1=0; for(;j=0) { loc=&marker[locus].locus; if(marker[locus].mterm && marker[locus].mterm[0]) locus_type=1; else locus_type=0; genes=loc->genes; seg=loc->seg; hap=marker[locus].haplo; for(j1=0;j1genes; seg=loc->seg; for(j1=0;j1=0) { loc=&marker[locus].locus; if(marker[locus].mterm && marker[locus].mterm[0]) locus_type=1; else locus_type=0; genes=loc->genes; seg=loc->seg; hap=marker[locus].haplo; for(j1=0;j1genes; seg=loc->seg; for(j1=0;j1=0) { genes[X_PAT][i]=genes[s][id_array[i].sire-1]; } else genes[X_PAT][i]= ++j; s=seg[X_MAT][i]; if(s>=0) { genes[X_MAT][i]=genes[s][id_array[i].dam-1]; } else genes[X_MAT][i]= ++j; if(k) { for(s=0;s<2;s++) if(genes[s][i]!=g[s]) { fg=1; break; } } } return fg; } loki/lokisrc/peel_to_par.c0100644000076500007650000001016710001741567015104 0ustar heathheath#include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "peel_to_par" /* This is when all (non-pruned) children in a family have completely determined genotypes * so we can peel to the 2 parents separately */ double peel_to_par(const struct Simple_Element *element,const int locus,pen_func pen, lk_ulong **a_set,struct R_Func *rf,struct peel_mem *work) { int ids,idd,i,j,k,l,m,n,fsp=0,fsp1=0,n_off,*off,kid,*all,n_all,n_bits,n_idx,comp; double prob=0.0,*tpp,p1,pp[2],qp,*qval,*mval,*pval; lk_ulong a,cm[2]; struct fset *peel_fs; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL_1)) (void)printf("In %s(%p,%d,%p)\n",FUNC_NAME,(void *)element,locus,(void *)pen); #endif ids=element->sire-1; idd=element->dam-1; comp=id_array[ids].comp; if(id_array[ids].ngens>id_array[idd].ngens) i=id_array[ids].ngens; else i=id_array[idd].ngens; off=element->off; n_off=element->n_off; n_all=marker[locus].n_all1[comp]; n_bits=num_bits(n_all); n_idx=1<<(n_bits+n_bits); qval=work->s2; pval=qval+n_idx; mval=pval+n_idx; peel_fs=work->s0; /* Construct set of possible parental genotypes */ for(j=0;j=0) { /* Insert Previously computed R_Func */ l=(1<>n_bits; pval[i]=rf[k].p[j]; } } else for(i=0;i=0) { /* Insert Previously computed R_Func */ l=(1<>n_bits; mval[i]=rf[k].p[j]; } } else for(i=0;i=0) ABT_FUNC("Internal error - no R-Functions expected for this operation\n"); if(id_array[kid].ngens>1) ABT_FUNC("Internal error - offspring genotypes should be determined for this operation\n"); all=id_array[kid].allele; for(k=0;kout_index; rf[k].n_ind=2; rf[k].n_terms=fsp; get_rf_memory(rf+k,fsp,MRK_MBLOCK); get_rf_memory(rf+k+1,fsp1,MRK_MBLOCK); for(n=0;n0.0?pval[l]/pp[X_PAT]:0.0; } id_array[ids].rfp=k++; rf[k].n_ind=2; rf[k].n_terms=fsp1; for(n=0;n0.0?mval[l]/pp[X_MAT]:0.0; } id_array[idd].rfp=k; return prob; } loki/lokisrc/print_data.c0100644000076500007650000001731710001741567014744 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * August 2000 * * * * print_data.c: * * * * Auxillary routines for writing out coded data * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "version.h" #include "print_data.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Print_Data" void Print_Data(const char *filename,loki_time *lt) { int i,k,k1,k2,rec,nrec,type; struct id_data *data; struct Variable *var; double x; FILE *fptr; char *s; if(!(fptr=fopen(filename,"w"))) { (void)fprintf(stderr,"Couldn't open output file '%s': ",filename); perror(0); return; } for(i=0;i>16); else (void)fputs("* * ",fptr); } else { data=0; if(type&ST_CONSTANT) { if(id_array[i].data) data=id_array[i].data+k1; } else if(id_array[i].data1) data=id_array[i].data1[rec]+k1; if(!data || !data->flag) (void)fputs("* ",fptr); else { if(type&ST_FACTOR) { k2=(int)data->data.value; (void)fprintf(fptr,"%d ",k2); } else { if(data->flag&ST_INTTYPE) x=(double)data->data.value; else x=data->data.rvalue; (void)fprintf(fptr,"%g ",x); } } } } if(id_array[i].res[0]) { type=models[0].var.type; k1=models[0].var.var_index; if(type&ST_CONSTANT) data=id_array[i].data+k1; else data=id_array[i].data1[rec]+k1; if(type&ST_FACTOR) { k2=(int)data->data.value; (void)fprintf(fptr,"%d\n",k2); } else { if(data->flag&ST_INTTYPE) x=(double)data->data.value; else x=data->data.rvalue; (void)fprintf(fptr,"%g\n",x); } } else (void)fputs("*\n",fptr); } } (void)fclose(fptr); if(!(s=malloc(strlen(filename)+5))) ABT_FUNC(MMsg); (void)sprintf(s,"%s_idx",filename); if(!(fptr=fopen(s,"w"))) { (void)fprintf(stderr,"Couldn't open output index file '%s': ",s); perror(0); } else { (void)(void)fputs("******************* Phenotype Data **********************\n\n",fptr); (void)fprintf(fptr," %s: %s",LOKI_NAME,ctime(<->start_time)); (void)fputs("\n\n 1 component\n 2 id\n 3 father\n 4 mother\n 5 sex\n",fptr); i=5; for(k=0;kname); if(var->index) (void)fprintf(fptr,"(%d)",var->index); } (void)fputc('\n',fptr); } type=models[0].var.type; k1=models[0].var.var_index; if(type&ST_CONSTANT) var=id_variable+k1; else var=nonid_variable+k1; (void)fprintf(fptr," %3d %s",++i,var->name); if(var->index) (void)fprintf(fptr,"(%d)",var->index); (void)fputc('\n',fptr); (void)fclose(fptr); } free(s); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Print_Genotypes" void Print_Genotypes(const struct output_gen *og,loki_time *lt) { int i,j,k,k1,k2,l,*perm; FILE *fptr; char *s; if(!n_markers) return; if(!(perm=malloc(sizeof(int)*n_markers))) ABT_FUNC(MMsg); if(!(fptr=fopen(og->file,"w"))) { (void)fprintf(stderr,"Couldn't open output file '%s': ",og->file); perror(0); return; } for(j=0;jlink_group) i=k=og->link_group-1; else { i=0; k=n_links-1; } for(;i<=k;i++) if(linkage[i].n_markers) { for(k1=0;k1k) continue; if(family_id) { print_orig_family(fptr,j+1,0); (void)fputc(' ',fptr); } print_orig_id1(fptr,j+1); (void)fputc(' ',fptr); if(og->link_group) i=k=og->link_group-1; else { i=0; k=n_links-1; } for(;i<=k;i++) if(linkage[i].n_markers) { for(k1=0;k1>16,marker[k2].haplo[j]&65535); } } (void)fputc('\n',fptr); } (void)fclose(fptr); if(!(s=malloc(strlen(og->file)+5))) ABT_FUNC(MMsg); (void)sprintf(s,"%s_idx",og->file); if(!(fptr=fopen(s,"w"))) { (void)fprintf(stderr,"Couldn't open output index file '%s': ",s); perror(0); } else { (void)(void)fputs("******************** Genotype Data **********************\n\n",fptr); (void)fprintf(fptr," %s: %s",LOKI_NAME,ctime(<->start_time)); if(og->link_group) (void)fprintf(fptr,"\n Linkage group '%s'\n",linkage[og->link_group-1].name); (void)fputs("\n 1 id\n",fptr); if(og->link_group) i=k=og->link_group-1; else { i=0; k=n_links-1; } j=2; for(;i<=k;i++) if(linkage[i].n_markers) { for(k1=0;k1link_group) i=k=og->link_group-1; else i=0; for(;i<=k;i++) if(linkage[i].n_markers) { for(k1=0;k1 #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include #include #include "utils.h" #include "libhdr.h" #include "loki.h" #include "sparse.h" #include "loki_peel.h" int ped_size,n_markers,n_links,n_id_records,n_nonid_records,polygenic_flag,num_recs,max_peel_off,comp_sflag; int *comp_start,*comp_size,*comp_ngenes,n_comp,***allele_trans,*comp_npeel,extra_allele_flag,tlocus_flag; int family_id,n_orig_families,n_models,**founder_flag; double total_maplength[2]={-1.0,-1.0}; lk_ulong ***all_set,**req_set[2]; struct Peelseq_Head **peelseq_head; struct R_Func ***r_func; struct Id_Record *id_array; struct Id_Recode id_recode,fam_recode; struct Marker *marker; struct Link *linkage; struct Variable *id_variable,*nonid_variable; struct Model *models; struct SparseMatRec **AIMatrix; #define BFE(a,b) BinFileError(__FILE__,__LINE__,a,b) static void BinFileError(const char *sfile,const int line,const char *file,const char *s) { (void)fprintf(stderr,"[%s:%d] Error reading from file '%s'\n",sfile,line,file); if(s) (void)fprintf(stderr,"%s\n",s); if(errno) perror("loki"); from_abt=1; exit(EXIT_FAILURE); } static int Check_Var(struct Model_Var *var) { int er=0; if(var->var_index<0) er=1; else if(!(var->type&(ST_ID|ST_SIRE|ST_DAM|ST_TRAITLOCUS))) { if(var->type&ST_MARKER) { if(var->var_index>=n_markers) er=1; } else if(var->type&ST_CONSTANT) { if(var->var_index>=n_id_records) er=1; } else if(var->var_index>=n_nonid_records) er=1; } return er; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "open_readfile_and_check" static FILE *open_readfile_and_check(char *fname) { int i; FILE *fptr; errno=0; if(Filter) { i=child_open(READ,fname,Filter); if(!(fptr=fdopen(i,"r"))) BFE(fname,"Couldn't fdopen() stream"); if(errno && errno!=ESPIPE) BFE(fname,0); errno=0; } else if(!(fptr=fopen(fname,"r"))) abt(__FILE__,__LINE__,"%s(): File Error. Couldn't open '%s' for reading\n",FUNC_NAME,fname); return fptr; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "fget_line" char *fget_line(FILE *fptr) { static char *p; static int buf_size=256; int i=0; if(!fptr) { if(p) free(p); p=0; return 0; } if(!p) if(!(p=malloc((size_t)buf_size))) ABT_FUNC(MMsg); while(fgets(p+i,buf_size-i,fptr)) { i=(int)strlen(p); if((i && p[i-1]=='\n')||feof(fptr)) break; buf_size*=2; if(!(p=realloc(p,(size_t)buf_size))) ABT_FUNC(MMsg); } if(!i) return 0; return p; } int get_str(char *p,char **p1,char c) { int i=0; *p1=p; while(**p1) { if(**p1==c) break; i++; (*p1)++; } return i; } char *read_id_data(struct id_data *s,char *p) { char *p1; if(*p++!=';') return 0; s->flag=strtol(p,&p1,16); p=p1+1; if(*p1=='I') s->data.value=strtol(p,&p1,16); else if(*p1=='R') (void)txt_get_double(p,&p1,&s->data.rvalue); return p1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "ReadBinFiles" void ReadBinFiles(char **lfile,int eflag) { int i,j,k,k1,k2,k3,k4,a,a1,a2,*hapdata=0,comp,n_all,*mtmp; int v2[13],num_recs; lk_ulong *tl; unsigned int t_int; double **td1,*td2; char *fname,*tmp,*tmp1,*tmp2; struct id_data *iddata=0,**iddata_p=0; struct Model_Var *mvtmp; struct Peelseq_Head *pp=0; struct Simple_Element *simple_em; struct Complex_Element *complex_em; struct Locus *loc; void *tvp; union arg_type *rtmp=0; FILE *fptr; char *EMsg[]={ "Bad format", "Bad magic number", "File corrupt", "Unexpected end of file", }; signal(SIGCHLD,SIG_IGN); errno=0; fname=make_file_name(".opt"); if(!(fptr=fopen(fname,"r"))) abt(__FILE__,__LINE__,"%s(): File Error. Couldn't open '%s' for reading\n",FUNC_NAME,fname); (void)printf("Reading from %s\n",fname); if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); if(strncmp(tmp,"Loki.opt:",9)) BFE(fname,EMsg[0]); RunID=strtoul(tmp+9,&tmp1,16); if(*tmp1++!=',') BFE(fname,EMsg[2]); i=get_str(tmp1,&tmp,','); if(*tmp++!=',') BFE(fname,EMsg[2]); if(i) { if(!(*lfile=malloc((size_t)i+1))) ABT_FUNC(MMsg); (void)strncpy(*lfile,tmp1,(size_t)i); (*lfile)[i]=0; } i=get_str(tmp,&tmp1,'\n'); if(*tmp1++!='\n') BFE(fname,EMsg[2]); if(i) { if(!(Filter=malloc((size_t)i+1))) ABT_FUNC(MMsg); (void)strncpy(Filter,tmp,(size_t)i); Filter[i]=0; } if(fclose(fptr)) BFE(fname,0); free(fname); fname=make_file_name(".dat"); fptr=open_readfile_and_check(fname); (void)printf("Reading from %s\n",fname); if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); if(strncmp(tmp,"Loki.dat:",9)) BFE(fname,EMsg[0]); t_int=strtoul(tmp+9,&tmp1,16); if(t_int!=RunID) BFE(fname,"Binary files are from mixed runs"); for(i=0;i<13;i++) { if(*tmp1++!=',') BFE(fname,EMsg[2]); if(*tmp1=='-') v2[i]=-(int)strtol(tmp1+1,&tmp,16); else v2[i]=(int)strtol(tmp1,&tmp,16); tmp1=tmp; } if(*tmp1++!='\n') BFE(fname,EMsg[2]); ped_size=v2[0]; n_comp=v2[1]; if(n_comp<0) { n_comp=-n_comp; comp_sflag=1; } n_markers=v2[2]; n_links=v2[3]; n_id_records=v2[4]; n_nonid_records=v2[5]; polygenic_flag=v2[6]&1; family_id=v2[6]&2?1:0; num_recs=v2[8]; tlocus_flag=v2[10]; n_genetic_groups=v2[11]; n_models=v2[12]; if(v2[11]<0 || v2[7]<0 || ped_size<1 || n_comp<1 || (n_markers && n_links<1)) BFE(fname,EMsg[2]); if(v2[7]) { if(!(iddata=malloc(sizeof(struct id_data)*v2[7]))) ABT_FUNC(MMsg); RemBlock=AddRemem(iddata,RemBlock); } if(num_recs) { if(!(iddata_p=malloc(sizeof(void *)*num_recs))) ABT_FUNC(MMsg); RemBlock=AddRemem(iddata_p,RemBlock); } if(n_markers) { if(!(hapdata=malloc(sizeof(int)*ped_size*n_markers))) ABT_FUNC(MMsg); RemBlock=AddRemem(hapdata,RemBlock); } if(!(comp_size=malloc(sizeof(int)*n_comp*3))) ABT_FUNC(MMsg); comp_ngenes=comp_size+n_comp; comp_start=comp_ngenes+n_comp; if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); for(i=0;igt=0; marker[i].haplo=hapdata; hapdata+=ped_size; loc->variance=0; loc->seg[0]=0; marker[i].mterm=0; } } for(k=k1=j=0;j1?7:6; if(family_id) k2++; for(i=0;iped_size || v2[1]>ped_size) BFE(fname,EMsg[2]); id_array[j].sire=v2[0]; id_array[j].dam=v2[1]; if(family_id) { id_array[j].fam_code=v2[2]; if(v2[2]>n_orig_families) n_orig_families=v2[2]; } id_array[j].sex=v2[4+family_id]; id_array[j].affected=v2[5+family_id]; id_array[j].group=n_genetic_groups>1?v2[6+family_id]:1; k2=v2[2+family_id]; id_array[j].n_rec=k2; if(k2>1) multiple_rec=1; if(v2[3+family_id]&2) { k2=n_genetic_groups>1?1:0; if(n_id_records-k2) { for(i=0;ik2) { k4=k3; k3=k2; k2=k4; } marker[i].haplo[j]=(k2<<16)|k3; } } else for(i=0;i=k1) BFE(fname,EMsg[0]); tmp[k2++]='\0'; } } else { fam_recode.flag=ST_INTEGER; for(j=0;j=k) BFE(fname,EMsg[0]); } else id_recode.recode[j].string=0; tmp[k1++]='\0'; } } else { id_recode.flag=ST_INTEGER; for(j=0;j=k) BFE(fname,EMsg[0]); tmp2[k2++]='\0'; } } if(n_markers) { if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); if(strncmp(tmp,"LKMK:",5)) BFE(fname,EMsg[0]); k=(int)strtol(tmp+5,&tmp1,16); if(*tmp1++!=',') BFE(fname,EMsg[2]); k1=(int)strtol(tmp1,&tmp,16); if(k<1 || k1<0) BFE(fname,EMsg[2]); if(n_models) { if(!(marker[0].mterm=malloc(sizeof(void *)*n_markers*n_models))) ABT_FUNC(MMsg); for(i=0;iflag=0; marker[j].name=tmp2+k2; while(k2=k) BFE(fname,EMsg[0]); tmp2[k2++]='\0'; if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); marker[j].index=(int)strtol(tmp,&tmp1,16); tmp=tmp1; if(n_links>1) { if(*tmp++!=',') BFE(fname,EMsg[2]); loc->link_group=(int)strtol(tmp,&tmp1,16); tmp=tmp1; } else loc->link_group=0; if(loc->link_group<0 || loc->link_group>=n_links) BFE(fname,EMsg[2]); linkage[loc->link_group].n_markers++; if(*tmp++!=',') BFE(fname,EMsg[2]); loc->n_alleles=(int)strtol(tmp,&tmp1,16); tmp=tmp1; if(!loc->n_alleles) { if(*tmp!='\n') BFE(fname,EMsg[2]); marker[j].rec_flag=0; marker[j].recode=0; continue; } marker[j].recode=rtmp+k3; k3+=loc->n_alleles; if(k3>k1) BFE(fname,EMsg[0]); if(*tmp++!=',') BFE(fname,EMsg[2]); a=(int)strtol(tmp,&tmp1,16); if(*tmp1!='\n') BFE(fname,EMsg[2]); if(a) { if(!(tmp1=malloc((size_t)a))) ABT_FUNC(MMsg); RemBlock=AddRemem(tmp1,RemBlock); marker[j].rec_flag=ST_STRING; if(fread(tmp1,1,(size_t)a,fptr)!=(size_t)a) BFE(fname,EMsg[3]); for(a1=a2=0;a1n_alleles;a1++) { marker[j].recode[a1].string=tmp1+a2; while(a2=a) BFE(fname,EMsg[0]); tmp1[a2++]='\0'; } } else { marker[j].rec_flag=ST_INTEGER; for(a1=0;a1n_alleles;a1++) { if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); marker[j].recode[a1].value=(int)strtol(tmp,&tmp1,16); if(*tmp1!='\n') BFE(fname,EMsg[2]); } } } for(k1=k2=0,j=0;jn_markers) BFE(fname,EMsg[0]); linkage[j].n_markers=0; } for(j=0;jlink_group].mk_index[linkage[loc->link_group].n_markers++]=j; } } if(n_id_records) { if(!(id_variable=malloc(sizeof(struct Variable)*(n_id_records+n_nonid_records)))) ABT_FUNC(MMsg); if(n_nonid_records) nonid_variable=id_variable+n_id_records; if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); if(strncmp(tmp,"LKIR:",5)) BFE(fname,EMsg[0]); k=(int)strtol(tmp+5,&tmp1,16); if(*tmp1++!=',' || !k) BFE(fname,EMsg[2]); k1=(int)strtol(tmp1,&tmp,16); if(*tmp!='\n') BFE(fname,EMsg[2]); if(!(tmp2=malloc((size_t)k))) ABT_FUNC(MMsg); RemBlock=AddRemem(tmp2,RemBlock); if(k1) { if(!(rtmp=malloc(sizeof(union arg_type)*k1))) ABT_FUNC(MMsg); RemBlock=AddRemem(rtmp,RemBlock); } if(fread(tmp2,1,(size_t)k,fptr)!=(size_t)k) BFE(fname,EMsg[3]); for(k2=k3=j=0;j=k) BFE(fname,EMsg[0]); tmp2[k2++]='\0'; if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); id_variable[j].type=(int)strtol(tmp,&tmp1,16); if(*tmp1++!=',') BFE(fname,EMsg[2]); id_variable[j].index=(int)strtol(tmp1,&tmp,16); if(id_variable[j].type&ST_FACTOR) { if(*tmp++!=',') BFE(fname,EMsg[2]); id_variable[j].n_levels=(int)strtol(tmp,&tmp1,16); tmp=tmp1; if(id_variable[j].n_levels) { id_variable[j].recode=rtmp+k3; k3+=id_variable[j].n_levels; if(k3>k1) BFE(fname,EMsg[0]); if(*tmp++!=',') BFE(fname,EMsg[2]); a=(int)strtol(tmp,&tmp1,16); if(*tmp1!='\n') BFE(fname,EMsg[2]); if(a) { id_variable[j].rec_flag=ST_STRING; if(!(tmp1=malloc((size_t)a))) ABT_FUNC(MMsg); RemBlock=AddRemem(tmp1,RemBlock); if(fread(tmp1,1,(size_t)a,fptr)!=(size_t)a) BFE(fname,EMsg[3]); for(a1=a2=0;a1=a) BFE(fname,EMsg[0]); tmp1[a2++]='\0'; } } else { id_variable[j].rec_flag=ST_INTEGER; for(a1=0;a1=k) BFE(fname,EMsg[0]); tmp2[k2++]='\0'; if(!(tmp=fget_line(fptr))) BFE(fname,EMsg[3]); nonid_variable[j].type=(int)strtol(tmp,&tmp1,16); if(*tmp1++!=',') BFE(fname,EMsg[2]); nonid_variable[j].index=(int)strtol(tmp1,&tmp,16); if(nonid_variable[j].type&ST_FACTOR) { if(*tmp++!=',') BFE(fname,EMsg[2]); nonid_variable[j].n_levels=(int)strtol(tmp,&tmp1,16); tmp=tmp1; if(nonid_variable[j].n_levels) { nonid_variable[j].recode=rtmp+k3; k3+=nonid_variable[j].n_levels; if(k3>k1) BFE(fname,EMsg[0]); if(*tmp++!=',') BFE(fname,EMsg[2]); a=(int)strtol(tmp,&tmp1,16); if(*tmp1!='\n') BFE(fname,EMsg[2]); if(a) { nonid_variable[j].rec_flag=ST_STRING; if(!(tmp1=malloc((size_t)a))) ABT_FUNC(MMsg); RemBlock=AddRemem(tmp1,RemBlock); if(fread(tmp1,1,(size_t)a,fptr)!=(size_t)a) BFE(fname,EMsg[3]); for(a1=a2=0;a1=a) BFE(fname,EMsg[0]); tmp1[a2++]='\0'; } } else { nonid_variable[j].rec_flag=ST_INTEGER; for(a1=0;a1v2[0]) BFE(fname,EMsg[0]); for(j=0;jn_alleles; if(!extra_allele_flag && loc->n_alleles) loc->n_alleles++; } if(eflag) { if(n_markers) { if(!(allele_trans=malloc(sizeof(void *)*n_markers))) ABT_FUNC(MMsg); if(!(allele_trans[0]=malloc(sizeof(void *)*n_markers*n_comp))) ABT_FUNC(MMsg); for(i=1;iv2[1]) BFE(fname,EMsg[2]); if(itype=PEEL_SIMPLE; if(!(simple_em=malloc(sizeof(struct Simple_Element)))) ABT_FUNC(MMsg); pp->ptr.simple=simple_em; if(*tmp1++!=',') BFE(fname,EMsg[2]); simple_em->sire=(int)strtol(tmp1,&tmp,16); if(*tmp++!=',') BFE(fname,EMsg[2]); simple_em->dam=(int)strtol(tmp,&tmp1,16); if(*tmp1++!=',') BFE(fname,EMsg[2]); simple_em->n_off=(int)strtol(tmp1,&tmp,16); if(*tmp++!=',') BFE(fname,EMsg[2]); simple_em->pivot=(int)strtol(tmp,&tmp1,10); if(*tmp1++!=',') BFE(fname,EMsg[2]); simple_em->out_index=(int)strtol(tmp1,&tmp,10); j=simple_em->n_off; if(j<1) BFE(fname,EMsg[2]); if(j>max_peel_off) max_peel_off=j; if(!(simple_em->off=malloc(sizeof(int)*j))) ABT_FUNC(MMsg); for(k1=0;k1off[k1]=(int)strtol(tmp,&tmp1,16); tmp=tmp1; } if(simple_em->sire<0 || simple_em->dam<0 || k1next; pp->type=0; } else { pp->type=PEEL_COMPLEX; if(!(complex_em=malloc(sizeof(struct Complex_Element)))) ABT_FUNC(MMsg); pp->ptr.complex=complex_em; if(*tmp1++!=',') BFE(fname,EMsg[2]); complex_em->n_peel=(int)strtol(tmp1,&tmp,16); if(*tmp++!=',') BFE(fname,EMsg[2]); complex_em->n_involved=(int)strtol(tmp,&tmp1,16); if(*tmp1++!=',') BFE(fname,EMsg[2]); complex_em->out_index=(int)strtol(tmp1,&tmp,10); if(*tmp++!=',') BFE(fname,EMsg[2]); complex_em->n_rfuncs=(int)strtol(tmp,&tmp1,16); j=complex_em->n_involved*2+complex_em->n_rfuncs; if(!(complex_em->involved=malloc(sizeof(int)*j))) ABT_FUNC(MMsg); for(k1=0;k1n_involved;k1++) { tmp=tmp1; if(*tmp++!=',') break; complex_em->involved[k1]=(int)strtol(tmp,&tmp1,10); } for(;k1involved[k1]=(int)strtol(tmp,&tmp1,16); } j=complex_em->n_involved; complex_em->flags=complex_em->involved+j; complex_em->index=complex_em->flags+j; pp= &complex_em->next; pp->type=0; } if(*tmp1!='\n') BFE(fname,EMsg[2]); } if(*tmp1++!=',') BFE(fname,EMsg[2]); v2[0]=(int)strtol(tmp1,&tmp,16); if(*tmp!='\n') BFE(fname,EMsg[2]); if(v2[0]) { if(!(r_func[i][comp]=malloc(sizeof(struct R_Func)*v2[0]))) ABT_FUNC(MMsg); for(j=0;j0); } loki/lokisrc/read_solar_idfile.c0100644000076500007650000001706410001741567016245 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Evry * * * * October 2002 * * * * read_solar_idfile.c: * * * * Read in pedindex file from SOLAR with translations between external IDs * * and SOLAR IBDIDs * * * * Copyright (C) Simon C. Heath 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki.h" #include "read_solar_idfile.h" #define BUFSIZE 256 static struct bin_node **id_root,*fam_root; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "new_node" struct bin_node *new_node(union arg_type *p,int i) { struct bin_node *p1; struct rs_data *rs; if(!(p1=malloc(sizeof(struct bin_node)))) ABT_FUNC(MMsg); p1->left=p1->right=0; p1->balance=0; if(!(rs=malloc(sizeof(struct rs_data)))) ABT_FUNC(MMsg); rs->data=p; rs->id=i; p1->data=rs; return p1; } struct bin_node *add_node(struct bin_node *node,int flag,union arg_type *data,int id,int *bal) { int k; struct rs_data *rs; rs=node->data; if(flag==ST_STRING) k=strcmp(rs->data->string,data->string); else k=rs->data->value-data->value; if(k<0) { if(node->left) node->left=add_node(node->left,flag,data,id,bal); else { node->left=new_node(data,id); *bal=0; } if(!(*bal)) { switch(node->balance) { case -1: node=rotate_left(node); *bal=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *bal=1; } } } else if(k>0) { if(node->right) node->right=add_node(node->right,flag,data,id,bal); else { node->right=new_node(data,id); *bal=0; } if(!(*bal)) { switch(node->balance) { case -1: node->balance=0; *bal=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *bal=1; } } } else *bal=1; return node; } static int find_node(struct bin_node *node,int flag,union arg_type *data) { int i=-1,k; struct rs_data *rs; rs=node->data; if(flag==ST_STRING) k=strcmp(rs->data->string,data->string); else k=rs->data->value-data->value; if(k<0) { if(node->left) i=find_node(node->left,flag,data); } else if(k>0) { if(node->right) i=find_node(node->right,flag,data); } else i=rs->id; return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "read_solar_idfile" void read_solar_idfile(int *trans) { FILE *fptr; int i,j,k,ibdid_start,ibdid_width,famid_start,famid_width,id_start,id_width,line; char buf[BUFSIZE],buf1[BUFSIZE],*fname,*p,*p1; union arg_type data; size_t l; fputs("Making translation table from Loki IDs to Solar IDs...",stdout); fflush(stdout); for(i=0;i=54) { j=atoi(buf); p1=p=buf+25; while(*p1 && !isspace((int)*p1)) p1++; *p1=0; if(!strcmp(p,"IBDID")) { ibdid_start=i; ibdid_width=j; if(buf[53]!='I') ABT_FUNC("IBDID field not integer\n"); if(j>=BUFSIZE) ABT_FUNC("IBDID field width too large\n"); } else if(!strcmp(p,"FAMID")) { famid_start=i; famid_width=j; if(j>=BUFSIZE) ABT_FUNC("FAMID field width too large\n"); } else if(!strcmp(p,"ID")) { id_start=i; id_width=j; if(j>=BUFSIZE) ABT_FUNC("ID field width too large\n"); } i+=j; } } if(ibdid_start<0 || id_start<0) ABT_FUNC("Error reading pedindex file\n"); if(family_id) { if(famid_start<0) ABT_FUNC("No FAMID in pedindex file\n"); } else if(famid_start>=0) ABT_FUNC("Unexpected FAMID found in pedindex file\n"); fclose(fptr); if(ibdid_width+famid_width+id_width+1>=BUFSIZE) ABT_FUNC("BUFSIZE too small\n"); if(!(fptr=fopen(fname,"r"))) abt(__FILE__,__LINE__,"%s(): Couldn't open file '%s' for input\n",FUNC_NAME,fname); line=0; while(fgets(buf,BUFSIZE,fptr)) { line++; l=strlen(buf); if((l>=(size_t)(id_start+id_width))) { memcpy(buf1,buf+ibdid_start,ibdid_width); buf1[ibdid_width]=0; i=atoi(buf1); if(i<1 || i>ped_size) { fprintf(stderr,"Invalid IBDID read in at line %d of file %s\n",line,fname); ABT_FUNC("Aborting\n"); } if(famid_start>=0) { memcpy(buf1,buf+famid_start,famid_width); buf1[famid_width]=0; qstrip(buf1); l=strlen(buf1); if(!l) { fprintf(stderr,"Null FAMID read in at line %d of file %s\n",line,fname); ABT_FUNC("Aborting\n"); } } p=buf1; p1=buf1+famid_width+1; memcpy(p1,buf+id_start,id_width); p1[id_width]=0; qstrip(p1); l=strlen(buf1); if(!l) { fprintf(stderr,"Null ID read in at line %d of file %s\n",line,fname); ABT_FUNC("Aborting\n"); } if(family_id) { if(fam_recode.flag==ST_STRING) data.string=p; else data.value=atoi(p); j=find_node(fam_root,fam_recode.flag,&data); if(j<0) { fprintf(stderr,"Family ID '%s' not found at line %d of file %s\n",p,line,fname); ABT_FUNC("Aborting\n"); } } else j=0; if(id_recode.flag==ST_STRING) data.string=p1; else data.value=atoi(p1); k=find_node(id_root[j],id_recode.flag,&data); if(k<0) { fprintf(stderr,"ID '%s' not found at line %d of file %s\n",p1,line,fname); ABT_FUNC("Aborting\n"); } trans[k]=i; } } fclose(fptr); free(fname); if(family_id) { free_bin_tree(fam_root,free); for(i=0;i #include #include "utils.h" #include "loki.h" #include "ranlib.h" #include "sample_cens.h" /* Sample truncated (censored) data points */ void Sample_Censored(void) { int i,j,type,idx,er; double sd,y,z; sd=sqrt(residual_var[0]); type=models[0].var.type; idx=models[0].var.var_index; if(type&ST_CONSTANT) { for(i=0;i #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #ifdef HAVE_LIMITS_H #include #endif #include #include "ranlib.h" #include "utils.h" #include "sparse.h" #include "loki.h" #include "sample_rand.h" #include "sample_effects.h" #include "min_deg.h" static int n_var,n_lev,cov_start,mk_start,rand_start,poly_start; static int bsize=1024,*order,XX_size,entry_size,*zero,init_flag; int bv_iter; static double *B; static struct Diag *XX; static struct Off *freelist; struct entry { double val; int pos; }; static double **full_xx; static struct entry *entry; static int full_store=60; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_new_nodes" static struct Off *alloc_new_nodes(int n) { struct Off *p; int i; #ifdef DEBUG if(!n) ABT_FUNC("Internal error - called with zero argument\n"); #endif if(!(p=malloc(sizeof(struct Off)*n))) ABT_FUNC(MMsg); RemBlock=AddRemem(p,RemBlock); /* Link blocks together */ for(i=0;iNext; return p; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_XX_entry1" void add_XX_entry1(int x,int y,double z) { struct Off *p,**pp; pp=&XX[x].First; p=*pp; while(p) { if(p->col>=y) break; pp=&p->Next; p=p->Next; } if(p && p->col==y) p->val+=z; else { p=get_node(); p->col=y; p->val=z; p->Next=*pp; *pp=p; XX[x].count++; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_XX_entry" void add_XX_entry(int x,int y,double z) { struct Off *p,*p2,**pp; pp=&XX[x].First; p=*pp; while(p) { if(p->col>=y) break; pp=&p->Next; p=*pp; } if(p && p->col==y) p->val+=z; else { if(!freelist) freelist=alloc_new_nodes(bsize); p2=freelist; freelist=p2->Next; p2->col=y; p2->val=z; p2->Next=p; *pp=p2; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_sample_effects" void init_sample_effects(void) { int i,j,k,k1,k2,k3,type,rec,nrec,n_lev1,n_var1,comp,*order1,*mat; struct id_data *data; struct SparseMatRec *AI; struct Off *p,*p1; if(!models) return; init_flag=1; if(full_store) { i=full_store*(full_store+1)/2; if(!(full_xx=malloc(sizeof(void *)*full_store))) ABT_FUNC(MMsg); if(!(full_xx[0]=malloc(sizeof(double)*i))) ABT_FUNC(MMsg); for(i=1;idata.value-1; #ifdef DEBUG if(k2<0 || k2>models[0].term[k].df) ABT_FUNC("Internal error - illegal factor value\n"); #endif entry[n_var1].pos=n_lev1+k2; } #ifdef DEBUG else ABT_FUNC("Illegal Random type\n"); #endif n_lev1+=models[0].term[k].df; n_var1++; } } /* Other Covariates */ for(k=0;kdata.value-1; #ifdef DEBUG if(k2<0 || k2>models[0].term[k].df) ABT_FUNC("Internal error - illegal factor value\n"); #endif if(k2--) entry[n_var1].pos=n_lev1+k2; else entry[n_var1].pos=-1; } else { /* Continuous factors */ entry[n_var1].pos=n_lev1; } n_var1++; n_lev1+=models[0].term[k].df; } #ifdef DEBUG if(n_var1!=n_var || n_lev1!=n_lev) { (void)fprintf(stderr,"%d %d %d %d\n",n_var,n_var1,n_lev,n_lev1); ABT_FUNC("Internal error - level mismatch\n"); } #endif /* Add contributions to X'X */ k=models[0].var.var_index; for(k=0;k=0) { XX[k1].val=1.0; for(k2=k+1;k2=0) { add_XX_entry1(k3,k1,1.0); } } } } } if(models[0].polygenic_flag) { /* Add A^-1 Matrix */ j=poly_start; for(comp=0;compcol; p1=p; p=p->Next; } if(p1) { p1->Next=freelist; freelist=XX[i].First; } } mat[i]=k3; /* Get factorization order */ min_deg(n_lev,mat,order1,0,0); for(i=0;iXX_size) { XX_size=(int)((double)t_lev*1.1); if(!(XX=realloc(XX,sizeof(struct Diag)*XX_size))) ABT_FUNC(MMsg); if(!(zero=realloc(zero,sizeof(int)*XX_size))) ABT_FUNC(MMsg); if(!(B=realloc(B,sizeof(double)*XX_size))) ABT_FUNC(MMsg); } for(i=0;it_lev?t_lev:full_store; tdp=full_xx[0]; k=j*(j+1)/2; while(k--) *(tdp++)=0; } if(t_var>entry_size) { entry_size=(int)(1.1*(double)t_var); if(!(entry=realloc(entry,sizeof(struct entry)*entry_size))) ABT_FUNC(MMsg); } /* Assemble the X'X matrix */ mtype=models[0].var.type; idx=models[0].var.var_index; id=id_array; for(i=0;ires[0]) { nrec=id->n_rec; for(rec=0;recvv[0][rec]:1.0; /* Load raw data value into y */ y=0.0; if(mtype&ST_CONSTANT) { data=id->data+idx; if(data->flag&2) y=id->cens[0][0]; } else { data=id->data1[rec]+idx; if(data->flag&2) y=id->cens[0][rec]; } if(data->flag&ST_INTTYPE) y+=(double)data->data.value; else y+=data->data.rvalue; /* Set up contribution vector */ n_lev1=n_var1=1; /* ...mean */ if(grand_mean_set[0]!=1) { entry[n_var1].val=1.0; entry[n_var1++].pos=n_lev1++; } else y-=grand_mean[0]; /* ...QTL's */ if(n_qt) { for(j=0;j=0) for(k=0;kdata) data=id->data+k1; } else if(id->data1) data=id->data1[rec]+k1; if(type&ST_FACTOR) { /* Discrete factors */ k2=(int)data->data.value-1; #ifdef DEBUG if(k2<0 || k2>models[0].term[k].df) ABT_FUNC("Internal error - illegal factor value\n"); #endif entry[n_var1].pos=n_lev1+k2; entry[n_var1].val=1.0; } #ifdef DEBUG else ABT_FUNC("Illegal Random type\n"); #endif n_lev1+=models[0].term[k].df; n_var1++; } } /* ...other effects */ for(k=0;kdata) data=id->data+k1; } else if(id->data1) data=id->data1[rec]+k1; if(type&ST_FACTOR) { /* Discrete factors */ k2=(int)data->data.value-1; #ifdef DEBUG if(k2<0 || k2>models[0].term[k].df) ABT_FUNC("Internal error - illegal factor value\n"); #endif if(k2--) { entry[n_var1].pos=n_lev1+k2; entry[n_var1++].val=1.0; } } else { /* Continuous factors */ if(data->flag&ST_INTTYPE) z=(double)data->data.value; else z=data->data.rvalue; entry[n_var1].pos=n_lev1; entry[n_var1++].val=z; } n_lev1+=models[0].term[k].df; } #ifdef DEBUG if(n_lev1!=t_lev) ABT_FUNC("Internal error - level mismatch\n"); #endif id->res[0][rec]=y; entry[0].pos=0; entry[0].val=y; /* Add contributions to X'X */ /* Reorder equations */ k3=0; for(k=b_var;k=b_lev) { k1=n_lev+b_lev-order[(k1-b_lev)]; } else ABT_FUNC("Illegal equation position\n"); if(k1<0 || k1>=t_lev) ABT_FUNC("Illegal equation position\n"); #else k1=n_lev+b_lev-order[(k1-b_lev)]; #endif entry[k].pos=k1; } wt1=1.0/(wt*residual_var[0]); if(t_lev<=full_store) { for(k=0;k=0) { z=entry[k].val; if(fabs(z)=0) { z=entry[k].val; if(fabs(z)=full_store) add_XX_entry(k3,k1,z*y*wt1); else full_xx[k3][k1]+=z*y*wt1; } } } else { XX[k1].val+=z*z*wt1; for(k2=k+1;k2=full_store) add_XX_entry(k2,k,z*AI[k1].val); else full_xx[k2][k]+=z*AI[k1].val; } } } else { XX[k].val+=z*AI[i].val; for(k1=AI[i].x;k1=full_store) XX[k2].val+=z; else full_xx[k2][k2]+=z; } i++; } } z=1.0/tau[0]; if(n_qt) { /* Add random terms for QTLs */ if(b_lev<=full_store) { for(j=qt_start,i=0;i=full_store) XX[j].val+=z; else full_xx[j][j]+=z; } } } } /* and for candidate genes */ if(mk_start>=0) { for(j=mk_start,k=0;k=full_store) XX[k2].val+=z; else full_xx[k2][k2]+=z; } } } } /* Gaussian elimination step - sparse region */ for(i=t_lev-1;i>=full_store && i>0;i--) { y=XX[i].val; if(fabs(y)<1.0e-12) { zero[i]=1; continue; } else zero[i]=0; if(yval; j=p->col; if(jNext)) { j=p->col; if(jval; z=-z1*y; tdp=full_xx[j]; while(p1!=p) { tdp[p1->col]+=p1->val*z; p1=p1->Next; } tdp[j]+=z1*z; } else break; } while(p) { j=p->col; p1=p2; z1=p->val; z=-z1*y; pp=&XX[j].First; k1=p1->col; while((p3=*pp)) { if(p3->col==k1) { p3->val+=p1->val*z; p1=p1->Next; if(p1==p) break; pp=&p3->Next; k1=p1->col; } else if(p3->col>k1) { if(!freelist) freelist=alloc_new_nodes(bsize); p4=freelist; freelist=p4->Next; p4->col=k1; p4->val=p1->val*z; p4->Next=p3; *pp=p4; p1=p1->Next; if(p1==p) break; pp=&p4->Next; k1=p1->col; } else pp=&p3->Next; } if(p1!=p) { do { if(!freelist) freelist=alloc_new_nodes(bsize); p3=freelist; freelist=p3->Next; p3->col=p1->col; p3->val=p1->val*z; *pp=p3; pp=&p3->Next; p1=p1->Next; } while(p1!=p); *pp=0; } XX[j].val-=z1*z1*y; p=p->Next; } } } /* Gaussian elimination - full_stored region */ for(;i>0;i--) { tdp3=tdp=full_xx[i]; y=tdp[i]; if(fabs(y)<1.0e-12) { zero[i]=1; continue; } else zero[i]=0; if(yt_lev?t_lev:full_store; for(i=1;iqt_start && ij && k1.0) { B[i-1]=tlocus[k].eff[0][0]; B[i]=tlocus[k].eff[0][1]; } break; } j+=2; } } } for(;icol) { y=p->val; p=p->Next; } else y=0.0; while(p) { j=p->col; if(!zero[j]) y-=B[j]*p->val; p1=p; p=p->Next; } /* Free up what we don't need */ if(p1) { p1->Next=freelist; freelist=XX[i].First; } } else y=0.0; z=1.0/XX[i].val; B[i]=y*z+snorm()*sqrt(z); if(no_overdominant && n_qt && i>qt_start && ij && k1.0) { B[i-1]=tlocus[k].eff[0][0]; B[i]=tlocus[k].eff[0][1]; } break; } j+=2; } } } /* Store new effect samples */ /* Grand Mean */ if(grand_mean_set[0]!=1) { if(!zero[1]) grand_mean[0]=B[1]; } /* QTLs */ if(n_qt) { for(j=qt_start,i=0;i=0) { for(j=mk_start,k=0;kbv[0]=z; id->bvsum[0]+=z; id->bvsum2[0]+=z*z; } bv_iter++; } /* and other covariates effects */ if(cov_start>=0) { j=cov_start; for(k=0;kres[0]) { nrec=id->n_rec; for(rec=0;recres[0][0]; else y=id->res[0][rec]; if(grand_mean_set[0]!=1) y-=grand_mean[0]; if(models[0].polygenic_flag) y-=id->bv[0]; for(j=0;jdata) data=id->data+k1; } else if(id->data1) data=id->data1[rec]+k1; #ifdef DEBUG if(!data) ABT_FUNC("Internal error - null data pointer\n"); #endif if(type&ST_FACTOR) { k2=(int)data->data.value-1; if(!(type&ST_RANDOM)) k2--; if(k2>=0) y-=models[0].term[k].eff[k2]; } else { if(data->flag&ST_INTTYPE) z=(double)data->data.value; else z=data->data.rvalue; y-=models[0].term[k].eff[0]*z; } } } id->res[0][rec]=y; ss+=y*y; ssn+=1.0; } } } loki/lokisrc/sample_effects.h0100644000076500007650000000014310001741572015565 0ustar heathheathextern void init_sample_effects(void),free_sample_effects(void); extern void sample_effects(void); loki/lokisrc/sample_nu.c0100644000076500007650000000744410001741567014602 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * August 2000 * * * * sample_nu.c: * * * * Sampling routines connected to t-distribution of residuals * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include "ranlib.h" #include "utils.h" #include "loki.h" #include "sample_nu.h" double res_nu; int use_student_t; static double nu_list[]={1,1.5,2,5,10,25,50,100,-1}; static double *nu_prob; static int n_nu; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_sample_nu" void init_sample_nu(void) { int i,type,nrec; double n,v; n_nu=0; while(nu_list[n_nu]>=0.0) n_nu++; if(n_nu) { res_nu=nu_list[n_nu-1]; if(!(nu_prob=malloc(sizeof(double)*2*n_nu))) ABT_FUNC(MMsg); } n=0.0; type=models[0].var.type; for(i=0;i=1.0e-6 && nu<=1.0) { type=models[0].var.type; n=0.0; np=np1=s1=0.0; for(i=0;inp) z=1.0; else z=exp(np1-np); if(ranf()<=z) { res_nu=nu; } } sample_weights(); #endif } loki/lokisrc/sample_nu.h0100644000076500007650000000014410001741572014571 0ustar heathheathvoid init_sample_nu(void); void free_sample_nu(void); void sample_nu(void); extern double res_nu; loki/lokisrc/sample_rand.c0100644000076500007650000001120210001741567015067 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - MSKCC * * * * August 2000 * * * * sample_rand.c: * * * * Sampling routine for uncorrelated random variance components * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include "ranlib.h" #include "utils.h" #include "mat_utils.h" #include "sparse.h" #include "loki.h" #include "sample_rand.h" static double *work; double **c_var; unsigned long *rand_flag; struct Variable **rand_list; int n_random; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_rand" void init_rand(void) { int k,i,j,type,mod; struct Variable *var; double *tmp; if(!n_models) return; for(n_random=i=0;i #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "loki.h" #include "ranlib.h" #include "loki_peel.h" #include "handle_res.h" #include "seg_pen.h" #include "gen_pen.h" double **seg_count,*aff_freq; static double **seg_freq,seg_log2; static int *group,*first,*next,*alleles[2],*gpflag,*gpsize,**obslist,**cpstart,*fg_type; static int *gplist,*gplist1,ngroups,*seg_alls; static double *pp[2]; int **tl_group; double addlog(double x1,double x2) { double yy, r; yy=.5*(x1+x2); r=(log(cosh(x1-yy))+yy+seg_log2); return r; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "setup_groups" static void setup_groups(void) { int i,i1,j,k,comp,locus,nfd=0,ntl; int **temp_p,*temp_p1; ntl=n_tloci?1:0; for(locus=0;locus1) setup_groups(); if(n_tloci) k=2; for(i=0;ik) k=j; } if(k) { if(!(seg_alls=malloc(sizeof(int)*k))) ABT_FUNC(MMsg); if(!(seg_freq=malloc(sizeof(void *)*2*n_genetic_groups))) ABT_FUNC(MMsg); seg_count=seg_freq+n_genetic_groups; if(!(seg_freq[0]=malloc(sizeof(double)*k*2*n_genetic_groups))) ABT_FUNC(MMsg); for(i=1;ik) k=j; j=comp_ngenes[i]; if(j>k1) k1=j; } if(est_aff_freq) if(!(fg_type=malloc(sizeof(int)*k1))) ABT_FUNC(MMsg); if(n_tloci) alloc_gen_pen(k1); if(!(first=malloc(sizeof(int)*k1*9))) ABT_FUNC(MMsg); next=first+k1; /* First and next keep track of group members */ group=next+k1; /* Group membership for each gene */ gpflag=group+k1; /* Whether a group has 2 or 1 possible states */ gpsize=gpflag+k1; /* Size of group */ alleles[0]=gpsize+k1; /* Allele allocations for each gene */ alleles[1]=alleles[0]+k1; gplist=alleles[1]+k1; /* List of active groups */ gplist1=gplist+k1; /* Inverse of gplist */ nl=n_markers+(n_tloci?1:0); if(nl) { if(!(obslist=malloc(sizeof(void *)*2*nl))) ABT_FUNC(MMsg); cpstart=obslist+nl; if(!(cpstart[0]=malloc(sizeof(int)*nl*(n_comp+1)))) ABT_FUNC(MMsg); for(i=1;i=0) { group[k]=g2; alleles[k1][k]=alleles[k2][k]; k=next[k]; } group[k]=g2; alleles[k1][k]=alleles[k2][k]; /* Add members of g1 to g2 list */ next[k]=first[g2]; first[g2]=first[g1]; /* Update log probabilities for group g2 */ pp[k1][g2]+=pp[k2][g1]; /* Update size of g2 */ gpsize[g2]+=gpsize[g1]; /* Remove g1 from active list */ k=gplist1[g1]; k1=gplist[k]=gplist[--ngroups]; gplist1[k1]=k; } /* Change group g1 to group g2, link groups together, and swap allele allocations */ static void change_and_swap_group(int g1,int g2) { int k,k1; /* Change group and allele allocations for members of g1 */ k=first[g1]; while(next[k]>=0) { group[k]=g2; k1=alleles[0][k]; alleles[0][k]=alleles[1][k]; alleles[1][k]=k1; k=next[k]; } group[k]=g2; k1=alleles[0][k]; alleles[0][k]=alleles[1][k]; alleles[1][k]=k1; /* Add members of g1 to g2 list */ next[k]=first[g2]; first[g2]=first[g1]; /* Update log probabilities for group g2 */ pp[0][g2]+=pp[0][g1]; pp[1][g2]+=pp[1][g1]; /* Update size of g2 */ gpsize[g2]+=gpsize[g1]; /* Remove g1 from active list */ k=gplist1[g1]; k1=gplist[k]=gplist[--ngroups]; gplist1[k1]=k; } /* Change group g1 to group g2 and link groups together */ static void change_group(int g1,int g2) { int k,k1; /* Change group for members of g1 */ k=first[g1]; while(next[k]>=0) { group[k]=g2; k=next[k]; } group[k]=g2; /* Add members of g1 to g2 list */ next[k]=first[g2]; first[g2]=first[g1]; /* Update log probabilities for group g2 */ pp[0][g2]+=pp[0][g1]; pp[1][g2]+=pp[1][g1]; /* Update size of g2 */ gpsize[g2]+=gpsize[g1]; /* Remove g1 from active list */ k=gplist1[g1]; k1=gplist[k]=gplist[--ngroups]; gplist1[k1]=k; } void seg_init_freq(int locus) { int i,j,n_all; n_all=locus>=0?marker[locus].locus.n_alleles:tlocus[-1-locus].locus.n_alleles; for(j=0;j=0 && marker[locus].count_flag[j]) for(i=0;i=0) { for(i=0;i=0?&marker[locus].locus:&tlocus[-1-locus].locus; n_all=loc->n_alleles; for(grp=0;grpfreq[grp]; if(locus<0) { for(i=0;i=0) { for(i=0;in_alleles; z=0.0; for(i=0;iaff_freq[i]=z>0.0?aff_freq[i]/z:0.0; loc->diff_freq[i]+=(loc->freq[0][i]aff_freq[i])?1.0:0.0; } } /* Calculate probability of segregation pattern conditional on * (a) genotype data (marker loci) * (b) genotype data + trait data + sampled genotypes for individuals with trait data but no genotype data (candidate genes) * (c) trait data + sampled genotypes for individuals with trait data (trait loci) */ #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "seg_pen" double seg_pen(int locus,int comp,int *err,int flag,int si) { int i,i1,j,k,k1,s,s1,a1,a2,g1,g2,o1=0,o2=0,o1a,o2a,o2b,locus1,*fflag; int k_sw[]={-1,1,1,-1,2,-1,3,-1,2,0,-1,-1,-1,-1,-1,-1}; int k1_sw[]={-1,1,2,-1,1,-1,3,-1,2,0,-1,-1,-1,-1,-1,-1}; int ngenes,*genesm,*genesp,*obs,*trans,*grp=0,*gt,*hap; int nn_all,n_all,idd,ids,**seg,sample_freq,locus_type; double p,z,z1,*ff_1=0,*ff_2=0,**ff1,*count1,ppen=0.0; struct Locus *loc; sample_freq=0; if(locus>=0) { /* Marker locus */ locus1=locus; loc=&marker[locus].locus; hap=marker[locus].haplo; n_all=marker[locus].n_all1[comp]; nn_all=loc->n_alleles; if(marker[locus].mterm && marker[locus].mterm[0]) locus_type=1; else locus_type=0; s1=cpstart[locus][comp]; s=cpstart[locus][comp+1]-s1; if(n_all>=2 && s) { /* Set up frequency arrays */ trans=allele_trans[locus][comp]; ff1=marker[locus].locus.freq; if(n_genetic_groups>1) grp=marker[locus].group[comp]; if(n_all==nn_all) for(i=0;i=0) seg_alls[k1]=i; } } for(k=0;k=0) seg_freq[k][k1]=log(ff1[k][i]); else z+=ff1[k][i]; } if(n_alln_alleles; locus_type=2; s1=cpstart[n_markers][comp]; s=cpstart[n_markers][comp+1]-s1; if(s>0) { /* Set up frequency arrays */ if(n_genetic_groups>1) grp=tl_group[comp]; ff1=loc->freq; for(k=0;kgenes[X_MAT]; genesp=loc->genes[X_PAT]; gt=loc->gt; ngenes=comp_ngenes[comp]; if(flag&8) { for(i=0;i=0) { o1=hap[i]; o2=o1&65535; o1>>=16; a1=genesm[i]-1; a2=genesp[i]-1; if(n_genetic_groups>1) { ff_1=seg_freq[grp[a1]]; ff_2=seg_freq[grp[a2]]; } /* Is individual autozygous ? */ if(a1!=a2) { /* Not autozygous, check if in existing group */ g1=group[a1]; g2=group[a2]; if(g1>=0) { k=gpflag[g1]; if(g2>=0) { /* Both genes in groups, same group ? */ if(g1==g2) { /* Yes, group fixed ? */ if(k--) { o1a=alleles[k][a1]; o2a=alleles[k][a2]; /* Yes, check match */ if((o1a!=o1 || o2a!=o2) && (o1a!=o2 || o2a!=o1)) return 4.0; pp[k][g1]+=ppen; } else { /* No, find which alternate matches */ k1=3; o1a=alleles[0][a1]; o2a=alleles[0][a2]; if((o1a==o1 && o2a==o2)||(o1a==o2 && o2a==o1)) k1&=1; o1a=alleles[1][a1]; o2a=alleles[1][a2]; if((o1a==o1 && o2a==o2)||(o1a==o2 && o2a==o1)) k1&=2; if(k1==3) return 5.0; /* No match */ if(!k1) { pp[0][g1]+=ppen; pp[1][g1]+=ppen; } else { gpflag[g1]=k1--; pp[k1][g1]+=ppen; } } } else { /* Genes are in different groups. Groups fixed ? */ k1=gpflag[g2]; if(k) { o1a=alleles[k-1][a1]; if(k1) { o2a=alleles[k1-1][a2]; /* Both groups fixed, check allocations match */ if((o1a!=o1 || o2a!=o2) && (o1a!=o2 || o2a!=o1)) { return 6.0; } } else { /* Only first group fixed. Check which possible * allocations for second group match */ k1=0; if(o1a==o1) { if(alleles[0][a2]==o2) k1=1; else if(alleles[1][a2]==o2) k1=2; } else if(o1a==o2) { if(alleles[0][a2]==o1) k1=1; else if(alleles[1][a2]==o1) k1=2; } if(!k1) { return 7.0; /* No match */ } } } else if(k1) { /* Only second group fixed. Check which possible * allocations for first group match */ o2a=alleles[k1-1][a2]; k=0; if(o2a==o2) { if(alleles[0][a1]==o1) k=1; else if(alleles[1][a1]==o1) k=2; } else if(o2a==o1) { if(alleles[0][a1]==o2) k=1; else if(alleles[1][a1]==o2) k=2; } if(!k) return 8.0; /* No match */ } else { /* No groups fixed. See which allocations match up */ k1=0; o1a=alleles[0][a1]; o2a=alleles[0][a2]; o2b=alleles[1][a2]; if(o1a==o1) { if(o2a==o2) k1|=1; if(o2b==o2) k1|=2; } if(o1a==o2) { if(o2a==o1) k1|=1; if(o2b==o1) k1|=2; } o1a=alleles[1][a1]; if(o1a==o1) { if(o2a==o2) k1|=4; if(o2b==o2) k1|=8; } if(o1a==o2) { if(o2a==o1) k1|=4; if(o2b==o1) k1|=8; } if(!k1) return 9.0; /* No match */ /* Convert from k1 to appropriate gpflag entries */ k=k_sw[k1]; k1=k1_sw[k1]; #ifdef DEBUG if(k<0 || k1<0) ABT_FUNC("Internal Error - bad code\n"); #endif } /* Are allocation flags the same ? */ if(k!=k1) { /* No, so we must flip the allocations for all members of * one of the groups (the smallest) */ if(gpsize[g1]=0) { /* Only a2 in group, a1 is new */ /* Add a1 to group */ next[a1]=first[g2]; first[g2]=a1; group[a1]=g2; gpsize[g2]++; k1=gpflag[g2]; if(k1--) { /* Group for a2 is fixed, check matches */ o1a=alleles[k1][a2]; if(o1a==o1) alleles[k1][a1]=o2; else if(o1a==o2) alleles[k1][a1]=o1; else return 12.0; /* No match */ pp[k1][g2]+=ff_1[alleles[k1][a1]-1]+ppen; } else { /* Group for a2 not fixed, check both allocations for matches */ for(k1=k=0;k<2;k++) { o2a=alleles[k][a2]; if(o2a==o1) alleles[k][a1]=o2; else if(o2a==o2) alleles[k][a1]=o1; else k1|=2-k; } if(k1==3) return 13.0; /* No match */ gpflag[g2]=k1; /* Add in contrib. to pp from gene a1 */ if(k1--) { pp[k1][g2]+=ff_1[alleles[k1][a1]-1]+ppen; } else { pp[0][g2]+=ff_1[alleles[0][a1]-1]+ppen; pp[1][g2]+=ff_1[alleles[1][a1]-1]+ppen; } } } else { /* A first for both genes */ if(o1!=o2) { /* Heterozygote */ alleles[0][a1]=alleles[1][a2]=o1; alleles[1][a1]=alleles[0][a2]=o2; gpflag[j]=0; pp[0][j]=ff_1[o1-1]+ff_2[o2-1]+ppen; pp[1][j]=ff_2[o1-1]+ff_2[o2-1]+ppen; } else { /* Homozygote */ alleles[0][a1]=alleles[0][a2]=o1; gpflag[j]=1; pp[0][j]=ff_1[o1-1]+ff_2[o1-1]+ppen; pp[1][j]=0.0; } /* Create new group */ first[j]=a1; next[a1]=a2; next[a2]=-1; gpsize[j]=2; /* Add to active list */ gplist1[j]=ngroups; group[a1]=group[a2]=j; gplist[ngroups++]=j++; } } else { /* Yes, Check homozygosity */ if(o1!=o2) { return 1.0; } g1=group[a1]; /* Already in group ? */ if(g1>=0) { /* Yes, is group is fixed ? */ k=gpflag[g1]; if(k--) { /* Yes, Check allele matches ? */ if(alleles[k][a1]!=o1) return 2.0; pp[k][g1]+=ppen; } else { /* No, find which alternate matches current allele */ k=0; if(alleles[0][a1]==o1) k=1; else if(alleles[1][a1]==o1) k=2; if(!k) return 3.0; /* No match */ /* Fix group appropriately */ gpflag[g1]=k; pp[k-1][g1]+=ppen; } } else { /* No, create new group */ first[j]=a1; gpflag[j]=gpsize[j]=1; next[a1]=-1; /* Add in contrib. to pp from this gene */ pp[0][j]=ff_1[o1-1]+ppen; pp[1][j]=0.0; alleles[0][a1]=o1; /* Add group to active list */ gplist[ngroups]=j; gplist1[j]=ngroups++; /* Set group membership for a1 and increment group counter */ group[a1]=j++; } } } /* All allocations have been made. Go through active group list * and accumulate the probability */ p=0.0; /* First check if we are sampling */ if(!flag) { /* No, just calculate the probability */ for(j=0;j1) ff_1=seg_freq[grp[a1]]; if(ff_1[0]<0.0) for(i=0;i1.0e-8) { printf("Internal error - frequencies don't sum to 1! z=%g\n",z); ABT_FUNC("Internal error\n"); } #endif z=ranf(); z1=0.0; for(i=0;iseg; fflag=founder_flag[locus1]; for(i1=0;i1k1) k=k*(k-1)/2+k1; else k=k1*(k1-1)/2+k; } loc->gt[i]=k; /* Note that we don't have to update residuals because the genotypes of individuals with trait data * are not changed */ } /* Get allele counts for frequency update */ if(sample_freq&4) { if(n_genetic_groups==1) { count1=seg_count[0]; for(i=0;i=0) { if(locus_type==1) { /* Candidate gene */ o1=hap[i]; if(!o1) { k=gt[i]; #ifdef DEBUF if(k<1) ABT_FUNC("Illegal sampled genotype\n"); #endif o1=(int)(.5+sqrt((double)(2*k)-1.74449)); o2=k-o1*(o1-1)/2; #ifdef DEBUG if(o1<1 || o2<1 || o1>nn_all || o2>nn_all) ABT_FUNC("Illegal sampled genotype\n"); #endif ppen=q_penetrance(i,k,locus); } else { o2=o1&65535; o1>>=16; } } else { /* Trait locus */ k=gt[i]; #ifdef DEBUG if(k<1) ABT_FUNC("Illegal sampled genotype\n"); #endif o1=(int)(.5+sqrt((double)(2*k)-1.74449)); o2=k-o1*(o1-1)/2; #ifdef DEBUG if(o1<1 || o2<1 || o1>nn_all || o2>nn_all) { ABT_FUNC("Illegal sampled genotype\n"); } #endif ppen=q_penetrance(i,k,locus); } a1=genesm[i]-1; a2=genesp[i]-1; if(n_genetic_groups>1) { ff_1=seg_freq[grp[a1]]; ff_2=seg_freq[grp[a2]]; } /* Is individual autozygous ? */ if(a1!=a2) { /* Not autozygous, check if in existing group */ g1=group[a1]; g2=group[a2]; if(g1>=0) { k=gpflag[g1]; if(g2>=0) { /* Both genes in groups, same group ? */ if(g1==g2) { /* Yes, group fixed ? */ if(k--) { o1a=alleles[k][a1]; o2a=alleles[k][a2]; /* Yes, check match */ if((o1a!=o1 || o2a!=o2) && (o1a!=o2 || o2a!=o1)) { return 4.0; } pp[k][g1]+=ppen; } else { /* No, find which alternate matches */ for(k1=k=0;k<2;k++) { o1a=alleles[k][a1]; o2a=alleles[k][a2]; if((o1a!=o1 || o2a!=o2) && (o1a!=o2 || o2a!=o1)) k1|=2-k; } if(k1==3) return 5.0; /* No match */ gpflag[g1]=k1; /* Fix group */ if(k1--) pp[k1][g1]+=ppen; else for(k1=0;k1<2;k1++) pp[k1][g1]+=ppen; } } else { /* Genes are in different groups. Groups fixed ? */ k1=gpflag[g2]; if(k) { o1a=alleles[k-1][a1]; if(k1) { o2a=alleles[k1-1][a2]; /* Both groups fixed, check allocations match */ if((o1a!=o1 || o2a!=o2) && (o1a!=o2 || o2a!=o1)) { return 6.0; } } else { /* Only first group fixed. Check which possible * allocations for second group match */ for(k1=0;k1<2;k1++) { o2a=alleles[k1][a2]; if((o1a==o1 && o2a==o2) || (o1a==o2 && o2a==o1)) break; } if(k1++==2) { return 7.0; /* No match */ } } } else if(k1) { /* Only second group fixed. Check which possible * allocations for first group match */ o2a=alleles[k1-1][a2]; for(k=0;k<2;k++) { o1a=alleles[k][a1]; if((o1a==o1 && o2a==o2) || (o1a==o2 && o2a==o1)) break; } if(k++==2) { return 8.0; /* No match */ } } else { /* No groups fixed. See which allocations match up */ for(k1=k=0;k<4;k++) { o1a=alleles[(k&2)>>1][a1]; o2a=alleles[k&1][a2]; if((o1a==o1 && o2a==o2) || (o1a==o2 && o2a==o1)) k1|=1<=0) { /* Only a2 in group, a1 is new */ k1=gpflag[g2]; if(k1) { /* Group for a2 is fixed, check matches */ o1a=alleles[k1-1][a2]; if(o1a==o1) alleles[k1-1][a1]=o2; else if(o1a==o2) alleles[k1-1][a1]=o1; else return 12.0; /* No match */ } else { /* Group for a2 not fixed, check both allocations for matches */ for(k1=k=0;k<2;k++) { o2a=alleles[k][a2]; if(o2a==o1) alleles[k][a1]=o2; else if(o2a==o2) alleles[k][a1]=o1; else k1|=2-k; } if(k1==3) return 13.0; /* No match */ gpflag[g2]=k1; } /* Add a1 to group */ next[a1]=first[g2]; first[g2]=a1; group[a1]=g2; gpsize[g2]++; /* Add in contrib. to pp from gene a1 */ if(k1--) pp[k1][g2]+=ff_1[alleles[k1][a1]-1]+ppen; else for(k1=0;k1<2;k1++) pp[k1][g2]+=ff_1[alleles[k1][a1]-1]+ppen; } else { /* A first for both genes */ if(o1!=o2) { /* Heterozygote */ alleles[0][a1]=alleles[1][a2]=o1; alleles[1][a1]=alleles[0][a2]=o2; gpflag[j]=0; pp[0][j]=ff_1[o1-1]+ff_2[o2-1]+ppen; pp[1][j]=ff_2[o1-1]+ff_1[o2-1]+ppen; } else { /* Homozygote */ alleles[0][a1]=alleles[0][a2]=o1; gpflag[j]=1; pp[0][j]=ff_1[o1-1]+ff_2[o1-1]+ppen; } /* Create new group */ first[j]=a1; next[a1]=a2; next[a2]=-1; gpsize[j]=2; /* Add to active list */ gplist[ngroups]=j; gplist1[j]=ngroups++; group[a1]=group[a2]=j++; } } else { /* Yes, Check homozygosity */ if(o1!=o2) { return 1.0; } g1=group[a1]; /* Already in group ? */ if(g1>=0) { /* Yes, is group is fixed ? */ k=gpflag[g1]; if(k--) { /* Yes, Check allele matches ? */ if(alleles[k][a1]!=o1) return 2.0; pp[k][g1]+=ppen; } else { /* No, find which alternate matches current allele */ for(k=0;k<2;k++) { o1a=alleles[k][a1]; if(o1a==o1) break; } if(k==2) return 3.0; /* No match */ /* Fix group appropriately */ gpflag[g1]=k+1; pp[k][g1]+=ppen; } } else { /* No, create new group */ first[j]=a1; gpflag[j]=gpsize[j]=1; next[a1]=-1; /* Add in contrib. to pp from this gene */ pp[0][j]=ff_1[o1-1]+ppen; alleles[0][a1]=o1; /* Add group to active list */ gplist[ngroups]=j; gplist1[j]=ngroups++; /* Set group membership for a1 and increment group counter */ group[a1]=j++; } } } /* All allocations have been made. Go through active group list * and accumulate the probability */ p=0.0; /* First check if we are sampling */ if(!flag) { /* No, just calculate the probability */ for(j=0;j1) ff_1=seg_freq[grp[a1]]; if(ff_1[0]<0.0) for(i=0;i1.0e-8) { printf("Internal error - frequencies don't sum to 1! z=%g\n",z); ABT_FUNC("Internal error\n"); } #endif z=ranf(); z1=0.0; for(i=0;iseg; fflag=founder_flag[locus1]; for(i1=0;i1k1) k=k*(k-1)/2+k1; else k=k1*(k1-1)/2+k; } loc->gt[i]=k; /* Note that we don't have to update residuals becuase the genotypes of individuals with trait data * are not changed */ } /* Get allele counts for frequency update */ if(sample_freq) { if(n_genetic_groups==1) { count1=seg_count[0]; for(i=0;i #include #include #include "utils.h" #include "loki.h" #include "loki_peel.h" #include "seg_pen.h" #include "gen_pen.h" #include "update_segs.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "update_seg_probs" void update_seg_probs(int fg,int fg1,int si) { int i,k,comp; for(k=0;k /* Period parameters */ #define N 624 #define M 397 #define MATRIX_A 0x9908b0df /* constant vector a */ #define UPPER_MASK 0x80000000 /* most significant w-r bits */ #define LOWER_MASK 0x7fffffff /* least significant r bits */ /* Tempering parameters */ #define TEMPERING_MASK_B 0x9d2c5680 #define TEMPERING_MASK_C 0xefc60000 #define TEMPERING_SHIFT_U(y) (y >> 11) #define TEMPERING_SHIFT_S(y) (y << 7) #define TEMPERING_SHIFT_T(y) (y << 15) #define TEMPERING_SHIFT_L(y) (y >> 18) static unsigned long mt[N]; /* the array for the state vector */ static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */ /* initializing the array with a NONZERO seed */ void sgenrand(seed) unsigned long seed; { /* setting initial seeds to mt[N] using */ /* the generator Line 25 of Table 1 in */ /* [KNUTH 1981, The Art of Computer Programming */ /* Vol. 2 (2nd Ed.), pp102] */ mt[0]= seed & 0xffffffff; for (mti=1; mti= N) { /* generate N words at one time */ int kk; if (mti == N+1) /* if sgenrand() has not been called, */ sgenrand(4357); /* a default initial seed is used */ for (kk=0;kk> 1) ^ mag01[y & 0x1]; } for (;kk> 1) ^ mag01[y & 0x1]; } y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK); mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1]; mti = 0; } y = mt[mti++]; y ^= TEMPERING_SHIFT_U(y); y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B; y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C; y ^= TEMPERING_SHIFT_L(y); return ( (double)y * 2.3283064370807974e-10 ); /* reals */ /* return y; */ /* for integer generation */ } /* this main() outputs first 1000 generated numbers */ main() { int j; sgenrand(4357); /* any nonzero integer can be used as a seed */ for (j=0; j<1000; j++) { printf("%5f ", genrand()); if (j%8==7) printf("\n"); } printf("\n"); } loki/orig_sources/qsort.c0100644000076500007650000002010207445627301015015 0ustar heathheath/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Douglas C. Schmidt (schmidt@ics.uci.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include extern void _quicksort __P ((void *const pbase, size_t total_elems, size_t size, __compar_fn_t cmp)); /* Byte-wise swap two items of size SIZE. */ #define SWAP(a, b, size) \ do \ { \ register size_t __size = (size); \ register char *__a = (a), *__b = (b); \ do \ { \ char __tmp = *__a; \ *__a++ = *__b; \ *__b++ = __tmp; \ } while (--__size > 0); \ } while (0) /* Discontinue quicksort algorithm when partition gets below this size. This particular magic number was chosen to work best on a Sun 4/260. */ #define MAX_THRESH 4 /* Stack node declarations used to store unfulfilled partition obligations. */ typedef struct { char *lo; char *hi; } stack_node; /* The next 4 #defines implement a very fast in-line stack abstraction. */ #define STACK_SIZE (8 * sizeof(unsigned long int)) #define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top)) #define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi))) #define STACK_NOT_EMPTY (stack < top) /* Order size using quicksort. This implementation incorporates four optimizations discussed in Sedgewick: 1. Non-recursive, using an explicit stack of pointer that store the next array partition to sort. To save time, this maximum amount of space required to store an array of MAX_INT is allocated on the stack. Assuming a 32-bit integer, this needs only 32 * sizeof(stack_node) == 136 bits. Pretty cheap, actually. 2. Chose the pivot element using a median-of-three decision tree. This reduces the probability of selecting a bad pivot value and eliminates certain extraneous comparisons. 3. Only quicksorts TOTAL_ELEMS / MAX_THRESH partitions, leaving insertion sort to order the MAX_THRESH items within each partition. This is a big win, since insertion sort is faster for small, mostly sorted array segments. 4. The larger of the two sub-partitions is always pushed onto the stack first, with the algorithm then concentrating on the smaller partition. This *guarantees* no more than log (n) stack size is needed (actually O(1) in this case)! */ void _quicksort (pbase, total_elems, size, cmp) void *const pbase; size_t total_elems; size_t size; __compar_fn_t cmp; { register char *base_ptr = (char *) pbase; /* Allocating SIZE bytes for a pivot buffer facilitates a better algorithm below since we can do comparisons directly on the pivot. */ char *pivot_buffer = (char *) __alloca (size); const size_t max_thresh = MAX_THRESH * size; if (total_elems == 0) /* Avoid lossage with unsigned arithmetic below. */ return; if (total_elems > MAX_THRESH) { char *lo = base_ptr; char *hi = &lo[size * (total_elems - 1)]; /* Largest size needed for 32-bit int!!! */ stack_node stack[STACK_SIZE]; stack_node *top = stack + 1; while (STACK_NOT_EMPTY) { char *left_ptr; char *right_ptr; char *pivot = pivot_buffer; /* Select median value from among LO, MID, and HI. Rearrange LO and HI so the three values are sorted. This lowers the probability of picking a pathological pivot value and skips a comparison for both the LEFT_PTR and RIGHT_PTR. */ char *mid = lo + size * ((hi - lo) / size >> 1); if ((*cmp) ((void *) mid, (void *) lo) < 0) SWAP (mid, lo, size); if ((*cmp) ((void *) hi, (void *) mid) < 0) SWAP (mid, hi, size); else goto jump_over; if ((*cmp) ((void *) mid, (void *) lo) < 0) SWAP (mid, lo, size); jump_over:; memcpy (pivot, mid, size); pivot = pivot_buffer; left_ptr = lo + size; right_ptr = hi - size; /* Here's the famous ``collapse the walls'' section of quicksort. Gotta like those tight inner loops! They are the main reason that this algorithm runs much faster than others. */ do { while ((*cmp) ((void *) left_ptr, (void *) pivot) < 0) left_ptr += size; while ((*cmp) ((void *) pivot, (void *) right_ptr) < 0) right_ptr -= size; if (left_ptr < right_ptr) { SWAP (left_ptr, right_ptr, size); left_ptr += size; right_ptr -= size; } else if (left_ptr == right_ptr) { left_ptr += size; right_ptr -= size; break; } } while (left_ptr <= right_ptr); /* Set up pointers for next iteration. First determine whether left and right partitions are below the threshold size. If so, ignore one or both. Otherwise, push the larger partition's bounds on the stack and continue sorting the smaller one. */ if ((size_t) (right_ptr - lo) <= max_thresh) { if ((size_t) (hi - left_ptr) <= max_thresh) /* Ignore both small partitions. */ POP (lo, hi); else /* Ignore small left partition. */ lo = left_ptr; } else if ((size_t) (hi - left_ptr) <= max_thresh) /* Ignore small right partition. */ hi = right_ptr; else if ((right_ptr - lo) > (hi - left_ptr)) { /* Push larger left partition indices. */ PUSH (lo, right_ptr); lo = left_ptr; } else { /* Push larger right partition indices. */ PUSH (left_ptr, hi); hi = right_ptr; } } } /* Once the BASE_PTR array is partially sorted by quicksort the rest is completely sorted using insertion sort, since this is efficient for partitions below MAX_THRESH size. BASE_PTR points to the beginning of the array to sort, and END_PTR points at the very last element in the array (*not* one beyond it!). */ #define min(x, y) ((x) < (y) ? (x) : (y)) { char *const end_ptr = &base_ptr[size * (total_elems - 1)]; char *tmp_ptr = base_ptr; char *thresh = min(end_ptr, base_ptr + max_thresh); register char *run_ptr; /* Find smallest element in first threshold and place it at the array's beginning. This is the smallest array element, and the operation speeds up insertion sort's inner loop. */ for (run_ptr = tmp_ptr + size; run_ptr <= thresh; run_ptr += size) if ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0) tmp_ptr = run_ptr; if (tmp_ptr != base_ptr) SWAP (tmp_ptr, base_ptr, size); /* Insertion sort, running from left-hand-side up to right-hand-side. */ run_ptr = base_ptr + size; while ((run_ptr += size) <= end_ptr) { tmp_ptr = run_ptr - size; while ((*cmp) ((void *) run_ptr, (void *) tmp_ptr) < 0) tmp_ptr -= size; tmp_ptr += size; if (tmp_ptr != run_ptr) { char *trav; trav = run_ptr + size; while (--trav >= run_ptr) { char c = *trav; char *hi, *lo; for (hi = lo = trav; (lo -= size) >= tmp_ptr; hi = lo) *hi = *lo; *hi = c; } } } } } loki/orig_sources/README0100644000076500007650000000120007522474412014356 0ustar heathheathThis directory contains the original sources for the Mersenne Twister random number generator (mt19937.c), and the qsort routine. Home page for Mersenne Twister: http://www.math.keio.ac.jp/~matumoto/emt.html The qsort routine came from glibc_2.1.2, the full source of which can be obtained from any of the GNU sites. This is used rather than the built in qsort because in the case where the sort index is not unique, different qsort routines can return different orders, which will make the answers different. In addition, ranlib.c in libsrc/ is from the ranlib.c library which is available from netlib (http://www.netlib.org/random/) loki/prepsrc/0040755000076500007650000000000010060041201012434 5ustar heathheathloki/prepsrc/calc_nrm.c0100644000076500007650000002247607747731263014426 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March/April 1997 * * * * calc_nrm.c: * * * * Calculate Inverse of NRM matrix using algorithm of Quaas (1976) * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #include #include "utils.h" #include "libhdr.h" #include "scan.h" #include "sparse.h" static double *u; int cmp_inbr(const void *s1,const void *s2) { double x1,x2; int i; i=*((const int *)s1); x1=u[i]; i=*((const int *)s2); x2=u[i]; if(x1x2) return -1; return 0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Calculate_NRM" /* Calculate inverse of NRM (G) matrix using Quaas/Henderson method * See Numerical Recipes in C 2nd edition pps. 78-79 for a description * of the sparse matrix storage. Note the matrix is half stored. */ int Calculate_NRM(char *LogFile) { int id,i,j,k,k1,idd,ids,idd1,ids1,nz=0,comp,max_comp=0,n_inbr; char *fname,*tname; int *sire_list,*dam_list,*temp,*spouses=0,*perm; FILE *flog=0,*fptr=0; double d,*v,xx,d2,d4,Detl,TDetl,avg_inbr; struct SparseMatRec *AIMatrix=0; struct model *model; struct model_list *mlist; fname=make_file_name(".nrm"); if(unlink(fname)<0) if(errno!=ENOENT) { perror("Calculate_NRM"); (void)fprintf(stderr,"Can't remove file %s.\n",fname); free(fname); return -1; } if(!pruned_ped_size) { free(fname); return 0; } /* Do we need an NRM ? */ model=Models; while(model) { mlist=model->model_list; while(mlist) { for(i=0;invar;i++) if(mlist->element[i]->type&ST_ID) break; if(invar) break; mlist=mlist->next; } if(mlist) break; model=model->next; } /* Find maximum component size */ for(i=0;imax_comp) max_comp=comp_size[i]; if(!(sire_list=calloc((size_t)(pruned_ped_size+max_comp*2),sizeof(int)))) ABT_FUNC(MMsg); dam_list=sire_list+max_comp; perm=dam_list+max_comp; if(!(u=malloc(max_comp*2*sizeof(double)))) ABT_FUNC(MMsg); v=u+max_comp; for(i=0;iidd) temp[ids-1]++; else temp[idd-1]++; } } if(model) { nz=0; spouses=0; if(k) { if(!(spouses=calloc((size_t)k,sizeof(int)))) ABT_FUNC(MMsg); for(j=k=0;jidd) { for(k1=temp[ids-1];k1=0) xx=u[ids]; if(idd>=0) xx+=u[idd]; xx=1.0-.25*xx; d=1.0/xx; u[i]+=xx; xx=sqrt(xx); v[i]=xx; Detl+=log(xx); for(k=i+1;k=i) xx=v[ids1]; if(idd1>=i) xx+=v[idd1]; if(xx>0.0) { xx=.5*xx; u[k]+=xx*xx; } v[k]=xx; } if(model) { AIMatrix[i].val+=d; d2= -.5*d; d4=.25*d; j=AIMatrix[i].x; if(ids>=0) { AIMatrix[j++].val+=d2; AIMatrix[ids].val+=d4; } if(idd>=0) { AIMatrix[j++].val+=d2; AIMatrix[idd].val+=d4; if(ids>=0) { if(ids==idd) AIMatrix[ids].val+=d4; else if(ids>idd) { for(j=AIMatrix[ids].x;j1.0) { xx=u[j]-1.0; avg_inbr+=xx; n_inbr++; } } Detl+=Detl; TDetl+=Detl; if(model) { AIMatrix[comp_size[comp]].val=Detl; if(fprintf(fptr,"LKNM:%x,%x\n",comp_size[comp],nz)<0) DataFileError(fname); for(j=0;j1.0) { temp[k++]=j; } gnu_qsort(temp,(size_t)k,sizeof(int),cmp_inbr); for(j=0;j1) (void)fprintf(flog,"\n Log Determinant of combined NRM matrix = %f\n",TDetl); (void)fclose(flog); } if(model && Filter) do i=wait(&j); while(i>0); return model?1:0; } loki/prepsrc/check_het.c0100644000076500007650000000547407646742735014570 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Paris * * * * August 2002 * * * * check_het.c: * * * * Small stand-alone program to check heterozygosities of markers * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include "version.h" #include "libhdr.h" #include "ranlib.h" #include "utils.h" #include "scan.h" #include "control_parse.h" #include "check_het.h" loki_time lt; static char *LogFile; void print_version_and_exit(void) { (void)printf("%s\n",HET_NAME); exit(EXIT_SUCCESS); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "main" int main(int argc,char *argv[]) { FILE *fptr; int err; init_stuff(&LogFile); lt.start_time=time(0); if(argc<2) abt(__FILE__,__LINE__,"No control file specified\n"); if((fptr=fopen(argv[1],"r"))) err=ReadControl(fptr,argv[1],&LogFile); else { (void)printf("Couldn't open '%s' for input as control file\nAborting...\n",argv[1]); exit(EXIT_FAILURE); } (void)fclose(fptr); if(err) { LogFile=0; exit(EXIT_FAILURE); } print_start_time(HET_NAME,"w",LogFile,<); if(getseed("seedfile",0)) init_ranf(135421); if(!scan_error_n) ReadData(LogFile); /* Read in the datafile(s) and recode (where necessary) */ if(!pruned_ped_size) { (void)printf("Zero size pedigree\nAborting...\n"); exit(EXIT_FAILURE); } if(!scan_error_n && n_markers) test_het(LogFile); (void)writeseed("seedfile",1); if(family) free(family); free_nodes(); if(scan_error_n) (void)fprintf(stderr,"Errors: %d ",scan_error_n); if(scan_warn_n) (void)fprintf(stderr,"Warnings: %d ",scan_warn_n); if(scan_error_n || scan_warn_n) (void)fprintf(stderr,"\n"); return sig_caught; } loki/prepsrc/check_het.h0100644000076500007650000000020307646742735014556 0ustar heathheath#ifndef _CHECK_HET_H_ #define _CHECK_HET_H_ void test_het(char *); struct het_res { double het,ehet,p; int flag,n; }; #endif loki/prepsrc/cleanup.c0100644000076500007650000001545707646760433014277 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Paris * * * * August 2002 * * * * cleanup.c: * * * * Clean up and free memory * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include "version.h" #include "libhdr.h" #include "ranlib.h" #include "utils.h" #include "scan.h" #include "control_parse.h" int catch_sigs,sig_caught,sig_quiet; struct remember *RemBlock; static struct remember *FirstRemBlock; static char **LFile; void free_infile(struct InFile *infile) { struct DataBlock *db,*db1; db=infile->data; while(db) { if(db->records) free(db->records); if(db->type) free(db->type); db1=db->next; free(db); db=db1; } if(infile->format) { free(infile->format->f_atoms); free(infile->format); } if(infile->fformat) { if(infile->fformat->rs) free(infile->fformat->rs); if(infile->fformat->fs) free(infile->fformat->fs); if(infile->fformat->gs) free(infile->fformat->gs); free(infile->fformat); } free(infile->name); if(infile->element) free(infile->element); free(infile); } static void free_miss(struct Miss *m) { if(m->Missing.type==ST_STRING) free(m->Missing.arg.string); if(m->element) free(m->element); if(m->scope) free(m->scope); free(m); } static void free_link(struct Link *l) { if(l->name) free(l->name); if(l->element) free(l->element); free(l); } static void free_model(struct model *m) { struct model_list *ml,*ml1; ml=m->model_list; while(ml) { ml1=ml->next; if(ml->element) free(ml->element); free(ml); ml=ml1; } free(m); } void free_op(struct operation *op) { struct operation *op1; while(op) { if(op->type==STRING) free(op->arg.string); op1=op->next; free(op); op=op1; } } void free_restrict(struct Restrict *res) { if(res->element) free(res->element); free_op(res->Op_List); free(res); } static void free_node(void *s) { struct scan_data *sd; sd=s; if(sd->name) free(sd->name); if(sd->element) free(sd->element); free(s); } /* This is called when the program finishes without calling abt(), * i.e., normal termination or SIGINT etc. */ static void FreeStuff(void) { int i; struct InFile *infile,*infile1; struct Miss *m,*m1; struct Link *l,*l1; struct model *model,*model1; struct Restrict *res,*res1; struct Censor *cen,*cen1; if(from_abt) return; if(id_array) { for(i=0;inext; free_infile(infile); infile=infile1; } m=Miss; while(m) { m1=m->next; free_miss(m); m=m1; } l=links; while(l) { l1=l->next; free_link(l); l=l1; } model=Models; while(model) { model1=model->next; free_model(model); model=model1; } res=Restrictions; while(res) { res1=res->next; free_restrict(res); res=res1; } cen=Censored; while(cen) { cen1=cen->next; free_op(cen->Op_List); free(cen); cen=cen1; } if(Affected) free_op(Affected); if(Unaffected) free_op(Unaffected); if(markers) { for(i=0;iorder) { if(traitlocus->order[0]) free(traitlocus->order[0]); free(traitlocus->order); } if(traitlocus->o_size) free(traitlocus->o_size); free(traitlocus); } if(root_var) free_bin_tree(root_var,free_node); if(Filter) free(Filter); if(*LFile) free(*LFile); if(OutputFile) free(OutputFile); if(OutputLaurFile) free(OutputLaurFile); if(OutputRawFile) free(OutputRawFile); if(ErrorDir) free(ErrorDir); FreeRemem(FirstRemBlock); } /* Called when program receives signal */ static void int_handler(int i) { static int oldsig=-1; char *sigs[]={"SIGTERM","SIGQUIT","SIGHUP","SIGINT","UNKNOWN"}; int j,signals[]={SIGTERM,SIGQUIT,SIGHUP,SIGINT}; for(j=0;j<4;j++) if(i==signals[j]) break; if(catch_sigs && oldsig!=i) { sig_caught=oldsig=i; if(!sig_quiet) (void)printf("Caught sig %s\n",sigs[j]); return; } if(!sig_quiet) (void)fprintf(stderr,"Exiting on signal %s (%d)\n",sigs[j],i); exit(i); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "init_stuff" void init_stuff(char **p) { struct sigaction s_action; LFile=p; if(!(FirstRemBlock=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); RemBlock=FirstRemBlock; RemBlock->pos=0; RemBlock->next=0; /* If program terminates normally or via a signal I want it to go through * FreeStuff() so that Memory can be cleared so I can check for unfreed blocks */ if(atexit(FreeStuff)) ABT_FUNC("Unable to register exit function FreeStuff()\n"); if(atexit(print_end_time)) ABT_FUNC("Unable to register exit function print_end_time()\n"); s_action.sa_handler=int_handler; s_action.sa_flags=0; (void)sigaction(SIGINT,&s_action,0L); (void)sigaction(SIGHUP,&s_action,0L); (void)sigaction(SIGQUIT,&s_action,0L); (void)sigaction(SIGTERM,&s_action,0L); } loki/prepsrc/compat/0040755000076500007650000000000010060041201013717 5ustar heathheathloki/prepsrc/compat/compat.c0100644000076500007650000000372107646743214015403 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Evry * * * * January 2003 * * * * compat.c: * * * * Compatability utilities * * * * Copyright (C) Simon C. Heath 2003 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #include "utils.h" #include "compat.h" #include "scan.h" int check_format(char *name) { char *format_names[]={"LOKI","QTDT","MERLIN","SOLAR","LINKAGE",0}; int format_types[]={LOKI_FORMAT,QTDT_FORMAT,QTDT_FORMAT,SOLAR_FORMAT,LINKAGE_FORMAT}; char *p,*p1; int i=0; p1=name+2; while(*p1 && isspace((int)*p1)) p1++; p=format_names[0]; while(p) { if(!strcasecmp(p,p1)) break; p=format_names[++i]; } if(!p) { fprintf(stderr,"Unknown format type (%s)\n",p1); exit(EXIT_FAILURE); } return format_types[i]; } loki/prepsrc/compat/compat.h0100644000076500007650000000021507646743214015403 0ustar heathheath#include "merlin.h" int check_format(char *); #define LOKI_FORMAT 0 #define QTDT_FORMAT 1 #define SOLAR_FORMAT 2 #define LINKAGE_FORMAT 3 loki/prepsrc/compat/Makefile.in0100644000076500007650000000143507646743214016021 0ustar heathheathSHELL = /bin/sh CC = @CC@ MY_CFLAGS = @CFLAGS@ @extra_cflags@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ AR = @AR@ #DMALLOC_INC = @DMALLOC_INC@ #DMALLOC_LIB = @DMALLOC_LIB@ #DMALLOC_FLAGS = @DMALLOC_FLAGS@ INCLUDES = -I../../include -I.. CFLAGS = $(MY_CFLAGS) $(INCLUDES) $(DMALLOC_FLAGS) COMPAT_SRC = compat.c merlin.c COMPATLIB_OBJ = ${COMPAT_SRC:.c=.o} libcompat.a: $(COMPATLIB_OBJ) ../../include/config.h $(AR) cr $@ $(COMPATLIB_OBJ) $(RANLIB) $@ clean: rm -f *~ *.o *.a *.bak a.out core seedfile depend distclean: clean rm -f libcompat.a Makefile depend: $(COMPATLIB_SRC) /usr/X11R6/bin/makedepend -I/usr/local/include $(INCLUDES) $(DMALLOC_FLAGS) $(SCAN_SRC) $(COMMON_SRC) $(HET_SRC) $(PREP_SRC) touch depend # DO NOT DELETE THIS LINE -- make depend depends on it. loki/prepsrc/compat/merlin.c0100644000076500007650000001513207747722233015405 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Evry * * * * January 2003 * * * * merlin.c: * * * * MERLIN/QTDT compatability routines * * * * Copyright (C) Simon C. Heath 2003 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef HAVE_UNISTD_H #include #endif #include #ifdef USE_DMALLOC #include #endif #include #include #include #include "getopt.h" #include "version.h" #include "libhdr.h" #include "ranlib.h" #include "utils.h" #include "scan.h" #define BUFSIZE 512 int strip_vars; char *skip_blank(char *s) { while(*s && isspace((int)*s)) s++; return s; } char *skip_nonblank(char *s) { while(*s && !isspace((int)*s)) s++; return s; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "process_qtdt" int process_qtdt(int argc,char *argv[],char **LogFile,int *error_check,loki_time *lt) { static int noprune=0; int c,err,i,j,ncols=0,col_size=8,line,anon_var=0,nmark=0; FILE *fptr,*fin; char *datafile=0,*pedfile=0,*mapfile=0,*lfile=0,*missing=0,*p,*p1,*p2; static char buf[BUFSIZE]; struct column { int c; char *name; } *cols=0; static struct option longopts[]={ {"noprune",no_argument,&noprune,1}, {"prune",no_argument,&noprune,0}, {"log",required_argument,0,'l'}, {0,0,0,0} }; static char *fixed[]={ "Set skip_bad_ints 1\n", "Set skip_bad_reals 1\n", "Missing [\"RIF\"] \"x\"\n", "Missing [\"RIF\"] \"X\"\n", "Missing [\"F\"] \"0\"\n", "Missing \"?\" sex_var\n", "Pedigree family,id,father,mother\n", "Sex sex_var \"1\",\"2\"\n", "Sex sex_var \"M\",\"F\"\n", "Sex sex_var \"m\",\"f\"\n", 0 }; while((c=getopt_long(argc,argv,"evm:d:p:x:l:X:",longopts,0))!=-1) switch(c) { case 'e': error_check=0; break; case 'v': print_version_and_exit(); break; /* Previous command never returns */ case 'd': datafile=strdup(optarg); break; case 'p': pedfile=strdup(optarg); break; case 'm': mapfile=strdup(optarg); break; case 'x': missing=strdup(optarg); break; case 'l': lfile=strdup(optarg); break; case 'X': fputs("-X option must occur as first argument\n",stderr); exit(EXIT_FAILURE); } if(!datafile) { fputs("No data file specified (use -d option)\n",stderr); exit(EXIT_FAILURE); } if(!pedfile) { fputs("No pedigree file specified (use -p option)\n",stderr); exit(EXIT_FAILURE); } /* Now we create a temporary command file which we can feed into the standard parse routines */ if(!(fptr=tmpfile())) ABT_FUNC("Couldn't create temporary file\n"); i=0; p=fixed[i]; while(p) { (void)fputs(p,fptr); p=fixed[++i]; } if(lfile) fprintf(fptr,"Log \"%s\"\n",lfile); else fputs("Log \"loki.log\"\n",fptr); if(missing) fprintf(fptr,"Missing [\"R\"] \"%s\"\n",missing); fprintf(fptr,"File [GS=' \\f\\r\\n\\t/'] \"%s\",family,id,father,mother,sex_var",pedfile); if(!(fin=fopen(datafile,"r"))) { perror("Couldn't open datafile for input"); ABT_FUNC("Aborting\n"); } if(!(cols=malloc(sizeof(struct column)*col_size))) ABT_FUNC(MMsg); line=0; while(fgets(buf,BUFSIZE,fin)) { line++; p=skip_blank(buf); p1=skip_nonblank(p); if(*p1) { *p1++=0; p1=skip_blank(p1); if(*p1) { p2=skip_nonblank(p1); *p2=0; } } if(*p) { if(!*p1) fprintf(stderr,"Line %d: Item type %c has no name\n",line,p[0]); c=toupper((int)p[0]); (void)fputc(',',fptr); switch(c) { case 'M': nmark++; case 'A': case 'T': case 'C': if(ncols==col_size) { col_size+=2; if(!(cols=realloc(cols,sizeof(struct column)*col_size))) ABT_FUNC(MMsg); } if(*p1) { if(!(cols[ncols].name=malloc(3+strlen(p1)))) ABT_FUNC(MMsg); sprintf(cols[ncols].name,"%s__",p1); strip_vars=1; } else { i=1+(int)(log((double)++anon_var)/log(10.0)); if(!(cols[ncols].name=malloc((size_t)(i+5)))) ABT_FUNC(MMsg); sprintf(cols[ncols].name,"var_%d",anon_var); } fputs(cols[ncols].name,fptr); cols[ncols++].c=c; break; case 'Z': case 'S': case 'E': break; default: fprintf(stderr,"Line %d: error in datafile - unknown item type (%c)\n",line,c); ABT_FUNC("Aborting\n"); } if(c=='E') break; } } fputc('\n',fptr); if(nmark) { fputs("Marker Loci",fptr); for(j=i=0;i",LogFile); (void)fclose(fptr); if(!err) { if(getseed("seedfile",0)) init_ranf(135421); RunID=(unsigned int)(ranf()*(double)0xffffffffU); print_start_time(PREP_NAME,"w",*LogFile,lt); if(!scan_error_n) ReadData(*LogFile); /* Read in the datafile(s) and recode (where necessary) */ } if(datafile) free(datafile); if(pedfile) free(pedfile); if(mapfile) free(mapfile); if(missing) free(missing); if(lfile) free(lfile); for(i=0;i #include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #ifdef __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) #define YY_USES_REJECT typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 49 #define YY_END_OF_BUFFER 50 static yyconst short int yy_acclist[366] = { 0, 50, 48, 49, 3, 48, 49, 2, 4, 49, 2, 4, 48, 49, 35, 48, 49, 10, 48, 49, 48, 49, 48, 49, 34, 48, 49, 48, 49, 48, 49, 47, 48, 49, 48, 49, 48, 49, 48, 49, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49, 16428, 45, 48, 49,16428, 25, 48, 49, 48, 49, 16428, 33, 48, 49, 6, 49, 7, 49, 6, 7, 49, 6, 49, 24, 49, 12, 49, 12, 49, 11, 49, 49, 48, 49, 3, 48, 49, 4, 49, 4, 48, 49, 35, 48, 49, 10, 48, 49, 48, 49, 48, 49, 34, 48, 49, 48, 49, 48, 49, 47, 48, 49, 48, 49, 48, 49, 48, 49, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 27, 45, 48, 49,16428, 28, 45, 48, 49,16428, 25, 48, 49, 26, 48, 49, 48, 49,16428, 33, 48, 49, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 45, 48, 49,16428, 2, 2, 4, 4, 4, 2, 4, 2, 4, 4, 31, 2, 9, 2, 34, 46, 5, 47, 29, 32, 30, 45, 16428, 8236, 45,16428, 45,16428, 33, 45,16428,16428, 33, 7, 8, 24, 12, 23, 13, 15, 23, 15, 23, 16, 23, 17, 23, 18, 23, 19, 23, 20, 23, 21, 23, 22, 23, 23, 4, 31, 9, 34, 46, 5, 47, 29, 32, 30, 45,16428, 8236, 45, 16428, 45,16428, 45,16428, 45,16428, 33, 45,16428, 45,16428, 45,16428,16428, 33, 45,16428, 45,16428, 45,16428, 45,16428, 2, 4, 4, 2, 9, 1, 2, 2, 46, 2, 34, 45,16428, 35, 45,16428, 13, 15, 15, 14, 1, 46, 34, 45,16428, 42, 8236, 40, 8236, 35, 45,16428, 38, 8236, 45,16428, 43, 8236, 41, 8236, 39, 8236, 45,16428, 4, 4, 4, 4, 2, 4, 4, 4, 1, 2, 9, 2, 1, 2, 8236, 13, 15, 14, 1, 9, 8236, 45, 16428, 45,16428, 4, 4, 1, 2, 9, 2, 36, 8236, 37, 8236, 8236, 8236 } ; static yyconst short int yy_accept[261] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 7, 10, 14, 17, 20, 22, 24, 27, 29, 31, 34, 36, 38, 40, 44, 48, 52, 56, 59, 62, 65, 67, 69, 72, 74, 76, 78, 80, 82, 83, 85, 88, 90, 93, 96, 99, 101, 103, 106, 108, 110, 113, 115, 117, 119, 123, 127, 131, 135, 139, 143, 147, 151, 156, 161, 164, 167, 170, 173, 177, 181, 185, 189, 189, 190, 191, 191, 192, 193, 194, 196, 198, 199, 200, 200, 202, 203, 203, 203, 204, 205, 206, 206, 207, 207, 208, 209, 210, 210, 210, 212, 213, 215, 217, 220, 221, 222, 223, 224, 225, 226, 227, 230, 232, 234, 236, 238, 240, 242, 244, 246, 247, 247, 247, 248, 249, 249, 250, 250, 250, 251, 252, 253, 253, 254, 254, 255, 256, 257, 257, 257, 259, 260, 262, 264, 266, 268, 271, 273, 275, 276, 277, 279, 281, 283, 285, 286, 287, 288, 290, 290, 290, 292, 293, 293, 293, 293, 294, 294, 295, 295, 295, 298, 301, 303, 304, 305, 305, 305, 306, 306, 306, 306, 307, 307, 307, 307, 310, 310, 312, 312, 314, 317, 317, 319, 321, 321, 323, 323, 325, 325, 327, 329, 330, 331, 332, 333, 335, 336, 337, 337, 340, 341, 341, 341, 343, 343, 343, 343, 344, 346, 347, 347, 349, 349, 349, 349, 349, 349, 350, 352, 354, 355, 356, 359, 359, 359, 360, 360, 360, 360, 360, 360, 360, 360, 360, 360, 362, 362, 364, 364, 364, 365, 365, 365, 366, 366 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 6, 7, 8, 1, 9, 6, 10, 11, 12, 13, 1, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 1, 1, 18, 19, 20, 1, 1, 21, 22, 22, 23, 24, 25, 26, 27, 28, 27, 29, 27, 27, 30, 31, 32, 27, 33, 34, 35, 27, 27, 27, 36, 37, 27, 38, 39, 40, 1, 41, 1, 42, 43, 22, 23, 22, 44, 26, 27, 28, 27, 29, 27, 27, 45, 31, 32, 27, 46, 34, 47, 27, 48, 27, 49, 37, 27, 1, 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[51] = { 0, 1, 1, 2, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4, 4, 4, 1, 1, 1, 1, 1, 1 } ; static yyconst short int yy_base[282] = { 0, 0, 0, 48, 50, 52, 60, 99, 0, 125, 0, 913, 64, 66, 898, 72, 74, 80, 82, 174, 164, 222, 152, 228, 243, 245, 251, 270, 49, 198, 291, 149, 337, 385, 2204, 2204, 878, 862, 0, 2204, 867, 2204, 420, 846, 840, 832, 84, 242, 724, 232, 469, 87, 81, 49, 382, 248, 250, 314, 519, 362, 367, 370, 364, 372, 380, 393, 381, 383, 718, 716, 569, 383, 386, 400, 409, 411, 322, 2204, 324, 0, 614, 619, 443, 564, 445, 669, 717, 719, 2204, 725, 733, 783, 831, 833, 839, 848, 855, 870, 858, 872, 881, 888, 891, 397, 897, 427, 873, 399, 0, 906, 2204, 2204, 0, 2204, 2204, 217, 249, 2204, 2204, 2204, 2204, 2204, 2204, 2204, 0, 514, 0, 447, 424, 326, 2204, 920, 970, 327, 1013, 323, 444, 1017, 1019, 315, 252, 249, 836, 413, 815, 233, 1015, 1020, 1021, 1012, 823, 1024, 1016, 0, 229, 1051, 1053, 1054, 1034, 2204, 1099, 1149, 2204, 1199, 908, 2204, 1072, 1249, 0, 1074, 1297, 1300, 1312, 1323, 1372, 837, 874, 442, 714, 0, 1391, 400, 2204, 1441, 0, 1077, 1369, 1081, 1491, 1540, 1018, 1542, 219, 1545, 162, 1022, 1552, 158, 1277, 1555, 155, 1565, 146, 1568, 73, 1513, 885, 1587, 0, 1577, 1635, 1643, 0, 1691, 2204, 1693, 1701, 0, 2204, 0, 1751, 1800, 1806, 1365, 2204, 1309, 2204, 1819, 0, 0, 1869, 1918, 1571, 1919, 1920, 0, 0, 2204, 0, 1924, 1937, 1965, 2014, 0, 0, 1948, 2033, 2082, 0, 1923, 65, 2084, 63, 0, 2094, 1949, 0, 2104, 2018, 2204, 2123, 2127, 2131, 2135, 2139, 2143, 2147, 2151, 2155, 2159, 2163, 61, 2167, 2171, 55, 2175, 2179, 2183, 2187, 2191, 2195, 2199 } ; static yyconst short int yy_def[282] = { 0, 259, 1, 260, 260, 261, 261, 259, 7, 7, 9, 259, 262, 262, 263, 264, 262, 262, 265, 259, 262, 262, 262, 262, 262, 262, 262, 259, 27, 27, 27, 262, 259, 262, 259, 259, 259, 259, 266, 259, 259, 259, 267, 268, 268, 263, 263, 268, 268, 269, 259, 268, 268, 268, 268, 268, 268, 268, 259, 58, 58, 58, 58, 58, 58, 58, 58, 58, 268, 268, 259, 268, 58, 58, 58, 58, 262, 259, 262, 19, 263, 259, 264, 263, 264, 259, 262, 265, 259, 265, 259, 259, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, 270, 27, 262, 27, 27, 27, 32, 262, 259, 259, 266, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 271, 268, 50, 263, 268, 269, 259, 259, 259, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 272, 58, 268, 58, 58, 58, 58, 58, 58, 58, 70, 268, 58, 58, 58, 58, 259, 259, 259, 259, 259, 273, 259, 273, 259, 91, 262, 262, 270, 270, 259, 270, 27, 27, 259, 259, 274, 259, 275, 259, 259, 132, 268, 268, 272, 259, 272, 58, 268, 268, 268, 268, 58, 268, 268, 58, 268, 268, 268, 268, 268, 268, 58, 276, 259, 160, 277, 277, 259, 161, 278, 259, 278, 259, 163, 259, 91, 259, 270, 270, 259, 259, 279, 259, 259, 180, 132, 259, 272, 272, 58, 58, 160, 161, 259, 163, 280, 280, 259, 280, 220, 180, 281, 259, 281, 230, 268, 268, 268, 268, 220, 280, 280, 230, 281, 281, 0, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259 } ; static yyconst short int yy_nxt[2255] = { 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 12, 12, 12, 21, 22, 23, 23, 24, 25, 26, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 30, 28, 28, 28, 28, 28, 28, 31, 12, 12, 32, 27, 28, 28, 29, 28, 28, 28, 28, 33, 35, 36, 35, 36, 39, 40, 126, 41, 224, 37, 135, 37, 39, 40, 179, 41, 77, 78, 77, 78, 126, 79, 126, 79, 83, 84, 77, 78, 103, 85, 126, 79, 77, 78, 88, 89, 127, 79, 126, 90, 42, 81, 86, 103, 126, 133, 134, 134, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 43, 43, 43, 43, 52, 53, 54, 54, 55, 56, 57, 58, 59, 59, 59, 60, 61, 59, 59, 59, 62, 63, 59, 64, 65, 59, 66, 67, 68, 43, 69, 70, 58, 59, 60, 62, 64, 59, 59, 66, 71, 72, 73, 77, 78, 126, 77, 78, 79, 74, 75, 79, 59, 59, 126, 94, 43, 126, 77, 78, 72, 126, 74, 79, 92, 59, 76, 76, 77, 78, 76, 76, 76, 79, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 76, 76, 76, 76, 91, 91, 91, 91, 91, 91, 91, 91, 76, 77, 78, 126, 103, 106, 79, 77, 78, 177, 178, 130, 79, 126, 93, 93, 131, 126, 95, 103, 96, 96, 77, 78, 77, 78, 126, 79, 97, 79, 77, 78, 126, 126, 126, 79, 126, 128, 98, 86, 99, 178, 178, 139, 128, 140, 100, 76, 101, 77, 78, 76, 76, 76, 79, 76, 102, 76, 76, 76, 76, 76, 103, 103, 76, 104, 76, 103, 103, 103, 103, 103, 103, 103, 103, 103, 105, 103, 103, 103, 103, 103, 103, 103, 76, 76, 76, 103, 103, 103, 103, 105, 103, 103, 103, 103, 76, 103, 126, 126, 107, 77, 78, 159, 78, 130, 79, 126, 79, 141, 131, 126, 103, 107, 76, 101, 77, 78, 76, 76, 76, 79, 76, 102, 76, 76, 76, 76, 76, 108, 108, 76, 104, 76, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 76, 76, 76, 108, 108, 108, 108, 108, 108, 108, 108, 108, 76, 77, 78, 126, 126, 144, 79, 144, 149, 136, 144, 137, 137, 144, 147, 144, 182, 148, 150, 138, 144, 183, 144, 144, 144, 144, 144, 151, 144, 144, 144, 150, 125, 155, 188, 152, 144, 189, 144, 144, 103, 144, 103, 144, 144, 126, 154, 156, 109, 115, 116, 144, 144, 158, 144, 103, 157, 103, 144, 77, 84, 159, 84, 175, 85, 126, 85, 144, 81, 144, 103, 223, 178, 134, 134, 117, 118, 119, 120, 121, 122, 123, 124, 125, 125, 103, 125, 125, 125, 125, 126, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 125, 125, 125, 125, 132, 132, 132, 132, 132, 132, 132, 132, 125, 125, 142, 126, 125, 125, 125, 125, 126, 125, 143, 125, 125, 125, 125, 125, 144, 144, 125, 145, 125, 144, 144, 144, 144, 144, 144, 144, 144, 144, 146, 144, 144, 144, 144, 144, 144, 144, 125, 125, 125, 144, 144, 144, 144, 146, 144, 144, 144, 144, 125, 125, 142, 81, 125, 125, 125, 125, 126, 125, 143, 125, 125, 125, 125, 125, 153, 153, 125, 145, 125, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 125, 125, 125, 153, 153, 153, 153, 153, 153, 153, 153, 153, 125, 80, 80, 81, 80, 80, 80, 80, 81, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 80, 80, 80, 80, 160, 160, 160, 160, 160, 160, 160, 160, 80, 82, 82, 77, 84, 82, 82, 82, 85, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 82, 82, 82, 82, 161, 161, 161, 161, 161, 161, 161, 161, 82, 77, 78, 88, 89, 126, 79, 126, 90, 162, 89, 178, 178, 126, 90, 87, 87, 88, 89, 87, 87, 87, 90, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 87, 87, 87, 87, 163, 163, 163, 163, 163, 163, 163, 163, 87, 164, 164, 165, 166, 164, 164, 164, 167, 164, 164, 164, 164, 164, 164, 164, 168, 168, 164, 164, 164, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 164, 164, 164, 168, 168, 168, 168, 168, 168, 168, 168, 168, 164, 77, 78, 77, 78, 142, 79, 81, 79, 77, 78, 126, 144, 143, 79, 126, 93, 93, 77, 78, 144, 126, 145, 79, 97, 77, 78, 144, 77, 78, 79, 93, 93, 79, 103, 144, 95, 113, 96, 96, 77, 78, 77, 78, 111, 79, 97, 79, 110, 103, 169, 77, 78, 170, 170, 182, 79, 101, 77, 78, 207, 77, 172, 79, 76, 102, 173, 77, 78, 174, 103, 103, 79, 81, 104, 176, 77, 78, 165, 166, 259, 79, 259, 167, 259, 103, 103, 176, 129, 129, 130, 129, 129, 129, 129, 131, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 129, 129, 129, 129, 180, 180, 180, 180, 180, 180, 180, 180, 129, 181, 181, 182, 181, 181, 181, 181, 183, 181, 181, 181, 181, 181, 181, 181, 184, 184, 181, 181, 181, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 181, 181, 181, 184, 184, 184, 184, 184, 184, 184, 184, 184, 181, 126, 191, 193, 259, 126, 196, 126, 259, 134, 134, 136, 185, 137, 137, 186, 186, 138, 190, 192, 194, 138, 144, 197, 198, 144, 144, 195, 144, 259, 144, 144, 144, 199, 144, 201, 203, 144, 259, 195, 144, 144, 205, 144, 144, 144, 144, 144, 259, 144, 200, 259, 202, 204, 259, 218, 166, 77, 78, 144, 167, 144, 79, 144, 144, 126, 259, 125, 259, 188, 170, 170, 189, 186, 186, 259, 144, 259, 144, 144, 206, 206, 182, 206, 206, 206, 206, 207, 206, 206, 206, 206, 206, 206, 206, 208, 208, 206, 206, 206, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 206, 206, 206, 208, 208, 208, 208, 208, 208, 208, 208, 208, 206, 209, 209, 165, 210, 209, 209, 209, 211, 209, 209, 209, 209, 209, 209, 209, 212, 212, 209, 209, 209, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 209, 209, 209, 212, 212, 212, 212, 212, 212, 212, 212, 212, 209, 213, 213, 214, 215, 213, 213, 213, 216, 213, 213, 213, 213, 213, 213, 213, 217, 217, 213, 213, 213, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 213, 213, 213, 217, 217, 217, 217, 217, 217, 217, 217, 217, 213, 164, 164, 165, 166, 164, 164, 164, 167, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 164, 164, 164, 164, 219, 219, 219, 219, 219, 219, 219, 219, 164, 77, 78, 259, 77, 172, 79, 76, 144, 173, 233, 259, 174, 226, 170, 170, 159, 172, 227, 76, 259, 173, 259, 144, 174, 171, 171, 77, 172, 171, 76, 171, 173, 171, 171, 174, 171, 171, 171, 171, 171, 171, 171, 171, 171, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 171, 171, 171, 171, 220, 220, 220, 220, 220, 220, 220, 220, 171, 221, 77, 172, 126, 76, 259, 173, 178, 178, 174, 259, 186, 186, 259, 259, 259, 259, 222, 225, 225, 226, 225, 225, 225, 225, 227, 225, 225, 225, 225, 225, 225, 225, 228, 228, 225, 225, 225, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 225, 225, 225, 228, 228, 228, 228, 228, 228, 228, 228, 228, 225, 181, 181, 182, 181, 181, 181, 181, 183, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 181, 181, 181, 181, 229, 229, 229, 229, 229, 229, 229, 229, 181, 187, 187, 259, 187, 187, 125, 187, 188, 187, 187, 189, 187, 187, 187, 187, 187, 187, 187, 187, 187, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 187, 187, 187, 187, 230, 230, 230, 230, 230, 230, 230, 230, 187, 231, 144, 191, 234, 125, 193, 188, 259, 126, 189, 143, 126, 196, 143, 259, 199, 144, 232, 126, 192, 143, 126, 194, 143, 259, 201, 259, 259, 203, 197, 259, 126, 200, 143, 126, 125, 143, 188, 165, 210, 189, 259, 202, 211, 259, 204, 206, 206, 182, 206, 206, 206, 206, 207, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 206, 206, 206, 206, 235, 235, 235, 235, 235, 235, 235, 235, 206, 218, 210, 259, 259, 259, 211, 209, 209, 165, 210, 209, 209, 209, 211, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 209, 209, 209, 209, 236, 236, 236, 236, 236, 236, 236, 236, 209, 214, 215, 237, 215, 259, 216, 259, 216, 213, 213, 214, 215, 213, 213, 213, 216, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 213, 213, 213, 213, 238, 238, 238, 238, 238, 238, 238, 238, 213, 239, 239, 165, 240, 239, 164, 239, 241, 239, 239, 242, 239, 239, 239, 239, 243, 243, 239, 239, 239, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 239, 239, 239, 243, 243, 243, 243, 243, 243, 243, 243, 243, 239, 221, 77, 172, 259, 76, 259, 173, 77, 172, 174, 76, 259, 173, 259, 259, 174, 259, 222, 225, 225, 226, 225, 225, 225, 225, 227, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 225, 225, 225, 225, 244, 244, 244, 244, 244, 244, 244, 244, 225, 245, 245, 182, 245, 245, 181, 245, 246, 245, 245, 247, 245, 245, 245, 245, 248, 248, 245, 245, 245, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 245, 245, 245, 248, 248, 248, 248, 248, 248, 248, 248, 248, 245, 231, 249, 251, 259, 125, 249, 188, 165, 240, 189, 164, 126, 241, 143, 259, 242, 259, 232, 250, 252, 218, 240, 250, 164, 259, 241, 259, 259, 242, 144, 144, 182, 165, 240, 181, 164, 246, 241, 259, 247, 242, 259, 259, 259, 144, 144, 239, 239, 165, 240, 239, 164, 239, 241, 239, 239, 242, 239, 239, 239, 239, 239, 239, 239, 239, 239, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 239, 239, 239, 239, 253, 253, 253, 253, 253, 253, 253, 253, 239, 254, 165, 240, 259, 164, 182, 241, 259, 181, 242, 246, 259, 259, 247, 259, 259, 259, 255, 245, 245, 182, 245, 245, 181, 245, 246, 245, 245, 247, 245, 245, 245, 245, 245, 245, 245, 245, 245, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 245, 245, 245, 245, 256, 256, 256, 256, 256, 256, 256, 256, 245, 257, 182, 251, 259, 181, 259, 246, 259, 126, 247, 143, 259, 254, 165, 240, 259, 164, 258, 241, 252, 259, 242, 257, 182, 259, 259, 181, 259, 246, 255, 259, 247, 259, 259, 259, 259, 259, 259, 259, 258, 34, 34, 34, 34, 38, 38, 38, 38, 76, 76, 76, 76, 80, 259, 80, 80, 82, 82, 82, 82, 87, 87, 87, 87, 112, 259, 259, 112, 114, 114, 114, 114, 125, 259, 125, 125, 129, 129, 129, 129, 171, 171, 171, 171, 187, 259, 187, 187, 164, 164, 164, 164, 181, 181, 181, 181, 206, 206, 206, 206, 209, 209, 209, 209, 213, 213, 213, 213, 225, 225, 225, 225, 239, 239, 239, 239, 245, 245, 245, 245, 11, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259 } ; static yyconst short int yy_chk[2255] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 5, 5, 53, 5, 274, 3, 53, 4, 6, 6, 271, 6, 12, 12, 13, 13, 252, 12, 250, 13, 15, 15, 16, 16, 28, 15, 204, 16, 17, 17, 18, 18, 46, 17, 52, 18, 5, 46, 16, 28, 51, 51, 52, 52, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 31, 31, 202, 22, 22, 31, 9, 9, 22, 9, 9, 200, 22, 9, 197, 20, 20, 9, 194, 9, 20, 20, 9, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 192, 29, 29, 21, 23, 23, 115, 115, 49, 23, 154, 21, 21, 49, 145, 23, 29, 23, 23, 24, 24, 25, 25, 47, 24, 23, 25, 26, 26, 55, 141, 56, 26, 140, 47, 24, 24, 25, 116, 116, 55, 55, 56, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 30, 57, 139, 30, 76, 76, 78, 78, 129, 76, 135, 78, 57, 129, 133, 30, 30, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 54, 71, 59, 33, 62, 62, 54, 60, 54, 54, 61, 60, 63, 181, 61, 63, 54, 59, 181, 62, 64, 66, 60, 67, 64, 61, 72, 63, 63, 143, 72, 143, 65, 65, 143, 64, 66, 103, 67, 107, 73, 72, 128, 71, 73, 33, 42, 42, 65, 74, 75, 75, 103, 74, 107, 73, 82, 82, 84, 84, 105, 82, 136, 84, 74, 127, 75, 105, 177, 177, 136, 136, 42, 42, 42, 42, 42, 42, 42, 42, 50, 50, 105, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 58, 58, 125, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 70, 70, 83, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 81, 81, 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 87, 87, 69, 86, 68, 87, 89, 89, 178, 178, 48, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 93, 93, 142, 92, 45, 93, 94, 94, 142, 144, 142, 94, 44, 93, 93, 95, 95, 150, 43, 142, 95, 93, 96, 96, 144, 98, 98, 96, 95, 95, 98, 175, 150, 96, 40, 96, 96, 97, 97, 99, 99, 37, 97, 96, 99, 36, 175, 97, 100, 100, 97, 97, 206, 100, 101, 101, 101, 206, 102, 102, 101, 102, 101, 102, 104, 104, 102, 106, 176, 104, 14, 101, 106, 109, 109, 164, 164, 11, 109, 0, 164, 0, 106, 176, 106, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 134, 147, 148, 0, 137, 151, 138, 0, 134, 134, 137, 138, 137, 137, 138, 138, 134, 146, 147, 148, 137, 149, 151, 152, 146, 152, 149, 190, 0, 147, 148, 195, 155, 151, 156, 157, 149, 0, 149, 146, 152, 158, 190, 158, 147, 148, 195, 0, 151, 155, 0, 156, 157, 0, 166, 166, 169, 169, 158, 166, 155, 169, 156, 157, 185, 0, 187, 0, 187, 169, 169, 187, 185, 185, 0, 155, 0, 156, 157, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 170, 170, 0, 171, 171, 170, 171, 198, 171, 198, 0, 171, 225, 170, 170, 172, 172, 225, 172, 0, 172, 0, 198, 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, 174, 186, 174, 0, 174, 223, 223, 174, 0, 186, 186, 0, 0, 0, 0, 174, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 188, 188, 0, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, 205, 191, 205, 189, 193, 189, 0, 191, 189, 191, 193, 196, 193, 0, 199, 205, 189, 196, 191, 196, 199, 193, 199, 0, 201, 0, 0, 203, 196, 0, 201, 199, 201, 203, 232, 203, 232, 209, 209, 232, 0, 201, 209, 0, 203, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 210, 210, 0, 0, 0, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 213, 213, 215, 215, 0, 213, 0, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221, 221, 221, 0, 221, 0, 221, 222, 222, 221, 222, 0, 222, 0, 0, 222, 0, 221, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 233, 234, 0, 231, 249, 231, 239, 239, 231, 239, 249, 239, 249, 0, 239, 0, 231, 233, 234, 240, 240, 249, 240, 0, 240, 0, 0, 240, 233, 234, 245, 255, 255, 245, 255, 245, 255, 0, 245, 255, 0, 0, 0, 233, 234, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 242, 242, 242, 0, 242, 258, 242, 0, 258, 242, 258, 0, 0, 258, 0, 0, 0, 242, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247, 251, 0, 247, 0, 247, 0, 251, 247, 251, 0, 254, 254, 254, 0, 254, 247, 254, 251, 0, 254, 257, 257, 0, 0, 257, 0, 257, 254, 0, 257, 0, 0, 0, 0, 0, 0, 0, 257, 260, 260, 260, 260, 261, 261, 261, 261, 262, 262, 262, 262, 263, 0, 263, 263, 264, 264, 264, 264, 265, 265, 265, 265, 266, 0, 0, 266, 267, 267, 267, 267, 268, 0, 268, 268, 269, 269, 269, 269, 270, 270, 270, 270, 272, 0, 272, 272, 273, 273, 273, 273, 275, 275, 275, 275, 276, 276, 276, 276, 277, 277, 277, 277, 278, 278, 278, 278, 279, 279, 279, 279, 280, 280, 280, 280, 281, 281, 281, 281, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, 259 } ; static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; static char *yy_full_match; static int yy_lp; static int yy_looking_for_trail_begin = 0; static int yy_full_lp; static int *yy_full_state; #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 #define REJECT \ { \ *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ yy_cp = yy_full_match; /* restore poss. backed-over text */ \ yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \ yy_state_ptr = yy_full_state; /* restore orig. state */ \ yy_current_state = *yy_state_ptr; /* restore curr. state */ \ ++yy_lp; \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "control_lex.l" #define INITIAL 0 #line 2 "control_lex.l" /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * control_lex.l: * * * * flex (NOT lex!) source for control file lexer. * * * ****************************************************************************/ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include "control_parse.h" #include "scan.h" #include "scanner.h" #include "utils.h" #define YY_DECL int yy_orig_lex YY_PROTO(( void )) #define MAX_STRING 512 #define LINEBUFSIZE 4096 #ifndef YY_STACK_USED #define YY_STACK_USED 0 #endif #ifndef YY_ALWAYS_INTERACTIVE #define YY_ALWAYS_INTERACTIVE 0 #endif #ifndef YY_NEVER_INTERACTIVE #define YY_NEVER_INTERACTIVE 0 #endif #ifndef YY_MAIN #define YY_MAIN 0 #endif int lineno=1,lineno1=1,at_file,at_model,at_use,begin_comm; char linebuf[LINEBUFSIZE],linebuf1[LINEBUFSIZE]; static char *get_string(char *s,int size); static YY_BUFFER_STATE bufstate_list[MAX_INCLUDE]; char *fname_list[MAX_INCLUDE+1]; int list_ptr; static int tokenpos,stringbuf_ptr,ff_flag,ln_list[MAX_INCLUDE],ln1_list[MAX_INCLUDE]; static char stringbuf[MAX_STRING]; static void process_env_var(char *ptr); static void append_to_sbuf(int *sptr,char c); #define COMMENT 1 #define STR 2 #define ATFORMAT 3 #define ISTATE 4 #line 1076 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #ifdef __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 70 "control_lex.l" int token; #line 1234 "lex.yy.c" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_state_ptr = yy_state_buf; *yy_state_ptr++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 260 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 2204 ); yy_find_action: yy_current_state = *--yy_state_ptr; yy_lp = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[yy_lp]; if ( yy_act & YY_TRAILING_HEAD_MASK || yy_looking_for_trail_begin ) { if ( yy_act == yy_looking_for_trail_begin ) { yy_looking_for_trail_begin = 0; yy_act &= ~YY_TRAILING_HEAD_MASK; break; } } else if ( yy_act & YY_TRAILING_MASK ) { yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK; yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK; } else { yy_full_match = yy_cp; yy_full_state = yy_state_ptr; yy_full_lp = yy_lp; break; } ++yy_lp; goto find_rule; } --yy_cp; yy_current_state = *--yy_state_ptr; yy_lp = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(STR): case YY_STATE_EOF(ATFORMAT): case YY_STATE_EOF(ISTATE): #line 76 "control_lex.l" { if(iflag) { iflag=0; return BREAK; } if(--list_ptr<0) yyterminate(); else { free(fname_list[list_ptr+1]); yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(bufstate_list[list_ptr]); lineno=ln_list[list_ptr]; lineno1=ln1_list[list_ptr]; linebuf[0]=linebuf1[0]=0; } } YY_BREAK case 1: *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 92 "control_lex.l" { process_env_var(yytext); } YY_BREAK case 2: YY_RULE_SETUP #line 94 "control_lex.l" { (void)strncpy(linebuf,yytext,LINEBUFSIZE); (void)strcpy(linebuf1,linebuf); yyless((int)0); BEGIN ISTATE; } YY_BREAK case 3: YY_RULE_SETUP #line 101 "control_lex.l" {tokenpos+=yyleng;} YY_BREAK case 4: YY_RULE_SETUP #line 103 "control_lex.l" { lineno++; tokenpos=0; (void)strncpy(linebuf,yytext+1,LINEBUFSIZE); yyless((int)1); } YY_BREAK case 5: YY_RULE_SETUP #line 110 "control_lex.l" BEGIN(COMMENT); YY_BREAK case 6: YY_RULE_SETUP #line 111 "control_lex.l" {tokenpos+=yyleng;} YY_BREAK case 7: YY_RULE_SETUP #line 112 "control_lex.l" {lineno++; tokenpos=0;} YY_BREAK case 8: YY_RULE_SETUP #line 113 "control_lex.l" {BEGIN(ISTATE); tokenpos+=yyleng;} YY_BREAK case 9: *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 115 "control_lex.l" ; YY_BREAK case 10: YY_RULE_SETUP #line 117 "control_lex.l" { stringbuf_ptr=0; BEGIN(STR); tokenpos+=yyleng; } YY_BREAK case 11: YY_RULE_SETUP #line 121 "control_lex.l" { BEGIN(ISTATE); append_to_sbuf(&stringbuf_ptr,'\0'); yylval.string=get_string(stringbuf,stringbuf_ptr); tokenpos+=yyleng; return STRING; } YY_BREAK case 12: YY_RULE_SETUP #line 129 "control_lex.l" { BEGIN(ISTATE); append_to_sbuf(&stringbuf_ptr,'\0'); print_scan_warn("Line %d: Warning - Unterminanted string\n",lineno); tokenpos+=yyleng; yylval.string=get_string(stringbuf,stringbuf_ptr); return STRING; } YY_BREAK case 13: YY_RULE_SETUP #line 136 "control_lex.l" { unsigned int result; (void) sscanf(yytext+1,"%uo",&result); tokenpos+=yyleng; if(result>0xff) print_scan_err("Line %d: Error - Octal constant too large\n",lineno); append_to_sbuf(&stringbuf_ptr,(char)result); } YY_BREAK case 14: YY_RULE_SETUP #line 142 "control_lex.l" { unsigned int result; (void) sscanf(yytext+1,"%ux",&result); tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,(char)result); } YY_BREAK case 15: YY_RULE_SETUP #line 147 "control_lex.l" { tokenpos+=yyleng; print_scan_err("Line %d: Error - Syntax error in escape sequence\n",lineno); } YY_BREAK case 16: YY_RULE_SETUP #line 150 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\a'); } YY_BREAK case 17: YY_RULE_SETUP #line 153 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\b'); } YY_BREAK case 18: YY_RULE_SETUP #line 156 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\f'); } YY_BREAK case 19: YY_RULE_SETUP #line 159 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\n'); } YY_BREAK case 20: YY_RULE_SETUP #line 162 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\r'); } YY_BREAK case 21: YY_RULE_SETUP #line 165 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\t'); } YY_BREAK case 22: YY_RULE_SETUP #line 168 "control_lex.l" { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\v'); } YY_BREAK case 23: YY_RULE_SETUP #line 171 "control_lex.l" { tokenpos++; append_to_sbuf(&stringbuf_ptr,'\a'); } YY_BREAK case 24: YY_RULE_SETUP #line 174 "control_lex.l" { char *ss=yytext; tokenpos+=yyleng; while(*ss) append_to_sbuf(&stringbuf_ptr,*ss++); } YY_BREAK case 25: YY_RULE_SETUP #line 178 "control_lex.l" { if(at_file) BEGIN ATFORMAT; tokenpos+=yyleng; return '['; } YY_BREAK case 26: YY_RULE_SETUP #line 182 "control_lex.l" { if(at_file) BEGIN ISTATE; tokenpos+=yyleng; return ']'; } YY_BREAK case 27: YY_RULE_SETUP #line 186 "control_lex.l" { tokenpos+=yyleng; return('x'); } YY_BREAK case 28: YY_RULE_SETUP #line 188 "control_lex.l" { tokenpos+=yyleng; return('y'); } YY_BREAK case 29: YY_RULE_SETUP #line 190 "control_lex.l" { return LEQSYMBOL; } YY_BREAK case 30: YY_RULE_SETUP #line 192 "control_lex.l" { return GEQSYMBOL; } YY_BREAK case 31: YY_RULE_SETUP #line 194 "control_lex.l" { return NEQSYMBOL; } YY_BREAK case 32: YY_RULE_SETUP #line 196 "control_lex.l" { return '='; } YY_BREAK case 33: YY_RULE_SETUP #line 198 "control_lex.l" { return ORSYMBOL; } YY_BREAK case 34: YY_RULE_SETUP #line 200 "control_lex.l" { return ANDSYMBOL; } YY_BREAK case 35: YY_RULE_SETUP #line 202 "control_lex.l" { return NOTSYMBOL; } YY_BREAK case 36: YY_RULE_SETUP #line 204 "control_lex.l" { return SKIPFORMAT; } YY_BREAK case 37: YY_RULE_SETUP #line 205 "control_lex.l" { if(at_file) return SKIPFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=SKIPFORMAT; ff_flag^=1; return token; } YY_BREAK case 38: YY_RULE_SETUP #line 210 "control_lex.l" { return RSFORMAT; } YY_BREAK case 39: YY_RULE_SETUP #line 211 "control_lex.l" { if(at_file) return RSFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=RSFORMAT; ff_flag^=1; return token; } YY_BREAK case 40: YY_RULE_SETUP #line 216 "control_lex.l" { return GSFORMAT; } YY_BREAK case 41: YY_RULE_SETUP #line 217 "control_lex.l" { if(at_file) return GSFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=GSFORMAT; ff_flag^=1; return token; } YY_BREAK case 42: YY_RULE_SETUP #line 223 "control_lex.l" { return FSFORMAT; } YY_BREAK case 43: YY_RULE_SETUP #line 224 "control_lex.l" { if(at_file) return FSFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=FSFORMAT; ff_flag^=1; return token; } YY_BREAK case 44: YY_RULE_SETUP #line 230 "control_lex.l" { token=symbol_lookup(yytext,1); if(token==BREAK) yyless(0); else { tokenpos+=yyleng; if(!at_model && !at_use && (token==VARIABLE || token==ARRAY_VAR)) token=ASSIGN; } if((!at_model && !at_use) || token!=BREAK) return token; } YY_BREAK case 45: YY_RULE_SETUP #line 241 "control_lex.l" { token=symbol_lookup(yytext,0); if(token==BREAK) yyless(0); else tokenpos+=yyleng; return token; } YY_BREAK case 46: YY_RULE_SETUP #line 247 "control_lex.l" { tokenpos+=yyleng; yylval.rvalue=atof(yytext); return REAL; } YY_BREAK case 47: YY_RULE_SETUP #line 250 "control_lex.l" { tokenpos+=yyleng; yylval.value=atoi(yytext); return INTEGER; } YY_BREAK case 48: YY_RULE_SETUP #line 252 "control_lex.l" { tokenpos+=yyleng; return yytext[0]; } YY_BREAK case 49: YY_RULE_SETUP #line 254 "control_lex.l" ECHO; YY_BREAK #line 1686 "lex.yy.c" case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; yy_state_ptr = yy_state_buf; *yy_state_ptr++ = yy_current_state; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 260 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *yy_state_ptr++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 260 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 259); if ( ! yy_is_jam ) *yy_state_ptr++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif errno = oerrno; } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 254 "control_lex.l" /*"*/ int yywrap(void) { return 1; } void yyerror(char *s) { int i; if(loop_record== -1) { print_scan_err("File %s, line %d: %s\n",fname_list[list_ptr],lineno,s); loop_record= -2; } else if(loop_record>=0) { print_scan_err("File %s, line %d: %s\n%s\n",fname_list[list_ptr],lineno,s,linebuf); if(scan_error_n<=max_scan_errors && linebuf[0]) { for(i=1;i=0) print_scan_err("File %s, line %d: %s\n%s\n",fname_list[list_ptr],lineno1,s,linebuf1); scan_error|=SCAN_ERR; } void include_control_file(char *fname) { FILE *fptr; YY_BUFFER_STATE ystate; int i,j; struct stat st1,st2; if(fname) { if(!fname[0]) yyerror1("Null filename from INCLUDE command\n"); if(stat(fname,&st1)) { (void)fprintf(stderr,"File: %s\n",fname); yyerror1("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } for(i=0;i<=list_ptr;i++) { if(stat(fname_list[i],&st2)) { (void)fprintf(stderr,"File: %s\n",fname_list[i]); yyerror1("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } if(st1.st_ino==st2.st_ino && st1.st_dev==st2.st_dev) { for(j=0;j<=list_ptr;j++) { if(j==i) (void)fprintf(stderr,"*%s* -> ",fname_list[j]); else (void)fprintf(stderr,"%s -> ",fname_list[j]); } (void)fprintf(stderr,"%s\n",fname); yyerror1("Recursive include files!\n"); exit(EXIT_FAILURE); } } if(list_ptr=MAX_STRING) print_scan_err("Line %d: Maximum string size exceeded",lineno); stringbuf[(*sptr)++]=c; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_string" static char *get_string(char *s,int size) { char *s1; if(!(s1=malloc(size))) ABT_FUNC(MMsg); (void)memcpy(s1,s,size); return s1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "yylex" int yylex(void) { int tok,i; if(loop_record==1) { tok=yy_orig_lex(); if(!loop_stack) { if(!(loop_stack=malloc(sizeof(struct token_store)*loop_stack_size))) ABT_FUNC(MMsg); loop_main_ptr=0; } else if(loop_main_ptr==loop_stack_size) { loop_stack_size*=2; if(!(loop_stack=realloc(loop_stack,sizeof(struct token_store)*loop_stack_size))) ABT_FUNC(MMsg); } loop_stack[loop_main_ptr].line=lineno; loop_stack[loop_main_ptr].line1=lineno1; loop_stack[loop_main_ptr].yylval=yylval; if(tok==STRING) yylval.string=copy_string(yylval.string); loop_stack[loop_main_ptr++].token=tok; return tok; } else if(loop_record<0) { if(in_loopclause== -1) { in_loopclause= -2; return LOOP_CLAUSE_START; } yylval=loop_stack[loop_main_ptr].yylval; lineno=loop_stack[loop_main_ptr].line; lineno1=loop_stack[loop_main_ptr].line1; tok=loop_stack[loop_main_ptr++].token; if(tok==STRING) yylval.string=copy_string(yylval.string); if(in_loopclause) { if(tok==',' && loop_stack[loop_main_ptr].token==BREAK) { loop_clause_element->arg.value+=loop_clause_step; if(loop_clause_element->arg.value==loop_clause_end) i=0; else { i=(loop_clause_element->arg.value>loop_clause_end); if(loop_clause_step<0) i=1-i; } if(i) { loop_record=loop_stat[--loop_level]; if(!loop_record) loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; else loop_main_ptr=loop_clause_ptr; in_loopclause=0; return LOOP_CLAUSE_END; } else loop_main_ptr=loop_ptr[loop_level-1]; } } return tok; } /* Dummy call to shut up compiler warnings about yy_flex_realloc() not being used */ if(0) (void)yy_flex_realloc(0,0); return yy_orig_lex(); } void yy_cleanup(void) { yy_delete_buffer(yy_current_buffer); if(loop_stack) free(loop_stack); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "process_env_var" static void process_env_var(char *ptr) { int i=0,j,k,size=512,brack; char *s,old,*stringptr; if(!(stringptr=malloc(size))) ABT_FUNC(MMsg); for(;;) { while(*ptr && *ptr!='$') { if(i>=size) { size+=size; if(!(stringptr=realloc(stringptr,size))) ABT_FUNC(MMsg); } stringptr[i++] = *(ptr++); } if(!(*ptr)) break; ptr++; j=0; brack=0; if(*ptr=='(') { ptr++; while(ptr[j] && ptr[j]!=')') j++; if(ptr[j]==')') brack=1; } else { while(isalnum((int)ptr[j]) || ptr[j]=='_') j++; } old=ptr[j]; ptr[j]=0; if((s=getenv(ptr))) { if((k=strlen(s))) { if(k+i>=size) { while(k+i>size) size+=size; if(!(stringptr=realloc(stringptr,size))) ABT_FUNC(MMsg); } (void)memcpy(stringptr+i,s,k); i+=k; } } ptr[j]=old; ptr+=j+brack; } while(i) unput(stringptr[--i]); free(stringptr); } loki/prepsrc/control_lex.l0100644000076500007650000003041407646742735015204 0ustar heathheath%{ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * control_lex.l: * * * * flex (NOT lex!) source for control file lexer. * * * ****************************************************************************/ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include "control_parse.h" #include "scan.h" #include "scanner.h" #include "utils.h" #define YY_DECL int yy_orig_lex YY_PROTO(( void )) #define MAX_STRING 512 #define LINEBUFSIZE 4096 #ifndef YY_STACK_USED #define YY_STACK_USED 0 #endif #ifndef YY_ALWAYS_INTERACTIVE #define YY_ALWAYS_INTERACTIVE 0 #endif #ifndef YY_NEVER_INTERACTIVE #define YY_NEVER_INTERACTIVE 0 #endif #ifndef YY_MAIN #define YY_MAIN 0 #endif int lineno=1,lineno1=1,at_file,at_model,at_use,begin_comm; char linebuf[LINEBUFSIZE],linebuf1[LINEBUFSIZE]; static char *get_string(char *s,int size); static YY_BUFFER_STATE bufstate_list[MAX_INCLUDE]; char *fname_list[MAX_INCLUDE+1]; int list_ptr; static int tokenpos,stringbuf_ptr,ff_flag,ln_list[MAX_INCLUDE],ln1_list[MAX_INCLUDE]; static char stringbuf[MAX_STRING]; static void process_env_var(char *ptr); static void append_to_sbuf(int *sptr,char c); %} nl (\r\n|\n|\r) %x COMMENT %x STR %s ATFORMAT %s ISTATE %% %{ int token; %} <> { if(iflag) { iflag=0; return BREAK; } if(--list_ptr<0) yyterminate(); else { free(fname_list[list_ptr+1]); yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(bufstate_list[list_ptr]); lineno=ln_list[list_ptr]; lineno1=ln1_list[list_ptr]; linebuf[0]=linebuf1[0]=0; } } {nl}?.*(\$[a-zA-Z][a-zA-Z0-9_]*)+.*$ { process_env_var(yytext); } .*{nl} { (void)strncpy(linebuf,yytext,LINEBUFSIZE); (void)strcpy(linebuf1,linebuf); yyless((int)0); BEGIN ISTATE; } [\t ] {tokenpos+=yyleng;} {nl}.* { lineno++; tokenpos=0; (void)strncpy(linebuf,yytext+1,LINEBUFSIZE); yyless((int)1); } "/*" BEGIN(COMMENT); . {tokenpos+=yyleng;} {nl} {lineno++; tokenpos=0;} "*/" {BEGIN(ISTATE); tokenpos+=yyleng;} #.*$ ; [\"\'] { stringbuf_ptr=0; BEGIN(STR); tokenpos+=yyleng; } [\"\'] { BEGIN(ISTATE); append_to_sbuf(&stringbuf_ptr,'\0'); yylval.string=get_string(stringbuf,stringbuf_ptr); tokenpos+=yyleng; return STRING; } {nl} { BEGIN(ISTATE); append_to_sbuf(&stringbuf_ptr,'\0'); print_scan_warn("Line %d: Warning - Unterminanted string\n",lineno); tokenpos+=yyleng; yylval.string=get_string(stringbuf,stringbuf_ptr); return STRING; } \\[0-7]{1,3} { unsigned int result; (void) sscanf(yytext+1,"%uo",&result); tokenpos+=yyleng; if(result>0xff) print_scan_err("Line %d: Error - Octal constant too large\n",lineno); append_to_sbuf(&stringbuf_ptr,(char)result); } \\x[a-fA-F0-9]{1,2} { unsigned int result; (void) sscanf(yytext+1,"%ux",&result); tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,(char)result); } \\[0-9]+ { tokenpos+=yyleng; print_scan_err("Line %d: Error - Syntax error in escape sequence\n",lineno); } \\a { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\a'); } \\b { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\b'); } \\f { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\f'); } \\n { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\n'); } \\r { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\r'); } \\t { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\t'); } \\v { tokenpos+=yyleng; append_to_sbuf(&stringbuf_ptr,'\v'); } \\(.|\n) { tokenpos++; append_to_sbuf(&stringbuf_ptr,'\a'); } [^\\\n\r\"\']+ { char *ss=yytext; tokenpos+=yyleng; while(*ss) append_to_sbuf(&stringbuf_ptr,*ss++); } \[ { if(at_file) BEGIN ATFORMAT; tokenpos+=yyleng; return '['; } \] { if(at_file) BEGIN ISTATE; tokenpos+=yyleng; return ']'; } [xX] { tokenpos+=yyleng; return('x'); } [yY] { tokenpos+=yyleng; return('y'); } "<=" { return LEQSYMBOL; } ">=" { return GEQSYMBOL; } "!="|"<>" { return NEQSYMBOL; } "==" { return '='; } \||[Oo][Rr]|\|\| { return ORSYMBOL; } &|[Aa][Nn][Dd]|&& { return ANDSYMBOL; } !|[Nn][Oo][Tt] { return NOTSYMBOL; } [Ss][Kk][Ii][Pp][ \t]*= { return SKIPFORMAT; } [Ss][Kk][Ii][Pp][ \t]*= { if(at_file) return SKIPFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=SKIPFORMAT; ff_flag^=1; return token; } [Rr][Ss][ \t]*= { return RSFORMAT; } [Rr][Ss][ \t]*= { if(at_file) return RSFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=RSFORMAT; ff_flag^=1; return token; } [Gg][Ss][ \t]*= { return GSFORMAT; } [Gg][Ss][ \t]*= { if(at_file) return GSFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=GSFORMAT; ff_flag^=1; return token; } [Ff][Ss][ \t]*= { return FSFORMAT; } [Ff][Ss][ \t]*= { if(at_file) return FSFORMAT; if(!ff_flag) {yyless(0); token=BREAK;} else token=FSFORMAT; ff_flag^=1; return token; } [a-zA-Z_][a-zA-Z0-9_]*/([\t ]*=)|([\t ]*\([^\n\"']*\)[\t ]*=) { token=symbol_lookup(yytext,1); if(token==BREAK) yyless(0); else { tokenpos+=yyleng; if(!at_model && !at_use && (token==VARIABLE || token==ARRAY_VAR)) token=ASSIGN; } if((!at_model && !at_use) || token!=BREAK) return token; } [a-zA-Z][a-zA-Z0-9_]* { token=symbol_lookup(yytext,0); if(token==BREAK) yyless(0); else tokenpos+=yyleng; return token; } ([0-9]*\.[0-9]+)|(([0-9]+|([0-9]*\.[0-9]+))E[-+]?[0-9]+) { tokenpos+=yyleng; yylval.rvalue=atof(yytext); return REAL; } [0-9]+ { tokenpos+=yyleng; yylval.value=atoi(yytext); return INTEGER; } . { tokenpos+=yyleng; return yytext[0]; } %% /*"*/ int yywrap(void) { return 1; } void yyerror(char *s) { int i; if(loop_record== -1) { print_scan_err("File %s, line %d: %s\n",fname_list[list_ptr],lineno,s); loop_record= -2; } else if(loop_record>=0) { print_scan_err("File %s, line %d: %s\n%s\n",fname_list[list_ptr],lineno,s,linebuf); if(scan_error_n<=max_scan_errors && linebuf[0]) { for(i=1;i=0) print_scan_err("File %s, line %d: %s\n%s\n",fname_list[list_ptr],lineno1,s,linebuf1); scan_error|=SCAN_ERR; } void include_control_file(char *fname) { FILE *fptr; YY_BUFFER_STATE ystate; int i,j; struct stat st1,st2; if(fname) { if(!fname[0]) yyerror1("Null filename from INCLUDE command\n"); if(stat(fname,&st1)) { (void)fprintf(stderr,"File: %s\n",fname); yyerror1("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } for(i=0;i<=list_ptr;i++) { if(stat(fname_list[i],&st2)) { (void)fprintf(stderr,"File: %s\n",fname_list[i]); yyerror1("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } if(st1.st_ino==st2.st_ino && st1.st_dev==st2.st_dev) { for(j=0;j<=list_ptr;j++) { if(j==i) (void)fprintf(stderr,"*%s* -> ",fname_list[j]); else (void)fprintf(stderr,"%s -> ",fname_list[j]); } (void)fprintf(stderr,"%s\n",fname); yyerror1("Recursive include files!\n"); exit(EXIT_FAILURE); } } if(list_ptr=MAX_STRING) print_scan_err("Line %d: Maximum string size exceeded",lineno); stringbuf[(*sptr)++]=c; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_string" static char *get_string(char *s,int size) { char *s1; if(!(s1=malloc(size))) ABT_FUNC(MMsg); (void)memcpy(s1,s,size); return s1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "yylex" int yylex(void) { int tok,i; if(loop_record==1) { tok=yy_orig_lex(); if(!loop_stack) { if(!(loop_stack=malloc(sizeof(struct token_store)*loop_stack_size))) ABT_FUNC(MMsg); loop_main_ptr=0; } else if(loop_main_ptr==loop_stack_size) { loop_stack_size*=2; if(!(loop_stack=realloc(loop_stack,sizeof(struct token_store)*loop_stack_size))) ABT_FUNC(MMsg); } loop_stack[loop_main_ptr].line=lineno; loop_stack[loop_main_ptr].line1=lineno1; loop_stack[loop_main_ptr].yylval=yylval; if(tok==STRING) yylval.string=copy_string(yylval.string); loop_stack[loop_main_ptr++].token=tok; return tok; } else if(loop_record<0) { if(in_loopclause== -1) { in_loopclause= -2; return LOOP_CLAUSE_START; } yylval=loop_stack[loop_main_ptr].yylval; lineno=loop_stack[loop_main_ptr].line; lineno1=loop_stack[loop_main_ptr].line1; tok=loop_stack[loop_main_ptr++].token; if(tok==STRING) yylval.string=copy_string(yylval.string); if(in_loopclause) { if(tok==',' && loop_stack[loop_main_ptr].token==BREAK) { loop_clause_element->arg.value+=loop_clause_step; if(loop_clause_element->arg.value==loop_clause_end) i=0; else { i=(loop_clause_element->arg.value>loop_clause_end); if(loop_clause_step<0) i=1-i; } if(i) { loop_record=loop_stat[--loop_level]; if(!loop_record) loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; else loop_main_ptr=loop_clause_ptr; in_loopclause=0; return LOOP_CLAUSE_END; } else loop_main_ptr=loop_ptr[loop_level-1]; } } return tok; } /* Dummy call to shut up compiler warnings about yy_flex_realloc() not being used */ if(0) (void)yy_flex_realloc(0,0); return yy_orig_lex(); } void yy_cleanup(void) { yy_delete_buffer(yy_current_buffer); if(loop_stack) free(loop_stack); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "process_env_var" static void process_env_var(char *ptr) { int i=0,j,k,size=512,brack; char *s,old,*stringptr; if(!(stringptr=malloc(size))) ABT_FUNC(MMsg); for(;;) { while(*ptr && *ptr!='$') { if(i>=size) { size+=size; if(!(stringptr=realloc(stringptr,size))) ABT_FUNC(MMsg); } stringptr[i++] = *(ptr++); } if(!(*ptr)) break; ptr++; j=0; brack=0; if(*ptr=='(') { ptr++; while(ptr[j] && ptr[j]!=')') j++; if(ptr[j]==')') brack=1; } else { while(isalnum((int)ptr[j]) || ptr[j]=='_') j++; } old=ptr[j]; ptr[j]=0; if((s=getenv(ptr))) { if((k=strlen(s))) { if(k+i>=size) { while(k+i>size) size+=size; if(!(stringptr=realloc(stringptr,size))) ABT_FUNC(MMsg); } (void)memcpy(stringptr+i,s,k); i+=k; } } ptr[j]=old; ptr+=j+brack; } while(i) unput(stringptr[--i]); free(stringptr); } loki/prepsrc/control_parse.c0100644000076500007650000041045607747752271015523 0ustar heathheath/* A Bison parser, made from control_parse.y, by GNU bison 1.75. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { FILEC = 258, MARKER = 259, LOCUS = 260, TRAIT = 261, RANDOM = 262, PEDIGREE = 263, LOG = 264, MODEL = 265, FILTER = 266, LINK = 267, MISSING = 268, FACTOR = 269, BREAK = 270, DOLOOP = 271, WHILE = 272, USE = 273, WHERE = 274, ORSYMBOL = 275, ANDSYMBOL = 276, NEQSYMBOL = 277, LEQSYMBOL = 278, GEQSYMBOL = 279, NOTSYMBOL = 280, LOGICAL = 281, SHELL = 282, ARRAY = 283, PRINTEXP = 284, INCLUDE = 285, RAWOUTPUT = 286, LOOP_CLAUSE_START = 287, LOOP_CLAUSE_END = 288, CONSTANT = 289, MULTIPLE = 290, RSFORMAT = 291, FSFORMAT = 292, SKIPFORMAT = 293, GSFORMAT = 294, CENSORED = 295, GROUP = 296, SET = 297, GENDER = 298, AFFECTED = 299, OUTPUT = 300, ERRORDIR = 301, LAUROUTPUT = 302, UNAFFECTED = 303, POSITION = 304, FREQUENCY = 305, STRING = 306, VARIABLE = 307, ASSIGN = 308, ARRAY_VAR = 309, INTEGER = 310, SYSTEM_VAR = 311, REAL = 312, UMINUS = 313 }; #endif #define FILEC 258 #define MARKER 259 #define LOCUS 260 #define TRAIT 261 #define RANDOM 262 #define PEDIGREE 263 #define LOG 264 #define MODEL 265 #define FILTER 266 #define LINK 267 #define MISSING 268 #define FACTOR 269 #define BREAK 270 #define DOLOOP 271 #define WHILE 272 #define USE 273 #define WHERE 274 #define ORSYMBOL 275 #define ANDSYMBOL 276 #define NEQSYMBOL 277 #define LEQSYMBOL 278 #define GEQSYMBOL 279 #define NOTSYMBOL 280 #define LOGICAL 281 #define SHELL 282 #define ARRAY 283 #define PRINTEXP 284 #define INCLUDE 285 #define RAWOUTPUT 286 #define LOOP_CLAUSE_START 287 #define LOOP_CLAUSE_END 288 #define CONSTANT 289 #define MULTIPLE 290 #define RSFORMAT 291 #define FSFORMAT 292 #define SKIPFORMAT 293 #define GSFORMAT 294 #define CENSORED 295 #define GROUP 296 #define SET 297 #define GENDER 298 #define AFFECTED 299 #define OUTPUT 300 #define ERRORDIR 301 #define LAUROUTPUT 302 #define UNAFFECTED 303 #define POSITION 304 #define FREQUENCY 305 #define STRING 306 #define VARIABLE 307 #define ASSIGN 308 #define ARRAY_VAR 309 #define INTEGER 310 #define SYSTEM_VAR 311 #define REAL 312 #define UMINUS 313 /* Copy the first part of user declarations. */ #line 1 "control_parse.y" /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * control_parse.y: * * * * yacc source for control file parser. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include "utils.h" #ifndef YYDEBUG #define YYDEBUG 0 #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 0 #endif #ifndef __GNUC__ #define __GNUC__ 0 #endif /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif #ifndef YYSTYPE #line 44 "control_parse.y" typedef union { char *string; struct bin_node *var; int value; double rvalue; struct format_clause *format_clause; struct fformat *fformat; struct format_atom *f_atom; struct model_list *model_list; struct var_list *var_list; struct var_element *element; struct express *express; } yystype; /* Line 193 of /usr/local/share/bison/yacc.c. */ #line 245 "y.tab.c" # define YYSTYPE yystype # define YYSTYPE_IS_TRIVIAL 1 #endif #ifndef YYLTYPE typedef struct yyltype { int first_line; int first_column; int last_line; int last_column; } yyltype; # define YYLTYPE yyltype # define YYLTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ #line 90 "control_parse.y" #include "scan.h" #include "scanner.h" static struct format_atom *make_f_atom(int,int); static struct format_clause *add_f_atom(struct format_clause *,struct format_atom *); static struct format_clause *add_f_list(struct format_clause *,struct format_clause *,int); static struct format *setup_format(struct format_clause *); static struct bin_node *create_var(char *); static struct model_list *add_to_model(struct model_list *,struct var_list *); static struct var_list *add_to_var_list(struct var_list *,struct bin_node *,struct express *); static struct var_list *add_var_lists(struct var_list *,struct var_list *); static struct var_element *get_element(struct bin_node *,struct express *); static struct var_element *assign_var(struct bin_node *,struct express *,struct express *); static struct express *alloc_express(void); static struct express *do_express_op(struct express *,struct express *,int); static struct express *do_logical_op(struct express *,struct express *,int); static struct fformat *add_fformat(struct fformat *,struct fformat *); static struct fformat *create_fformat(void *,int); static void begin_looping(struct var_element *, struct express *, struct express *); static void free_vlist(struct var_list *); static void do_ped_com(struct var_list *); static void add_restriction(struct var_list *); static void add_censored(struct var_element *,const int); static void do_file_com(char *,struct format_clause *,struct fformat *,struct var_list *); static void set_locus_array(struct bin_node *); static void set_locus_element(struct var_element *); static void set_haplo_element(struct var_element *,struct var_element *); static void do_link_com(char *s,int type, struct var_list *); static void do_missing_com(struct express *,struct var_list *,char *); static void change_type(int,struct var_list *); static void do_model_com(struct model_list *,struct bin_node *,struct express *); static void add_operation(void *,int,int); static void set_array_var(struct scan_data *,struct express *); static void check_element_add_op(struct var_element *); static void enter_loop(void); static void start_loopclause(void); static void do_while_com(struct express *); static void print_exp(struct express *); static void new_command(void); static void set_sex(struct var_element *,struct express *,struct express *); static void set_group(struct var_element *); static int count_var_list(struct var_list *),shell_flag; static struct format_atom *f_atom_list; static struct var_element *pedlist[4]; static int f_atom_n,f_atom_size=32,pedflag; struct operation *Affected,*Unaffected; struct bin_node *root_var; struct InFile *Infiles; struct Link *links; struct Miss *Miss; struct Restrict *Restrictions; struct Censor *Censored; struct model *Models; static struct operation *Op_List; struct Marker *markers,*traitlocus; static struct var_element *hap_list[2]; struct express *sex_exp[2]; struct sex_def *sex_def; struct var_element *group_elem; static char *string_copy(char *s1,char *s2); static char *LogFile; int scan_error,scan_error_n,scan_warn_n; int max_scan_errors=30,max_scan_warnings=30,n_markers,iflag,file_skip; char *Filter,*ErrorDir,*rsformat,*fsformat,*gsformat,*OutputFile,*OutputRawFile,*OutputLaurFile; int loop_level,loop_ptr[MAX_LOOP],loop_stat[MAX_LOOP],loop_record,loop_stack_size=256; int loop_main_ptr,in_loopclause,loop_clause_end,loop_clause_step,loop_clause_ptr; int syst_var[NUM_SYSTEM_VAR]; int family_id; struct var_element *loop_clause_element; struct token_store *loop_stack; /* Line 213 of /usr/local/share/bison/yacc.c. */ #line 340 "y.tab.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # else # ifndef YYSTACK_USE_ALLOCA # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAX) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined (__STDC__) || defined (__cplusplus) typedef signed char yysigned_char; #else typedef short yysigned_char; #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 133 #define YYLAST 838 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 75 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 58 /* YYNRULES -- Number of rules. */ #define YYNRULES 195 /* YYNRULES -- Number of states. */ #define YYNSTATES 388 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 313 #define YYTRANSLATE(X) \ ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 67, 68, 63, 61, 69, 62, 64, 65, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 72, 59, 58, 60, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 70, 2, 71, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 73, 74, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 66 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short yyprhs[] = { 0, 0, 3, 5, 7, 10, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 74, 81, 83, 85, 87, 89, 93, 97, 101, 105, 108, 112, 116, 120, 122, 123, 127, 134, 140, 146, 152, 157, 159, 163, 167, 171, 175, 179, 183, 187, 191, 194, 197, 199, 203, 206, 209, 212, 215, 218, 223, 230, 237, 243, 250, 255, 257, 259, 261, 263, 267, 271, 275, 279, 283, 286, 290, 294, 298, 302, 306, 310, 314, 318, 321, 326, 334, 342, 344, 349, 351, 355, 360, 367, 369, 373, 377, 380, 383, 386, 389, 391, 394, 396, 399, 401, 404, 407, 410, 413, 416, 419, 423, 428, 434, 437, 441, 445, 448, 451, 454, 457, 460, 463, 465, 470, 475, 478, 483, 486, 489, 494, 502, 505, 509, 513, 515, 517, 521, 525, 529, 533, 535, 537, 539, 541, 546, 548, 553, 555, 559, 562, 564, 566, 570, 576, 580, 582, 586, 588, 597, 608, 613, 615, 616, 618, 620, 625, 627, 629, 633, 637, 639, 641, 645, 649, 651, 655, 659, 661, 663, 667 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { 76, 0, -1, 77, -1, 1, -1, 76, 15, -1, 76, 15, 77, -1, 76, 15, 1, -1, 98, -1, 113, -1, 83, -1, 104, -1, 108, -1, 109, -1, 110, -1, 112, -1, 114, -1, 107, -1, 95, -1, 96, -1, 78, -1, 93, -1, 90, -1, 82, -1, 88, -1, 85, -1, 86, -1, 115, -1, 81, -1, 92, -1, 87, -1, 105, -1, 106, -1, 79, -1, 53, 58, 80, -1, 53, 67, 80, 68, 58, 80, -1, 57, -1, 55, -1, 51, -1, 120, -1, 80, 61, 80, -1, 80, 62, 80, -1, 80, 63, 80, -1, 80, 65, 80, -1, 62, 80, -1, 67, 80, 68, -1, 42, 56, 55, -1, 42, 118, 55, -1, 16, -1, -1, 30, 84, 132, -1, 40, 120, 19, 67, 97, 68, -1, 44, 19, 67, 97, 68, -1, 48, 19, 67, 97, 68, -1, 43, 120, 80, 69, 80, -1, 17, 67, 89, 68, -1, 80, -1, 89, 58, 89, -1, 89, 22, 89, -1, 89, 23, 89, -1, 89, 24, 89, -1, 89, 59, 89, -1, 89, 60, 89, -1, 89, 20, 89, -1, 89, 21, 89, -1, 25, 89, -1, 29, 91, -1, 80, -1, 91, 69, 80, -1, 36, 132, -1, 37, 132, -1, 39, 132, -1, 38, 55, -1, 28, 94, -1, 52, 67, 80, 68, -1, 94, 69, 52, 67, 80, 68, -1, 18, 130, 19, 67, 97, 68, -1, 18, 19, 67, 97, 68, -1, 19, 67, 97, 68, 18, 130, -1, 19, 67, 97, 68, -1, 55, -1, 57, -1, 51, -1, 120, -1, 97, 61, 97, -1, 97, 62, 97, -1, 97, 63, 97, -1, 97, 65, 97, -1, 67, 97, 68, -1, 62, 97, -1, 97, 58, 97, -1, 97, 22, 97, -1, 97, 23, 97, -1, 97, 24, 97, -1, 97, 59, 97, -1, 97, 60, 97, -1, 97, 20, 97, -1, 97, 21, 97, -1, 25, 97, -1, 3, 99, 69, 129, -1, 3, 70, 100, 71, 99, 69, 129, -1, 3, 70, 101, 71, 99, 69, 129, -1, 132, -1, 27, 67, 132, 68, -1, 103, -1, 100, 69, 103, -1, 55, 67, 100, 68, -1, 100, 69, 55, 67, 100, 68, -1, 102, -1, 101, 69, 102, -1, 101, 72, 102, -1, 37, 132, -1, 36, 132, -1, 39, 132, -1, 38, 55, -1, 55, -1, 55, 73, -1, 73, -1, 55, 1, -1, 1, -1, 9, 132, -1, 45, 132, -1, 47, 132, -1, 31, 132, -1, 46, 132, -1, 13, 80, -1, 13, 80, 130, -1, 13, 80, 69, 130, -1, 13, 70, 132, 71, 80, -1, 8, 130, -1, 4, 5, 121, -1, 6, 5, 130, -1, 34, 130, -1, 35, 130, -1, 7, 130, -1, 14, 130, -1, 57, 130, -1, 55, 130, -1, 12, -1, 12, 70, 73, 71, -1, 12, 70, 74, 71, -1, 111, 130, -1, 111, 131, 69, 130, -1, 111, 131, -1, 11, 132, -1, 10, 118, 58, 116, -1, 10, 54, 67, 80, 68, 58, 116, -1, 41, 120, -1, 116, 61, 119, -1, 116, 61, 117, -1, 117, -1, 119, -1, 119, 63, 119, -1, 119, 64, 119, -1, 117, 63, 119, -1, 117, 64, 119, -1, 52, -1, 43, -1, 118, -1, 54, -1, 54, 67, 80, 68, -1, 118, -1, 54, 67, 80, 68, -1, 122, -1, 121, 69, 122, -1, 120, 123, -1, 120, -1, 54, -1, 70, 120, 71, -1, 70, 120, 69, 120, 71, -1, 70, 1, 71, -1, 119, -1, 124, 69, 119, -1, 67, -1, 125, 124, 69, 15, 79, 69, 80, 68, -1, 125, 124, 69, 15, 79, 69, 80, 69, 80, 68, -1, 126, 32, 124, 33, -1, 126, -1, -1, 118, -1, 54, -1, 54, 67, 80, 68, -1, 128, -1, 127, -1, 129, 69, 128, -1, 129, 69, 127, -1, 119, -1, 127, -1, 130, 69, 119, -1, 130, 69, 127, -1, 51, -1, 131, 61, 51, -1, 120, 61, 131, -1, 51, -1, 120, -1, 132, 61, 51, -1, 132, 61, 120, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { 0, 167, 167, 168, 169, 170, 171, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 201, 204, 205, 208, 209, 210, 211, 213, 214, 215, 216, 217, 218, 221, 222, 225, 228, 228, 231, 234, 235, 238, 241, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 256, 259, 260, 263, 264, 265, 266, 269, 271, 272, 275, 276, 279, 280, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 304, 305, 306, 309, 310, 313, 314, 315, 316, 319, 320, 321, 324, 325, 326, 327, 330, 331, 332, 333, 334, 337, 341, 342, 343, 346, 350, 351, 352, 353, 356, 359, 360, 363, 364, 365, 366, 367, 368, 371, 372, 373, 376, 377, 378, 381, 389, 390, 393, 396, 397, 398, 399, 402, 403, 404, 405, 408, 409, 412, 413, 414, 417, 418, 421, 421, 423, 424, 425, 428, 429, 430, 433, 434, 437, 440, 441, 444, 445, 448, 449, 450, 451, 454, 455, 456, 457, 460, 461, 462, 463, 466, 467, 468, 471, 472, 473, 474 }; #endif #if YYDEBUG || YYERROR_VERBOSE /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "FILEC", "MARKER", "LOCUS", "TRAIT", "RANDOM", "PEDIGREE", "LOG", "MODEL", "FILTER", "LINK", "MISSING", "FACTOR", "BREAK", "DOLOOP", "WHILE", "USE", "WHERE", "ORSYMBOL", "ANDSYMBOL", "NEQSYMBOL", "LEQSYMBOL", "GEQSYMBOL", "NOTSYMBOL", "LOGICAL", "SHELL", "ARRAY", "PRINTEXP", "INCLUDE", "RAWOUTPUT", "LOOP_CLAUSE_START", "LOOP_CLAUSE_END", "CONSTANT", "MULTIPLE", "RSFORMAT", "FSFORMAT", "SKIPFORMAT", "GSFORMAT", "CENSORED", "GROUP", "SET", "GENDER", "AFFECTED", "OUTPUT", "ERRORDIR", "LAUROUTPUT", "UNAFFECTED", "POSITION", "FREQUENCY", "STRING", "VARIABLE", "ASSIGN", "ARRAY_VAR", "INTEGER", "SYSTEM_VAR", "REAL", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", "'.'", "'/'", "UMINUS", "'('", "')'", "','", "'['", "']'", "';'", "'x'", "'y'", "$accept", "comfile", "command", "assigncommand", "assignment", "expression", "setcommand", "docommand", "includecommand", "@1", "censorcommand", "affectedcommand", "sexcommand", "whilecommand", "condition", "printcommand", "printlist", "defformatcommand", "arraycommand", "arraylist", "usecommand", "wherecommand", "res_condition", "filecommand", "filename_string", "formatlist", "fformatlist", "fformat", "format", "logcommand", "outputcommand", "errordircommand", "missingcommand", "pedcommand", "locicommand", "changetypecommand", "linkcom1", "linkcommand", "filtercommand", "modelcommand", "groupcommand", "modellist", "interactionlist", "variable", "single_vlist", "single_element", "locuslist", "locus", "lociclause", "simple_varlist", "open_bracket", "loop_clause1", "loop_clause", "fsingle_vlist", "filevarlist", "varlist", "complex_string1", "complex_string", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const unsigned short yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 61, 60, 62, 43, 45, 42, 46, 47, 313, 40, 41, 44, 91, 93, 59, 120, 121 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 82, 84, 83, 85, 86, 86, 87, 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, 91, 91, 92, 92, 92, 92, 93, 94, 94, 95, 95, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 99, 99, 100, 100, 100, 100, 101, 101, 101, 102, 102, 102, 102, 103, 103, 103, 103, 103, 104, 105, 105, 105, 106, 107, 107, 107, 107, 108, 109, 109, 110, 110, 110, 110, 110, 110, 111, 111, 111, 112, 112, 112, 113, 114, 114, 115, 116, 116, 116, 116, 117, 117, 117, 117, 118, 118, 119, 119, 119, 120, 120, 121, 121, 122, 122, 122, 123, 123, 123, 124, 124, 125, 126, 126, 127, 127, 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 132, 132, 132, 132 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 1, 1, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 6, 1, 1, 1, 1, 3, 3, 3, 3, 2, 3, 3, 3, 1, 0, 3, 6, 5, 5, 5, 4, 1, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 3, 2, 2, 2, 2, 2, 4, 6, 6, 5, 6, 4, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 4, 7, 7, 1, 4, 1, 3, 4, 6, 1, 3, 3, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5, 2, 3, 3, 2, 2, 2, 2, 2, 2, 1, 4, 4, 2, 4, 2, 2, 4, 7, 2, 3, 3, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 4, 1, 4, 1, 3, 2, 1, 1, 3, 5, 3, 1, 3, 1, 8, 10, 4, 1, 0, 1, 1, 4, 1, 1, 3, 3, 1, 1, 3, 3, 1, 3, 3, 1, 1, 3, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const unsigned char yydefact[] = { 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 137, 0, 0, 47, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 19, 32, 27, 22, 9, 24, 25, 29, 23, 21, 28, 20, 17, 18, 7, 10, 30, 31, 16, 11, 12, 13, 0, 14, 8, 15, 26, 0, 156, 192, 155, 0, 0, 0, 160, 193, 101, 0, 0, 158, 172, 157, 185, 0, 176, 186, 133, 128, 119, 0, 0, 143, 0, 37, 36, 35, 0, 0, 0, 124, 38, 134, 0, 0, 0, 0, 0, 72, 66, 65, 0, 122, 131, 132, 68, 69, 71, 70, 0, 146, 0, 0, 0, 0, 120, 123, 121, 0, 0, 0, 136, 135, 1, 0, 189, 158, 157, 0, 140, 142, 0, 0, 118, 0, 0, 0, 0, 0, 116, 0, 0, 107, 103, 177, 0, 166, 165, 129, 162, 130, 0, 170, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 125, 0, 55, 0, 0, 0, 0, 81, 79, 80, 0, 0, 0, 82, 0, 0, 0, 49, 0, 45, 46, 0, 0, 0, 33, 0, 6, 5, 0, 0, 0, 0, 0, 0, 111, 110, 113, 112, 117, 0, 115, 0, 0, 0, 0, 0, 179, 178, 182, 181, 98, 194, 195, 0, 164, 0, 0, 0, 0, 187, 188, 0, 144, 149, 150, 138, 139, 44, 0, 39, 40, 41, 42, 126, 64, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 97, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 67, 0, 0, 0, 0, 0, 0, 191, 190, 141, 102, 161, 0, 0, 104, 0, 108, 0, 109, 0, 177, 0, 0, 163, 159, 0, 171, 175, 0, 0, 0, 0, 0, 0, 0, 127, 62, 63, 57, 58, 59, 56, 60, 61, 76, 0, 87, 95, 96, 90, 91, 92, 89, 93, 94, 83, 84, 85, 86, 0, 73, 0, 0, 53, 51, 52, 0, 159, 105, 0, 177, 177, 0, 184, 183, 169, 0, 167, 0, 0, 148, 147, 153, 154, 151, 152, 75, 77, 0, 50, 34, 0, 99, 100, 180, 0, 0, 145, 74, 106, 168, 0, 173, 0, 0, 174 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { -1, 39, 40, 41, 42, 180, 43, 44, 45, 111, 46, 47, 48, 49, 181, 50, 110, 51, 52, 108, 53, 54, 190, 55, 74, 150, 151, 152, 153, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 240, 241, 75, 83, 101, 158, 159, 232, 163, 84, 85, 86, 227, 228, 87, 140, 77 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -216 static const short yypact[] = { 541, -216, -22, -1, 22, 94, 94, 202, 71, 202, -54, 658, 94, -216, -34, -9, 9, -2, 715, -216, 202, 94, 94, 202, 202, 25, 202, 106, 106, -17, 106, 65, 202, 202, 202, 89, 43, 94, 94, 8, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 224, -216, -216, -216, -216, 23, -216, -216, -216, 62, 36, 70, -216, -216, 82, 156, 94, 86, -216, -216, -216, 234, 127, -216, 98, 98, 82, 115, 114, 82, 105, -216, -216, -216, 715, 715, 202, 694, -216, 98, 90, 125, -18, 318, 131, 134, 316, 151, 202, 82, 98, 98, 82, 82, -216, 82, 208, -216, 177, 192, 715, 199, 82, 82, 82, 203, 715, 715, 98, 98, -216, 421, -216, 212, 191, 222, 98, -41, 202, 715, -216, 202, 202, 229, 202, 10, -216, 61, -25, -216, -216, 142, 282, 62, 217, 220, -216, 98, 715, -216, 225, 234, 94, 715, 234, 242, 244, -216, 454, -49, 715, 715, 715, 715, 94, 98, 90, 316, 684, 318, 226, 318, -216, -216, -216, 318, 318, 423, -216, 715, 243, 715, 82, 254, -216, -216, 321, 318, 318, 316, 656, -216, -216, 715, 302, 275, 94, 66, 713, 82, 82, -216, 82, -216, 12, -216, 16, 207, 272, 207, 272, 256, -216, -216, -216, 258, -216, -216, 59, -216, 156, 722, 123, -27, -216, -216, 730, 269, 1, 152, -216, -216, -216, 715, 91, 91, -216, -216, 98, -216, 90, 90, 90, 90, 90, 90, 90, 90, -216, 542, 318, -216, -216, 591, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 313, 738, 268, 316, 318, 715, 602, 613, 280, 746, -216, -216, 98, -216, -216, 48, 53, -216, 273, -216, 277, -216, 715, 142, 284, 150, -216, -216, 295, -216, -216, 234, 293, 234, 234, 234, 234, 234, 316, 481, 46, 165, -216, -216, 165, -216, -216, -216, 624, -216, 449, 470, 181, 462, 462, 181, 462, 462, 163, 163, -216, -216, 94, -216, 715, 673, 316, -216, -216, 715, 296, -216, 12, 142, 142, 754, -216, -216, -216, 106, -216, 289, 234, 1, 152, -216, -216, -216, -216, -216, 98, 762, -216, 316, 118, 258, 258, -216, 292, 715, 269, -216, -216, -216, 336, -216, 715, 770, -216 }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { -216, -216, 230, -216, 64, -11, -216, -216, -216, -216, -216, -216, -216, -216, -160, -216, -216, -216, -216, -216, -216, -216, 140, -216, 11, -215, -216, 42, 141, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, 5, 56, 185, 4, 29, -216, 143, -216, 227, -216, -216, -151, 100, -115, 3, 189, 248 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, parse error. */ #define YYTABLE_NINF -162 static const short yytable[] = { 100, 183, 294, 226, 78, 68, 309, 109, 133, 88, 104, 216, 155, 143, 238, 102, 93, 143, 105, 252, 208, 69, 246, 134, 113, 114, 69, 79, 209, 70, 71, 76, 72, 103, 69, 71, 76, 143, 76, 121, 131, 132, 310, 71, 221, 80, 222, 223, 73, 76, 107, 165, 76, 76, 216, 76, 119, 120, 81, 123, 303, 76, 76, 76, 313, 314, 139, 148, 255, 256, 257, 295, 144, 145, 146, 147, 106, 217, -114, -114, 117, -114, 160, 218, 124, 149, 170, 171, 162, 149, 141, 148, 138, 318, 319, 320, 321, 322, 323, 324, 325, 129, 69, 178, 258, 259, 260, 157, 128, 149, 130, 71, 199, 72, 69, 179, 350, 219, 202, 203, 351, -114, -114, 71, -114, 90, 218, 155, 76, 142, 219, 211, 220, 69, 292, 191, 373, 69, 307, 154, 76, 94, 71, 155, 72, 95, 71, 96, 80, 69, 234, 355, 97, 161, 175, 239, 176, 98, 71, 164, 72, 81, 247, 248, 249, 250, 69, 165, 162, 237, 76, 242, 167, 76, 76, 71, 76, 80, 168, 169, 251, 280, 166, 282, 230, 69, 381, 219, 256, 257, 82, 82, 182, 91, 71, 288, 224, 82, 192, 69, 82, 226, 226, 193, 270, 271, 82, 82, 71, 81, 156, 191, 291, 191, 122, 315, 316, 191, 191, 358, 194, 359, 82, 82, 259, 260, 277, 196, 278, 191, 191, 297, 197, 299, 68, 317, 138, 374, 375, 308, 273, 274, 275, 276, 277, 69, 278, 198, 137, 76, 69, 76, -160, 70, 71, 89, 72, 92, 70, 71, 304, 72, 157, 298, 82, 300, 200, 69, 112, 82, 201, 115, 116, 345, 118, 135, 71, 69, 136, 206, 125, 126, 127, 207, 214, 82, 71, 231, 80, 233, 354, 81, 191, 263, 235, 281, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 144, 145, 146, 147, 191, 243, 308, 244, 363, 364, 365, 366, 367, 283, 262, 301, 264, 69, 290, 302, 265, 266, 312, 341, 370, 229, 71, 343, 72, 372, 348, 225, 285, 286, 352, 184, 369, 69, 353, 172, 36, 82, 82, 361, 82, 135, 71, 357, 72, -161, 378, 195, 296, 69, 82, 382, 205, 242, 379, 383, 362, 185, 71, 360, 72, 186, 386, 187, 305, 173, 174, 175, 188, 176, 173, 174, 175, 189, 176, 377, 0, 210, 284, 236, 212, 213, 82, 215, 289, 173, 174, 175, 0, 176, 356, 327, 384, 385, 0, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 0, 82, -4, 204, 344, 2, 3, 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, -4, 13, 14, 15, 16, 0, 0, 267, 268, 269, 270, 271, 0, 17, 18, 19, 20, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 268, 269, 270, 271, 36, 0, 37, 0, 38, 0, 0, 272, 273, 274, 275, 276, 277, 225, 278, 0, 0, 279, 269, 270, 271, 82, 0, 82, 82, 82, 82, 82, 254, 255, 256, 257, 0, 272, 273, 274, 275, 276, 277, 0, 278, 173, 174, 175, 0, 176, 0, 0, 245, 275, 276, 277, 82, 278, 272, 273, 274, 275, 276, 277, 0, 278, 0, 225, 225, 258, 259, 260, 1, 0, 2, 3, 82, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 13, 14, 15, 16, 0, 267, 268, 269, 270, 271, 0, 0, 17, 18, 19, 20, 0, 0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 0, 0, 0, 36, 0, 37, 0, 38, 0, 272, 273, 274, 275, 276, 277, 0, 278, 0, 0, 326, 267, 268, 269, 270, 271, 0, 0, 0, 0, 0, 0, 267, 268, 269, 270, 271, 0, 0, 0, 0, 0, 0, 267, 268, 269, 270, 271, 0, 0, 0, 0, 0, 0, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 0, 278, 0, 0, 328, 272, 273, 274, 275, 276, 277, 0, 278, 0, 0, 346, 272, 273, 274, 275, 276, 277, 0, 278, 0, 0, 347, 272, 273, 274, 275, 276, 277, 0, 278, 0, 0, 368, 267, 268, 269, 270, 271, 0, 0, 0, 69, 0, 0, 253, 254, 255, 256, 257, 94, 71, 0, 72, 95, 0, 96, 0, 173, 174, 175, 97, 176, 0, 0, 287, 98, 0, 0, 99, 0, 0, 272, 273, 274, 275, 276, 277, 69, 278, 0, 0, 371, 258, 259, 260, 0, 71, 0, 80, 0, 0, 0, 261, 0, 0, 173, 174, 175, 69, 176, 0, 81, 0, 177, 0, 0, 94, 71, 0, 72, 95, 0, 96, 0, 173, 174, 175, 97, 176, 0, 0, 293, 98, 173, 174, 175, 0, 176, 0, 0, 306, 173, 174, 175, 0, 176, 0, 0, 311, 173, 174, 175, 0, 176, 0, 0, 342, 173, 174, 175, 0, 176, 0, 0, 349, 173, 174, 175, 0, 176, 0, 0, 376, 173, 174, 175, 0, 176, 0, 0, 380, 173, 174, 175, 0, 176, 0, 0, 387 }; static const short yycheck[] = { 11, 19, 217, 154, 5, 27, 33, 18, 0, 6, 19, 1, 61, 1, 165, 12, 70, 1, 15, 179, 61, 43, 71, 15, 21, 22, 43, 5, 69, 51, 52, 2, 54, 67, 43, 52, 7, 1, 9, 56, 37, 38, 69, 52, 69, 54, 71, 72, 70, 20, 52, 69, 23, 24, 1, 26, 27, 28, 67, 30, 1, 32, 33, 34, 63, 64, 63, 55, 22, 23, 24, 55, 36, 37, 38, 39, 67, 67, 68, 69, 55, 71, 79, 73, 19, 73, 97, 98, 84, 73, 67, 55, 63, 253, 254, 255, 256, 257, 258, 259, 260, 58, 43, 100, 58, 59, 60, 78, 19, 73, 67, 52, 123, 54, 43, 25, 68, 69, 129, 130, 67, 68, 69, 52, 71, 54, 73, 61, 99, 67, 69, 142, 71, 43, 68, 106, 351, 43, 15, 69, 111, 51, 52, 61, 54, 55, 52, 57, 54, 43, 161, 302, 62, 67, 63, 166, 65, 67, 52, 32, 54, 67, 173, 174, 175, 176, 43, 69, 164, 165, 141, 167, 58, 144, 145, 52, 147, 54, 73, 74, 177, 192, 67, 194, 155, 43, 68, 69, 23, 24, 5, 6, 67, 8, 52, 206, 54, 12, 67, 43, 15, 352, 353, 69, 23, 24, 21, 22, 52, 67, 54, 182, 209, 184, 29, 63, 64, 188, 189, 69, 69, 71, 37, 38, 59, 60, 63, 19, 65, 200, 201, 220, 55, 222, 27, 246, 207, 352, 353, 235, 59, 60, 61, 62, 63, 43, 65, 55, 63, 220, 43, 222, 61, 51, 52, 7, 54, 9, 51, 52, 231, 54, 233, 221, 79, 223, 67, 43, 20, 84, 67, 23, 24, 284, 26, 51, 52, 43, 54, 67, 32, 33, 34, 61, 55, 100, 52, 70, 54, 69, 301, 67, 263, 67, 69, 52, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 36, 37, 38, 39, 283, 71, 310, 71, 312, 313, 314, 315, 316, 67, 182, 67, 184, 43, 51, 69, 188, 189, 61, 18, 343, 51, 52, 67, 54, 348, 58, 154, 200, 201, 69, 25, 341, 43, 69, 99, 53, 164, 165, 58, 167, 51, 52, 71, 54, 61, 69, 111, 219, 43, 177, 71, 134, 361, 361, 378, 312, 51, 52, 307, 54, 55, 385, 57, 233, 61, 62, 63, 62, 65, 61, 62, 63, 67, 65, 358, -1, 141, 69, 164, 144, 145, 209, 147, 207, 61, 62, 63, -1, 65, 302, 263, 68, 69, -1, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 235, 0, 1, 283, 3, 4, -1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, -1, 20, 21, 22, 23, 24, -1, 28, 29, 30, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 21, 22, 23, 24, 53, -1, 55, -1, 57, -1, -1, 58, 59, 60, 61, 62, 63, 302, 65, -1, -1, 68, 22, 23, 24, 310, -1, 312, 313, 314, 315, 316, 21, 22, 23, 24, -1, 58, 59, 60, 61, 62, 63, -1, 65, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, 341, 65, 58, 59, 60, 61, 62, 63, -1, 65, -1, 352, 353, 58, 59, 60, 1, -1, 3, 4, 361, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 16, 17, 18, 19, -1, 20, 21, 22, 23, 24, -1, -1, 28, 29, 30, 31, -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, -1, -1, 53, -1, 55, -1, 57, -1, 58, 59, 60, 61, 62, 63, -1, 65, -1, -1, 68, 20, 21, 22, 23, 24, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 58, 59, 60, 61, 62, 63, -1, 65, -1, -1, 68, 58, 59, 60, 61, 62, 63, -1, 65, -1, -1, 68, 58, 59, 60, 61, 62, 63, -1, 65, -1, -1, 68, 58, 59, 60, 61, 62, 63, -1, 65, -1, -1, 68, 20, 21, 22, 23, 24, -1, -1, -1, 43, -1, -1, 20, 21, 22, 23, 24, 51, 52, -1, 54, 55, -1, 57, -1, 61, 62, 63, 62, 65, -1, -1, 68, 67, -1, -1, 70, -1, -1, 58, 59, 60, 61, 62, 63, 43, 65, -1, -1, 68, 58, 59, 60, -1, 52, -1, 54, -1, -1, -1, 68, -1, -1, 61, 62, 63, 43, 65, -1, 67, -1, 69, -1, -1, 51, 52, -1, 54, 55, -1, 57, -1, 61, 62, 63, 62, 65, -1, -1, 68, 67, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, -1, 65, -1, -1, 68, 61, 62, 63, -1, 65, -1, -1, 68 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 53, 55, 57, 76, 77, 78, 79, 81, 82, 83, 85, 86, 87, 88, 90, 92, 93, 95, 96, 98, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 27, 43, 51, 52, 54, 70, 99, 118, 120, 132, 5, 5, 54, 67, 118, 119, 125, 126, 127, 130, 130, 132, 54, 118, 132, 70, 51, 55, 57, 62, 67, 70, 80, 120, 130, 67, 19, 130, 67, 52, 94, 80, 91, 84, 132, 130, 130, 132, 132, 55, 132, 120, 120, 56, 118, 120, 19, 132, 132, 132, 19, 58, 67, 130, 130, 0, 15, 51, 54, 118, 120, 130, 131, 67, 67, 1, 36, 37, 38, 39, 55, 73, 100, 101, 102, 103, 69, 61, 54, 120, 121, 122, 130, 67, 119, 124, 32, 69, 67, 58, 73, 74, 80, 80, 132, 61, 62, 63, 65, 69, 130, 25, 80, 89, 67, 19, 25, 51, 55, 57, 62, 67, 97, 120, 67, 69, 69, 132, 19, 55, 55, 80, 67, 67, 80, 80, 1, 77, 67, 61, 61, 69, 132, 80, 132, 132, 55, 132, 1, 67, 73, 69, 71, 69, 71, 72, 54, 118, 127, 128, 129, 51, 120, 70, 123, 69, 80, 69, 124, 119, 127, 80, 116, 117, 119, 71, 71, 68, 71, 80, 80, 80, 80, 130, 89, 20, 21, 22, 23, 24, 58, 59, 60, 68, 97, 67, 97, 97, 97, 20, 21, 22, 23, 24, 58, 59, 60, 61, 62, 63, 65, 68, 80, 52, 80, 67, 69, 97, 97, 68, 80, 131, 51, 130, 68, 68, 100, 55, 103, 99, 102, 99, 102, 67, 69, 1, 120, 122, 68, 15, 119, 33, 69, 68, 61, 63, 64, 63, 64, 80, 89, 89, 89, 89, 89, 89, 89, 89, 68, 97, 68, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 18, 68, 67, 97, 80, 68, 68, 58, 68, 68, 67, 69, 69, 80, 127, 128, 71, 69, 71, 79, 58, 117, 119, 119, 119, 119, 119, 68, 130, 80, 68, 80, 100, 129, 129, 68, 120, 69, 116, 68, 68, 71, 80, 68, 69, 80, 68 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.first_line = Rhs[1].first_line; \ Current.first_column = Rhs[1].first_column; \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column; #endif /* YYLEX -- calling `yylex' with the right arguments. */ #define YYLEX yylex () /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YYDSYMPRINT(Args) \ do { \ if (yydebug) \ yysymprint Args; \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YYDSYMPRINT(Args) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #if YYDEBUG /*-----------------------------. | Print this symbol on YYOUT. | `-----------------------------*/ static void #if defined (__STDC__) || defined (__cplusplus) yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue) #else yysymprint (yyout, yytype, yyvalue) FILE* yyout; int yytype; YYSTYPE yyvalue; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvalue; if (yytype < YYNTOKENS) { YYFPRINTF (yyout, "token %s (", yytname[yytype]); # ifdef YYPRINT YYPRINT (yyout, yytoknum[yytype], yyvalue); # endif } else YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); switch (yytype) { default: break; } YYFPRINTF (yyout, ")"); } #endif /* YYDEBUG. */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void #if defined (__STDC__) || defined (__cplusplus) yydestruct (int yytype, YYSTYPE yyvalue) #else yydestruct (yytype, yyvalue) int yytype; YYSTYPE yyvalue; #endif { /* Pacify ``unused variable'' warnings. */ (void) yyvalue; switch (yytype) { default: break; } } /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM # define YYPARSE_PARAM_DECL # else # define YYPARSE_PARAM_ARG YYPARSE_PARAM # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; # endif #else /* !YYPARSE_PARAM */ # define YYPARSE_PARAM_ARG # define YYPARSE_PARAM_DECL #endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ # ifdef YYPARSE_PARAM int yyparse (void *); # else int yyparse (void); # endif #endif /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of parse errors so far. */ int yynerrs; int yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ int yychar1 = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with. */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more. */ YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yychar1 = YYTRANSLATE (yychar); /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ YYDPRINTF ((stderr, "Next token is ")); YYDSYMPRINT ((stderr, yychar1, yylval)); YYDPRINTF ((stderr, "\n")); } /* If the proper action on seeing token YYCHAR1 is to reduce or to detect an error, take that action. */ yyn += yychar1; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; #if YYDEBUG /* We have to keep this `#if YYDEBUG', since we use variables which are defined only if `YYDEBUG' is set. */ if (yydebug) { int yyi; YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", yyn - 1, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 2: #line 167 "control_parse.y" { new_command(); } break; case 3: #line 168 "control_parse.y" { new_command(); } break; case 5: #line 170 "control_parse.y" { new_command(); } break; case 6: #line 171 "control_parse.y" { new_command(); } break; case 32: #line 201 "control_parse.y" {} break; case 33: #line 204 "control_parse.y" { yyval.element=assign_var(yyvsp[-2].var,0,yyvsp[0].express); if(yyvsp[0].express) free(yyvsp[0].express);} break; case 34: #line 205 "control_parse.y" { yyval.element=assign_var(yyvsp[-5].var,yyvsp[-3].express,yyvsp[0].express); if(yyvsp[-3].express) free(yyvsp[-3].express); if(yyvsp[0].express) free(yyvsp[0].express);} break; case 35: #line 208 "control_parse.y" { yyval.express=alloc_express(); yyval.express->type=ST_REAL; yyval.express->arg.rvalue=yyvsp[0].rvalue; } break; case 36: #line 209 "control_parse.y" { yyval.express=alloc_express(); yyval.express->type=ST_INTEGER; yyval.express->arg.value=yyvsp[0].value; } break; case 37: #line 210 "control_parse.y" { yyval.express=alloc_express(); yyval.express->type=ST_STRING; yyval.express->arg.string=yyvsp[0].string; } break; case 38: #line 211 "control_parse.y" { yyval.express=alloc_express(); yyval.express->type=yyvsp[0].element->type; if(yyvsp[0].element->type==ST_STRING) yyval.express->arg.string=string_copy(0,yyvsp[0].element->arg.string); else yyval.express->arg=yyvsp[0].element->arg; } break; case 39: #line 213 "control_parse.y" { yyval.express=do_express_op(yyvsp[-2].express,yyvsp[0].express,'+'); } break; case 40: #line 214 "control_parse.y" { yyval.express=do_express_op(yyvsp[-2].express,yyvsp[0].express,'-'); } break; case 41: #line 215 "control_parse.y" { yyval.express=do_express_op(yyvsp[-2].express,yyvsp[0].express,'*'); } break; case 42: #line 216 "control_parse.y" { yyval.express=do_express_op(yyvsp[-2].express,yyvsp[0].express,'/'); } break; case 43: #line 217 "control_parse.y" { yyval.express=do_express_op(yyvsp[0].express,0,'-'); } break; case 44: #line 218 "control_parse.y" { yyval.express=yyvsp[-1].express; } break; case 45: #line 221 "control_parse.y" { syst_var[yyvsp[-1].value]=yyvsp[0].value; } break; case 46: #line 222 "control_parse.y" { yyerror("Unrecognized system variable"); } break; case 47: #line 225 "control_parse.y" { enter_loop(); } break; case 48: #line 228 "control_parse.y" {iflag=1;} break; case 49: #line 228 "control_parse.y" {include_control_file(yyvsp[0].string);} break; case 50: #line 231 "control_parse.y" { add_censored(yyvsp[-4].element,1); at_use=0;} break; case 51: #line 234 "control_parse.y" { add_censored(0,0); at_use=0;} break; case 52: #line 235 "control_parse.y" { add_censored(0,2); at_use=0;} break; case 53: #line 238 "control_parse.y" { set_sex(yyvsp[-3].element,yyvsp[-2].express,yyvsp[0].express); } break; case 54: #line 241 "control_parse.y" { do_while_com(yyvsp[-1].express); if(yyvsp[-1].express) free(yyvsp[-1].express);} break; case 56: #line 245 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,'=');} break; case 57: #line 246 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,NEQSYMBOL);} break; case 58: #line 247 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,LEQSYMBOL);} break; case 59: #line 248 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,GEQSYMBOL);} break; case 60: #line 249 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,'<');} break; case 61: #line 250 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,'>');} break; case 62: #line 251 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,ORSYMBOL);} break; case 63: #line 252 "control_parse.y" {yyval.express=do_logical_op(yyvsp[-2].express,yyvsp[0].express,ANDSYMBOL);} break; case 64: #line 253 "control_parse.y" {yyval.express=do_logical_op(yyvsp[0].express,0,NOTSYMBOL);} break; case 65: #line 256 "control_parse.y" { (void)fputc('\n',stdout); } break; case 66: #line 259 "control_parse.y" { print_exp(yyvsp[0].express); if(yyvsp[0].express) free(yyvsp[0].express); } break; case 67: #line 260 "control_parse.y" { print_exp(yyvsp[0].express); if(yyvsp[0].express) free(yyvsp[0].express); } break; case 68: #line 263 "control_parse.y" {if(rsformat) free(rsformat); rsformat=yyvsp[0].string;} break; case 69: #line 264 "control_parse.y" {if(fsformat) free(fsformat); fsformat=yyvsp[0].string;} break; case 70: #line 265 "control_parse.y" {if(gsformat) free(gsformat); gsformat=yyvsp[0].string;} break; case 71: #line 266 "control_parse.y" {file_skip=yyvsp[0].value;} break; case 73: #line 271 "control_parse.y" {set_array_var(yyvsp[-3].var->data,yyvsp[-1].express); if(yyvsp[-1].express) free(yyvsp[-1].express); } break; case 74: #line 272 "control_parse.y" {set_array_var(yyvsp[-3].var->data,yyvsp[-1].express); if(yyvsp[-1].express) free(yyvsp[-1].express); } break; case 75: #line 275 "control_parse.y" {add_restriction(yyvsp[-4].var_list);at_use=0;} break; case 76: #line 276 "control_parse.y" {add_restriction(0);at_use=0;} break; case 77: #line 279 "control_parse.y" {add_restriction(yyvsp[0].var_list);at_use=0;} break; case 78: #line 280 "control_parse.y" {add_restriction(0);at_use=0;} break; case 79: #line 283 "control_parse.y" {add_operation(&(yyvsp[0].value),INTEGER,0);} break; case 80: #line 284 "control_parse.y" {add_operation(&(yyvsp[0].rvalue),REAL,0);} break; case 81: #line 285 "control_parse.y" {add_operation(yyvsp[0].string,STRING,0);} break; case 82: #line 286 "control_parse.y" {if(yyvsp[0].element) check_element_add_op(yyvsp[0].element);} break; case 83: #line 287 "control_parse.y" {add_operation(0,0,'+');} break; case 84: #line 288 "control_parse.y" {add_operation(0,0,'-');} break; case 85: #line 289 "control_parse.y" {add_operation(0,0,'*');} break; case 86: #line 290 "control_parse.y" {add_operation(0,0,'/');} break; case 88: #line 292 "control_parse.y" {add_operation(0,0,UMINUS);} break; case 89: #line 293 "control_parse.y" {add_operation(0,0,'=');} break; case 90: #line 294 "control_parse.y" {add_operation(0,0,NEQSYMBOL);} break; case 91: #line 295 "control_parse.y" {add_operation(0,0,LEQSYMBOL);} break; case 92: #line 296 "control_parse.y" {add_operation(0,0,GEQSYMBOL);} break; case 93: #line 297 "control_parse.y" {add_operation(0,0,'<');} break; case 94: #line 298 "control_parse.y" {add_operation(0,0,'>');} break; case 95: #line 299 "control_parse.y" {add_operation(0,0,ORSYMBOL);} break; case 96: #line 300 "control_parse.y" {add_operation(0,0,ANDSYMBOL);} break; case 97: #line 301 "control_parse.y" {add_operation(0,0,NOTSYMBOL);} break; case 98: #line 304 "control_parse.y" { do_file_com(yyvsp[-2].string,0,0,yyvsp[0].var_list); } break; case 99: #line 305 "control_parse.y" { do_file_com(yyvsp[-2].string,yyvsp[-4].format_clause,0,yyvsp[0].var_list); } break; case 100: #line 306 "control_parse.y" { do_file_com(yyvsp[-2].string,0,yyvsp[-4].fformat,yyvsp[0].var_list); } break; case 101: #line 309 "control_parse.y" { yyval.string=yyvsp[0].string; } break; case 102: #line 310 "control_parse.y" { yyval.string=yyvsp[-1].string; shell_flag=1; } break; case 103: #line 313 "control_parse.y" {yyval.format_clause=add_f_atom(0,yyvsp[0].f_atom); } break; case 104: #line 314 "control_parse.y" {yyval.format_clause=add_f_atom(yyvsp[-2].format_clause,yyvsp[0].f_atom); } break; case 105: #line 315 "control_parse.y" {yyval.format_clause=add_f_list(0,yyvsp[-1].format_clause,yyvsp[-3].value); } break; case 106: #line 316 "control_parse.y" {yyval.format_clause=add_f_list(yyvsp[-5].format_clause,yyvsp[-1].format_clause,yyvsp[-3].value); } break; case 108: #line 320 "control_parse.y" {yyval.fformat=add_fformat(yyvsp[-2].fformat,yyvsp[0].fformat); } break; case 109: #line 321 "control_parse.y" {yyval.fformat=add_fformat(yyvsp[-2].fformat,yyvsp[0].fformat); } break; case 110: #line 324 "control_parse.y" {yyval.fformat=create_fformat(yyvsp[0].string,2); } break; case 111: #line 325 "control_parse.y" {yyval.fformat=create_fformat(yyvsp[0].string,1); } break; case 112: #line 326 "control_parse.y" {yyval.fformat=create_fformat(yyvsp[0].string,4); } break; case 113: #line 327 "control_parse.y" {yyval.fformat=create_fformat(&yyvsp[0].value,3); } break; case 114: #line 330 "control_parse.y" {yyval.f_atom=make_f_atom(yyvsp[0].value,0);} break; case 115: #line 331 "control_parse.y" {yyval.f_atom=make_f_atom(yyvsp[-1].value,1);} break; case 116: #line 332 "control_parse.y" {yyval.f_atom=make_f_atom(1,1);} break; case 117: #line 333 "control_parse.y" {yyval.f_atom=make_f_atom(0,1); scan_error|=FORMAT_ERR; } break; case 118: #line 334 "control_parse.y" {yyval.f_atom=make_f_atom(0,1); scan_error|=FORMAT_ERR; } break; case 119: #line 338 "control_parse.y" { if(LogFile) free(LogFile); LogFile=yyvsp[0].string; } break; case 120: #line 341 "control_parse.y" { if(OutputFile) free(OutputFile); OutputFile=yyvsp[0].string; } break; case 121: #line 342 "control_parse.y" { if(OutputLaurFile) free(OutputLaurFile); OutputLaurFile=yyvsp[0].string; } break; case 122: #line 343 "control_parse.y" { if(OutputRawFile) free(OutputRawFile); OutputRawFile=yyvsp[0].string; } break; case 123: #line 347 "control_parse.y" { if(ErrorDir) free(ErrorDir); ErrorDir=yyvsp[0].string;} break; case 124: #line 350 "control_parse.y" { do_missing_com(yyvsp[0].express,0,0); free(yyvsp[0].express); } break; case 125: #line 351 "control_parse.y" { do_missing_com(yyvsp[-1].express,yyvsp[0].var_list,0); free(yyvsp[-1].express); } break; case 126: #line 352 "control_parse.y" { do_missing_com(yyvsp[-2].express,yyvsp[0].var_list,0); free(yyvsp[-2].express); } break; case 127: #line 353 "control_parse.y" { do_missing_com(yyvsp[0].express,0,yyvsp[-2].string); free(yyvsp[0].express); } break; case 128: #line 356 "control_parse.y" { do_ped_com(yyvsp[0].var_list); } break; case 130: #line 360 "control_parse.y" { change_type(ST_TRAITLOCUS,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 131: #line 363 "control_parse.y" { change_type(ST_CONSTANT,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 132: #line 364 "control_parse.y" { change_type(ST_MULTIPLE,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 133: #line 365 "control_parse.y" { change_type(ST_RANDOM|ST_FACTOR,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 134: #line 366 "control_parse.y" { change_type(ST_FACTOR,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 135: #line 367 "control_parse.y" {change_type(ST_REALTYPE,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 136: #line 368 "control_parse.y" {change_type(ST_INTTYPE,yyvsp[0].var_list); free_vlist(yyvsp[0].var_list);} break; case 137: #line 371 "control_parse.y" { yyval.value=LINK_AUTO; } break; case 138: #line 372 "control_parse.y" { yyval.value=LINK_X; } break; case 139: #line 373 "control_parse.y" { yyval.value=LINK_Y; } break; case 140: #line 376 "control_parse.y" { do_link_com(0,yyvsp[-1].value,yyvsp[0].var_list); } break; case 141: #line 377 "control_parse.y" { do_link_com(yyvsp[-2].string,yyvsp[-3].value,yyvsp[0].var_list); } break; case 142: #line 378 "control_parse.y" { do_link_com(yyvsp[0].string,yyvsp[-1].value,0); } break; case 143: #line 381 "control_parse.y" { if(Filter) { print_scan_warn("Line %d: Warning - Filter defined twice\n",lineno); free(Filter); } Filter=yyvsp[0].string; } break; case 144: #line 389 "control_parse.y" {do_model_com(yyvsp[0].model_list,yyvsp[-2].var,0);} break; case 145: #line 390 "control_parse.y" {do_model_com(yyvsp[0].model_list,yyvsp[-5].var,yyvsp[-3].express); if(yyvsp[-3].express) free(yyvsp[-3].express); } break; case 146: #line 393 "control_parse.y" {set_group(yyvsp[0].element);} break; case 147: #line 396 "control_parse.y" { yyval.model_list=add_to_model(yyvsp[-2].model_list,yyvsp[0].var_list); } break; case 148: #line 397 "control_parse.y" { yyval.model_list=add_to_model(yyvsp[-2].model_list,yyvsp[0].var_list); } break; case 149: #line 398 "control_parse.y" { yyval.model_list=add_to_model(0,yyvsp[0].var_list); } break; case 150: #line 399 "control_parse.y" { yyval.model_list=add_to_model(0,yyvsp[0].var_list); } break; case 151: #line 402 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 152: #line 403 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 153: #line 404 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 154: #line 405 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 156: #line 409 "control_parse.y" { yyval.var=create_var("SEX"); } break; case 157: #line 412 "control_parse.y" { yyval.var_list=add_to_var_list(0,yyvsp[0].var,0); } break; case 158: #line 413 "control_parse.y" { yyval.var_list=add_to_var_list(0,yyvsp[0].var,0); } break; case 159: #line 414 "control_parse.y" { yyval.var_list=add_to_var_list(0,yyvsp[-3].var,yyvsp[-1].express); if(yyvsp[-1].express) free(yyvsp[-1].express); } break; case 160: #line 417 "control_parse.y" { yyval.element=get_element(yyvsp[0].var,0); } break; case 161: #line 418 "control_parse.y" { yyval.element=get_element(yyvsp[-3].var,yyvsp[-1].express); if(yyvsp[-1].express) free(yyvsp[-1].express); } break; case 164: #line 423 "control_parse.y" { if(yyvsp[-1].element) set_locus_element(yyvsp[-1].element); } break; case 165: #line 424 "control_parse.y" { if(yyvsp[0].element) set_locus_element(yyvsp[0].element); } break; case 166: #line 425 "control_parse.y" { if(yyvsp[0].var) set_locus_array(yyvsp[0].var); } break; case 167: #line 428 "control_parse.y" { if(yyvsp[-1].element) set_haplo_element(yyvsp[-1].element,0); } break; case 168: #line 429 "control_parse.y" { if(yyvsp[-3].element) set_haplo_element(yyvsp[-3].element,yyvsp[-1].element); } break; case 171: #line 434 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 172: #line 437 "control_parse.y" { start_loopclause(); } break; case 173: #line 440 "control_parse.y" { free_vlist(yyvsp[-6].var_list); begin_looping(yyvsp[-3].element,yyvsp[-1].express,0); } break; case 174: #line 441 "control_parse.y" { free_vlist(yyvsp[-8].var_list); begin_looping(yyvsp[-5].element,yyvsp[-3].express,yyvsp[-1].express); } break; case 175: #line 444 "control_parse.y" { yyval.var_list=yyvsp[-1].var_list; in_loopclause=0; } break; case 176: #line 445 "control_parse.y" { yyval.var_list=0; in_loopclause=0; } break; case 177: #line 448 "control_parse.y" { yyval.var_list=add_to_var_list(0,0,0); } break; case 178: #line 449 "control_parse.y" { yyval.var_list=add_to_var_list(0,yyvsp[0].var,0); } break; case 179: #line 450 "control_parse.y" { yyval.var_list=add_to_var_list(0,yyvsp[0].var,0); } break; case 180: #line 451 "control_parse.y" { yyval.var_list=add_to_var_list(0,yyvsp[-3].var,yyvsp[-1].express); if(yyvsp[-1].express) free(yyvsp[-1].express); } break; case 183: #line 456 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 184: #line 457 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 187: #line 462 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 188: #line 463 "control_parse.y" { yyval.var_list=add_var_lists(yyvsp[-2].var_list,yyvsp[0].var_list); } break; case 189: #line 466 "control_parse.y" { yyval.string = yyvsp[0].string; } break; case 190: #line 467 "control_parse.y" { yyval.string = string_copy(yyvsp[-2].string,yyvsp[0].string); free(yyvsp[0].string); } break; case 191: #line 468 "control_parse.y" { if(yyvsp[-2].element && (yyvsp[-2].element->type&ST_STRING)) yyval.string = string_copy(yyvsp[0].string,yyvsp[-2].element->arg.string); else yyval.string=yyvsp[0].string; } break; case 192: #line 471 "control_parse.y" { yyval.string = yyvsp[0].string; } break; case 193: #line 472 "control_parse.y" { if(yyvsp[0].element && (yyvsp[0].element->type&ST_STRING)) yyval.string = string_copy(0,yyvsp[0].element->arg.string); else yyval.string=0; } break; case 194: #line 473 "control_parse.y" { yyval.string = string_copy(yyvsp[-2].string,yyvsp[0].string); free(yyvsp[0].string); } break; case 195: #line 474 "control_parse.y" { if(yyvsp[0].element && (yyvsp[0].element->type&ST_STRING)) yyval.string = string_copy(yyvsp[-2].string,yyvsp[0].element->arg.string); else yyval.string=yyvsp[-2].string; } break; } /* Line 1016 of /usr/local/share/bison/yacc.c. */ #line 2385 "y.tab.c" yyvsp -= yylen; yyssp -= yylen; #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "parse error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yycount = 0; for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); yyp = yystpcpy (yyp, yytname[yyx]); yycount++; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("parse error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("parse error"); } goto yyerrlab1; /*----------------------------------------------------. | yyerrlab1 -- error raised explicitly by an action. | `----------------------------------------------------*/ yyerrlab1: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ /* Return failure if at end of input. */ if (yychar == YYEOF) { /* Pop the error token. */ YYPOPSTACK; /* Pop the rest of the stack. */ while (yyssp > yyss) { YYDPRINTF ((stderr, "Error: popping ")); YYDSYMPRINT ((stderr, yystos[*yyssp], *yyvsp)); YYDPRINTF ((stderr, "\n")); yydestruct (yystos[*yyssp], *yyvsp); YYPOPSTACK; } YYABORT; } YYDPRINTF ((stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1])); yydestruct (yychar1, yylval); yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDPRINTF ((stderr, "Error: popping ")); YYDSYMPRINT ((stderr, yystos[*yyssp], *yyvsp)); YYDPRINTF ((stderr, "\n")); yydestruct (yystos[yystate], *yyvsp); yyvsp--; yystate = *--yyssp; #if YYDEBUG if (yydebug) { short *yyssp1 = yyss - 1; YYFPRINTF (stderr, "Error: state stack now"); while (yyssp1 != yyssp) YYFPRINTF (stderr, " %d", *++yyssp1); YYFPRINTF (stderr, "\n"); } #endif } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 476 "control_parse.y" static void enter_loop(void) { if(loop_leveltype==ST_INTEGER) loop_clause_end=(int)exp1->arg.value; else er=1; if(!er && exp2) { if(exp2->type==ST_INTEGER) loop_clause_step=(int)exp2->arg.value; else er=1; } else loop_clause_step=1; if(element->type&ST_INTEGER) { i=(int)element->arg.value; if(loop_clause_step<0) { if(iloop_clause_end) er= -1; } else er=1; } else er=2; if(er) { switch(er) { case 1: yyerror("Loop variable not integer type\n"); break; case 2: yyerror("Syntax error\n"); break; } loop_record=loop_stat[--loop_level]; if(!loop_record) loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; in_loopclause=0; } else { in_loopclause= -1; loop_record= -1; loop_clause_ptr=loop_main_ptr; loop_clause_element=element; loop_main_ptr=loop_ptr[loop_level-1]; } if(exp1) free(exp1); if(exp2) free(exp2); } static int if_true(struct express *express) { int l=0; if(express) { switch(express->type) { case ST_INTEGER: l=(express->arg.value!=0); break; case ST_REAL: l=(express->arg.rvalue!=0.0); break; case ST_STRING: if(express->arg.string && express->arg.string[0]) l=1; } } return l; } static void do_while_com(struct express *express) { int i; if(loop_level) { if(!scan_error_n && if_true(express)) { loop_record= -1; loop_main_ptr=loop_ptr[loop_level-1]; } else { loop_record=loop_stat[--loop_level]; if(!loop_record) { i=loop_main_ptr-1; loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; for(;i>=loop_main_ptr;i--) { if(loop_stack[i].token==STRING) free(loop_stack[i].yylval.string); } } } } else yyerror("WHILE outside of do loop\n"); } static void print_exp(struct express *express) { if(!express) return; switch(express->type) { case ST_STRING: (void)fputs(express->arg.string,stdout); free(express->arg.string); break; case ST_INTEGER: (void)printf("%ld",express->arg.value); break; case ST_REAL: (void)printf("%g",express->arg.rvalue); break; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_sex" static void set_sex(struct var_element *elem,struct express *exp1,struct express *exp2) { struct sex_def *se; if(!exp1 || !exp2) yyerror1("Null arguments to sex command\n"); else { if(exp1->type != exp2->type) yyerror1("Arguments to sex command of different type\n"); else if(exp1->type!=ST_INTEGER && exp1->type!=ST_STRING) yyerror1("Arguments to sex command of invalid type\n"); else { if(!(se=malloc(sizeof(struct sex_def)))) ABT_FUNC(MMsg); se->sex_exp[0]=exp1; se->sex_exp[1]=exp2; se->sex_elem=elem; elem->type|=(ST_SEX|ST_FACTOR|ST_CONSTANT|ST_DATA); if(exp1->type==ST_INTEGER) elem->type|=ST_INTTYPE; se->next=sex_def; sex_def=se; } } } static void set_group(struct var_element *elem) { if(group_elem) yyerror1("Error: Multiple group commands"); else { group_elem=elem; group_elem->type|=(ST_GROUP|ST_FACTOR|ST_CONSTANT); } } static void do_ped_com(struct var_list *vlist) { int i,j,n; struct var_list *vlist1; struct scan_data *sd; if(pedflag) { yyerror1("Error: Multiple pedigree commands"); scan_error|=PED_ERR; } pedflag=1; n=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { if(n<4) pedlist[n]=sd->element+vlist->index-1; n++; } else for(i=0;in_elements;i++) { if(n<4) pedlist[n]=sd->element+i; n++; } } else { if(n<4) pedlist[n]=sd->element; n++; } vlist1=vlist->next; free(vlist); vlist=vlist1; } if(n!=3 && n!=4) { yyerror1("Error: Wrong no. variables for pedigree command (3 or 4 required)"); scan_error|=PED_ERR; } else { for(i=1;itype|=(ST_FAMILY|ST_FACTOR|ST_CONSTANT); family_id=1; i=1; } else i=0; pedlist[i++]->type|=(ST_ID|ST_FACTOR|ST_CONSTANT); pedlist[i++]->type|=(ST_SIRE|ST_FACTOR|ST_CONSTANT); pedlist[i++]->type|=(ST_DAM|ST_FACTOR|ST_CONSTANT); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_express" static struct express *alloc_express(void) { struct express *e; if(!(e=malloc(sizeof(struct express)))) ABT_FUNC(MMsg); return e; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_logical_op" static struct express *do_logical_op(struct express *ex1,struct express *ex2,int op) { int i=0,l=0; double rv1,rv2; char *s1,*s2; s1=s2=0; if(ex1->type&ST_STRING) { s1=ex1->arg.string; i++; } if(ex2 && ex2->type&ST_STRING) { s2=ex2->arg.string; i++; } if(i==2) { switch(op) { case '=': l=mystrcmp(s1,s2)?0:1; break; case NEQSYMBOL: l=mystrcmp(s1,s2)?1:0; break; case '<': l=mystrcmp(s1,s2)<0?1:0; break; case '>': l=mystrcmp(s1,s2)>0?1:0; break; case LEQSYMBOL: l=mystrcmp(s1,s2)>=0?1:0; break; case GEQSYMBOL: l=mystrcmp(s1,s2)>=0?1:0; break; case ORSYMBOL: l=(s1 || s2); break; case ANDSYMBOL: l=(s1 && s2); break; default: ABT_FUNC("Internal error - invalid string op\n"); } } else if(i && !ex2) { if(op!=NOTSYMBOL) ABT_FUNC("Internal error - invalid unary string op\n"); else l=s1?0:1; } else if(i) { switch(op) { case ORSYMBOL: if(ex1->type&ST_STRING) l=(s1 || ex2->arg.value); else l=(s2 || ex1->arg.value); break; case ANDSYMBOL: if(ex1->type&ST_STRING) l=(s1 && ex2->arg.value); else l=(s2 && ex1->arg.value); break; default: ABT_FUNC("Internal error - invalid string op\n"); } } else { rv1=rv2=0.0; if(ex1->type&ST_INTEGER) rv1=(double)ex1->arg.value; else if(ex1->type&ST_REAL) rv1=ex1->arg.rvalue; if(ex2) { if(ex2->type&ST_INTEGER) rv2=(double)ex2->arg.value; else if(ex2->type&ST_REAL) rv2=ex2->arg.rvalue; } switch(op) { case '=': l=(rv1==rv2); break; case NEQSYMBOL: l=(rv1!=rv2); break; case '<': l=(rv1': l=(rv1>rv2); break; case LEQSYMBOL: l=(rv1<=rv2); break; case GEQSYMBOL: l=(rv1>=rv2); break; case ORSYMBOL: l=(rv1 || rv2); break; case ANDSYMBOL: l=(rv1 && rv2); break; case NOTSYMBOL: l=(rv1==0.0); break; default: ABT_FUNC("Internal error - invalid op\n"); } } if(ex2) free(ex2); ex1->type=ST_INTEGER; ex1->arg.value=l; return ex1; } static struct express *do_express_op(struct express *ex1,struct express *ex2,int op) { double rv1,rv2; int i; if(ex1->type&ST_STRING) { if(ex2 && ex2->type&ST_STRING) { if(op!='+') yyerror("Illegal string operation\n"); else { ex1->arg.string=string_copy(ex1->arg.string,ex2->arg.string); free(ex2->arg.string); } } else yyerror("Can't mix numeric and string expressions\n"); } else if(ex2 && ex2->type&ST_STRING) yyerror("Can't mix numeric and string expressions\n"); else { rv1=rv2=0.0; if(ex1->type&ST_INTEGER) rv1=(double)ex1->arg.value; else if(ex1->type&ST_REAL) rv1=ex1->arg.rvalue; if(ex2) { if(ex2->type&ST_INTEGER) rv2=(double)ex2->arg.value; else if(ex2->type&ST_REAL) rv2=ex2->arg.rvalue; } switch(op) { case '+': rv1+=rv2; break; case '-': if(ex2) rv1-=rv2; else rv1= -rv1; break; case '*': rv1*=rv2; break; case '/': if(rv2==0.0) { yyerror("Divide by zero error\n"); rv1=0.0; } else rv1/=rv2; break; } i=(int)rv1; if((double)i==rv1) { ex1->type=ST_INTEGER; ex1->arg.value=i; } else { ex1->type=ST_REAL; ex1->arg.rvalue=rv1; } } if(ex2) free(ex2); return ex1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "check_element_add_op" static void check_element_add_op(struct var_element *element) { switch(element->type&(ST_REAL|ST_INTEGER|ST_STRING)) { case ST_STRING: add_operation(string_copy(0,element->arg.string),STRING,0); break; case ST_INTEGER: add_operation(&element->arg,INTEGER,0); break; case ST_REAL: add_operation(&element->arg,REAL,0); break; case 0: add_operation(element,VARIABLE,0); break; default: ABT_FUNC("Internal error - illegal element type\n"); } } static int check_index(struct scan_data *sd,struct express *express) { int i; if(express->type!=ST_INTEGER) { if(in_loopclause<=0) yyerror("Non-integral expression for array index"); } else if(sd->vtype&ST_ARRAY) { i=(int)express->arg.value; if(i<1 || i>sd->n_elements) { if(in_loopclause<=0) yyerror("Array index out of bounds"); } else return i; } else yyerror("Not an array"); return 0; } static struct var_element *get_element(struct bin_node *node,struct express *express) { int i; struct scan_data *sd; sd=node->data; if(express) { if(!(i=check_index(sd,express))) return 0; return sd->element+i-1; } else { if(sd->vtype&ST_ARRAY) { yyerror("Illegal reference to array"); return 0; } } return sd->element; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_array_var" static void set_array_var(struct scan_data *sd,struct express *express) { int i; if(express->type!=ST_INTEGER) yyerror("Non-integral expression for array size"); else if((i=(int)express->arg.value)<1) yyerror("Illegal array size"); else if(sd->vtype) yyerror("Can't redefine variable"); else { sd->vtype|=ST_ARRAY; sd->n_elements=i; free(sd->element); if(!(sd->element=calloc((size_t)sd->n_elements,sizeof(struct var_element)))) ABT_FUNC(MMsg); } } static int count_var_list(struct var_list *vlist) { int i=0; struct scan_data *sd=0; while(vlist) { sd=vlist->var?vlist->var->data:0; if(sd && (sd->vtype&ST_ARRAY) && !vlist->index) i+=sd->n_elements; else i++; vlist=vlist->next; } return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "assign_var" static struct var_element *assign_var(struct bin_node *node,struct express *ix,struct express *express) { struct var_element *element; struct scan_data *sd; if(!express) return 0; if(!(element=get_element(node,ix))) return 0; switch(express->type) { case ST_STRING: element->arg.string=express->arg.string; RemBlock=AddRemem(element->arg.string,RemBlock); break; case ST_REAL: case ST_INTEGER: element->arg=express->arg; break; case 0: yyerror1("Undefined assignment\n"); element->type=0; element->arg.string=0; break; default: ABT_FUNC(IntErr); } if(!ix) { sd=node->data; sd->vtype|=ST_SCALAR; } element->type=express->type; return element; } void check_vars(struct bin_node *node,int *i,void check_func(struct bin_node *,int *)) { if(node->left) { check_vars(node->left,i,check_func); } check_func(node,i); if(node->right) { check_vars(node->right,i,check_func); } } static void check_vars_1(struct bin_node *node,void check_func(struct bin_node *)) { if(node->left) { check_vars_1(node->left,check_func); } check_func(node); if(node->right) { check_vars_1(node->right,check_func); } } void print_scan_err(char *fmt, ...) { va_list args; va_start(args,fmt); (void)vfprintf(stderr,fmt,args); va_end(args); if((++scan_error_n)>=max_scan_errors) abt(__FILE__,__LINE__,"Too many errors - aborting\n"); } void print_scan_warn(char *fmt, ...) { va_list args; if(scan_warn_nnext=Op_List; Op_List=o; o->type=type; o->op=op; switch(type) { case VARIABLE: o->arg.element= (struct var_element *)arg; break; case INTEGER: o->arg.value= *(int *)arg; break; case REAL: o->arg.rvalue= *(double *)arg; break; case STRING: o->arg.string= (char *)arg; break; } } static void new_command(void) { shell_flag=in_loopclause=0; Op_List=0; iflag=0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_to_model" static struct model_list *add_to_model(struct model_list *model,struct var_list *vlist) { struct var_list *vlist1; struct scan_data *sd; struct model_list *m1; int i; if(!(m1=malloc(sizeof(struct model_list)))) ABT_FUNC(MMsg); if(vlist) { i=count_var_list(vlist); if(!(m1->element=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { sd->element[vlist->index-1].type|=ST_MODEL; sd->element[vlist->index-1].index=vlist->index; sd->element[vlist->index-1].oindex=vlist->index; m1->element[i++]=sd->element+vlist->index-1; } else yyerror("Error - Can't use whole arrays as model parameters"); } else { sd->element[0].type|=ST_MODEL; sd->element[0].index=0; m1->element[i++]=sd->element; } vlist1=vlist->next; free(vlist); vlist=vlist1; } m1->nvar=i; } else ABT_FUNC("Nothing to add...\n"); m1->next=model; return m1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "string_copy" static char *string_copy(char *s1,char *s2) { if(s1) { if(!(s1=realloc(s1,strlen(s1)+strlen(s2)+1))) ABT_FUNC(MMsg); (void)strcat(s1,s2); } else { if(!(s1=malloc(strlen(s2)+1))) ABT_FUNC(MMsg); (void)strcpy(s1,s2); } return s1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "setup_format" static struct format *setup_format(struct format_clause *fc) { int i,n=0,pp=0; struct format_atom **fa; struct format *format; fa=fc->f_atoms; for(i=0;in_atoms;i++) if(!fa[i]->pos) n++; if(!n) { if(!(scan_error&FORMAT_ERR)) yyerror("Error - Empty format clause"); free(fa); free(fc); scan_error|=FORMAT_ERR; scan_error_n++; return 0; } if(!(format=malloc(sizeof(struct format)))) ABT_FUNC(MMsg); format->line=lineno; if(!(format->f_atoms=malloc(sizeof(struct format_atom)*n))) ABT_FUNC(MMsg); for(i=n=0;in_atoms;i++) { if(!fa[i]->pos) { format->f_atoms[n].size=fa[i]->size; format->f_atoms[n++].pos=pp; } pp+=fa[i]->size; } free(fa); format->n_atoms=n; f_atom_n=0; free(fc); return format; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "make_f_atom" static struct format_atom *make_f_atom(int n,int flag) { if(f_atom_n>=f_atom_size) { f_atom_size*=2; if(!(f_atom_list=realloc(f_atom_list,sizeof(struct format_atom)*f_atom_size))) ABT_FUNC(MMsg); } f_atom_list[f_atom_n].size=n; f_atom_list[f_atom_n].pos=flag; return &f_atom_list[f_atom_n++]; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_fformat" static struct fformat *add_fformat(struct fformat *f1,struct fformat *f2) { if(f2->rs) { if(f1->rs) free(f1->rs); f1->rs=f2->rs; } if(f2->fs) { if(f1->fs) free(f1->fs); f1->fs=f2->fs; } if(f2->gs) { if(f1->gs) free(f1->gs); f1->gs=f2->gs; } if(f2->skip) f1->skip=f2->skip; free(f2); return f1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "create_fformat" static struct fformat *create_fformat(void *p,int fg) { struct fformat *ff; int *i; if(!(ff=malloc(sizeof(struct fformat)))) ABT_FUNC(MMsg); ff->rs=ff->fs=ff->gs=0; ff->skip=0; switch(fg) { case 1: ff->rs=p; break; case 2: ff->fs=p; break; case 3: i=p; ff->skip=*i; break; case 4: ff->gs=p; break; default: ABT_FUNC("Internal error - incorrect flag\n"); } return ff; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_f_atom" static struct format_clause *add_f_atom(struct format_clause *fc,struct format_atom *fa) { if(!fc) { if(!(fc=malloc(sizeof(struct format_clause)))) ABT_FUNC(MMsg); fc->fc_size=16; fc->n_atoms=0; if(!(fc->f_atoms=malloc(sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } if(fc->n_atoms>=fc->fc_size) { fc->fc_size*=2; if(!(fc->f_atoms=realloc(fc->f_atoms,sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } fc->f_atoms[fc->n_atoms++]=fa; return fc; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_f_list" static struct format_clause *add_f_list(struct format_clause *fc,struct format_clause *fc1,int n) { int sz,i,j; sz=fc1->n_atoms*n; if(!fc) { if(!(fc=malloc(sizeof(struct format_clause)))) ABT_FUNC(MMsg); fc->fc_size=16; if(sz>16) fc->fc_size=sz; fc->n_atoms=0; if(!(fc->f_atoms=malloc(sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } else { if(sz>(fc->fc_size-fc->n_atoms)) { fc->fc_size=sz+fc->n_atoms; if(!(fc->f_atoms=realloc(fc->f_atoms,sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } } for(i=0;in_atoms;j++) fc->f_atoms[fc->n_atoms++]=fc1->f_atoms[j]; free(fc1->f_atoms); free(fc1); return fc; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_var" static struct bin_node *alloc_var(char *p) { struct bin_node *node; struct scan_data *sd; int i; if(!(node=malloc(sizeof(struct bin_node)))) ABT_FUNC(MMsg); node->left=node->right=0; node->balance=0; if(!(sd=malloc(sizeof(struct scan_data)))) ABT_FUNC(MMsg); node->data=sd; sd->vtype=0; i=(int)strlen(p); if(!(sd->name=malloc((size_t)i+1))) ABT_FUNC(MMsg); sd->name[i--]=0; for(;i>=0;i--) sd->name[i]=toupper((int)p[i]); sd->n_elements=1; if(!(sd->element=calloc(1,sizeof(struct var_element)))) ABT_FUNC(MMsg); sd->element->arg.element=0; return node; } static struct bin_node *find_var(char *p,struct bin_node *node,struct bin_node **node1,int *balanced) { int i; struct scan_data *sd; sd=node->data; if((i=strcasecmp(p,sd->name))) { if(i<0) { if(node->left) { node->left=find_var(p,node->left,node1,balanced); } else { *node1=node->left=alloc_var(p); *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node=rotate_left(node); *balanced=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *balanced=1; } } } else { if(node->right) { node->right=find_var(p,node->right,node1,balanced); } else { *node1=node->right=alloc_var(p); *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node->balance=0; *balanced=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *balanced=1; } } } } else { *node1=node; *balanced=1; } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Check_var" static void Check_var(struct bin_node *node) { int i; struct var_element *element; struct scan_data *sd; char *nbuf; if(node->left) Check_var(node->left); sd=node->data; i=strlen(sd->name)+4+log((double)(sd->n_elements+1))/log(10.0); if(!(nbuf=malloc((size_t)i))) ABT_FUNC(MMsg); for(i=0;in_elements;i++) { if(sd->vtype&ST_ARRAY) (void)sprintf(nbuf,"%s(%d)",sd->name,i+1); else (void)strcpy(nbuf,sd->name); element=sd->element+i; if(!(element->type&(ST_DATA|ST_TRAITLOCUS|ST_LINKED))) { if(element->type&(ST_MODEL|ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_TRAIT|ST_GROUP)) print_scan_err("Error: No data for variable %s\n",nbuf); } if((element->type&ST_DATA) && (element->type&ST_TRAITLOCUS)) print_scan_err("Error: Variable %s can not have data\n",nbuf); else if((element->type&ST_LINKED) && !(element->type&(ST_TRAITLOCUS|ST_MARKER))) print_scan_err("Error: Variable %s is not a locus and so can not be linked\n",nbuf); else if((element->type&ST_TRAIT) && (element->type&(ST_GROUP|ST_MARKER|ST_TRAITLOCUS|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_LINKED|ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for trait\n",nbuf); else if((element->type&ST_TRAITLOCUS) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_RANDOM|ST_MARKER|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_STRING|ST_REAL|ST_INTEGER|ST_REALTYPE|ST_INTTYPE))) print_scan_err("Error: Variable %s inappropriate type for trait locus\n",nbuf); else if((element->type&ST_MARKER) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_REAL|ST_INTEGER|ST_RANDOM|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_STRING|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for marker\n",nbuf); else if((element->type&ST_HAPLO) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_REAL|ST_RANDOM|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for haplotype\n",nbuf); else if((element->type&ST_RANDOM) && (element->type&(ST_SEX|ST_GROUP|ST_STRING|ST_REAL|ST_INTEGER|ST_REAL))) print_scan_err("Error: Variable %s inappropriate type to be random\n",nbuf); else if((element->type&(ST_INTTYPE|ST_REALTYPE)) && (element->type&(ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Type collision for variable %s\n",nbuf); else if((element->type&ST_INTTYPE) && (element->type&ST_REALTYPE)) print_scan_err("Error: Real variable %s can not also be integer type\n",nbuf); else if((element->type&(ST_STRING|ST_REAL)) && (element->type&(ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM))) print_scan_err("Error: Variable %s can not be a pedigree or sex variable\n",nbuf); else if((element->type&ST_REAL) && (element->type&(ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_SEX))) print_scan_err("Error: Real variable %s can not be a pedigree or sex variable\n",nbuf); else if((element->type&ST_FACTOR) && (element->type&ST_REAL)) print_scan_err("Error: Real variable %s can not be a factor\n",nbuf); else if((element->type&ST_CONSTANT)&&(element->type&ST_MULTIPLE)) print_scan_err("Error: Variable %s can not be in multiple records and be constant\n",nbuf); else if(element->type&(ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_TRAITLOCUS|ST_GROUP|ST_LINKED|ST_MODEL|ST_TRAIT)) element->type|=ST_REQUIRED; else if(element->type&ST_HAPLO) { if(element->arg.element && element->arg.element->type&ST_LINKED) { element->type|=ST_REQUIRED; if(!(element->type&ST_DATA)) print_scan_err("Error: No data for variable %s\n",nbuf); } } if(element->type&ST_MARKER) n_markers++; if(!(element->type&(ST_CONSTANT|ST_MULTIPLE))) element->type|=syst_var[MULTIPLE_RECORDS]?ST_MULTIPLE:ST_CONSTANT; if(element->type&(ST_MARKER|ST_REQUIRED|ST_RESTRICT)) { if(!(element->type&ST_HAPLO)) element->arg.var=node; } else element->type=0; } free(nbuf); if(node->right) Check_var(node->right); } static struct bin_node *create_var(char *p) { int k; struct bin_node *node; if(!root_var) node=root_var=alloc_var(p); else { root_var=find_var(p,root_var,&node,&k); } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "symbol_lookup" int symbol_lookup(char *p,int fg) { static char *Coms[] = {"FILE","LOCUS","LOCI","MARKER","DISCRETE","MODEL","PEDIGREE","LOG", "FILTER","MISSING","MODEL","LINK","RANDOM","TRAIT","WHERE","USE", "REAL","INTEGER","SHELL","ARRAY","PRINT","DO","WHILE","CONSTANT", "MULTIPLE","CENSORED","GROUP","SET","SEX","AFFECTED","UNAFFECTED","OUTPUT","INCLUDE","ERRORDIR", "LAUROUTPUT","RAWOUTPUT","POSITION","FREQUENCY",(char *)0}; static int Com_token[] = {FILEC,LOCUS,LOCUS,MARKER,FACTOR,MODEL,PEDIGREE,LOG, FILTER,MISSING,MODEL,LINK,RANDOM,TRAIT,WHERE,USE, REAL,INTEGER,SHELL,ARRAY,PRINTEXP,DOLOOP,WHILE,CONSTANT, MULTIPLE,CENSORED,GROUP,SET,GENDER,AFFECTED,UNAFFECTED,OUTPUT,INCLUDE,ERRORDIR, LAUROUTPUT,RAWOUTPUT,POSITION,FREQUENCY,SYSTEM_VAR,VARIABLE,ARRAY_VAR}; static char *Syst[] = {"PRUNE_OPTION","RECODE_OPTION","NO_EXTRA_ALLELE", "PEEL_OPTION","TRACE_RESTRICT","TRACE_CENSORED","TRACE_AFFECTED", "CORRECT_ERRORS","TRACE_PEEL","MULTIPLE_RECORDS","MULTIVARIATE_TEST", "ERROR_CHECK","NO_DEFAULT_MISSING","SKIP_BAD_REALS","SKIP_BAD_INTS","IGNORE_CASE",(char *)0}; int i=0,j=0; static struct scan_data *sd; while(Coms[i]) { if(!strcasecmp(Coms[i],p)) break; i++; } at_file=0; if(Com_token[i]==FILEC || Com_token[i]==LINK) at_file=1; if(Com_token[i]==SYSTEM_VAR) { i++; while(Syst[j]) { if(!strcasecmp(Syst[j],p)) { yylval.value=j; i--; break; } j++; } } if(Com_token[i]==VARIABLE) { if(fg==1 && begin_comm) { begin_comm=0; return BREAK; } yylval.var=create_var(p); sd=yylval.var->data; if(sd->vtype&ST_ARRAY) i++; if(fg==1) { begin_comm=1; (void)strcpy(linebuf1,linebuf); lineno1=lineno; } } else if(begin_comm && Com_token[i]!=SYSTEM_VAR && Com_token[i]!=LOCUS && Com_token[i]!=SHELL && !(at_use==1 && Com_token[i]==WHERE) && !(at_use==2 && Com_token[i]==USE)) { begin_comm=0; at_use=0; return BREAK; } else { begin_comm=1; (void)strcpy(linebuf1,linebuf); lineno1=lineno; if(Com_token[i]==MODEL) at_model=1; else at_model=0; if(Com_token[i]==USE || Com_token[i]==CENSORED || Com_token[i]==AFFECTED || Com_token[i]==UNAFFECTED) at_use|=1; else if(Com_token[i]==WHERE) at_use|=2; else at_use=0; } return Com_token[i]; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "symbol_lookup" static struct var_list *add_to_var_list(struct var_list *vlist,struct bin_node *node,struct express *express) { struct var_list *vlist1,*vlist2; struct scan_data *sd=0; int i; if(node) sd=node->data; if(express) i=check_index(sd,express); else { i=0; if(sd && !(sd->vtype&ST_ARRAY)) sd->vtype|=ST_SCALAR; } if(!(vlist1=malloc(sizeof(struct var_list)))) ABT_FUNC(MMsg); vlist1->next=0; vlist1->var=node; vlist1->index=i; vlist2=vlist; if(vlist2) { while(vlist2->next) vlist2=vlist2->next; vlist2->next=vlist1; } else vlist=vlist1; return vlist; } struct var_list *add_var_lists(struct var_list *vlist,struct var_list *vlist1) { struct var_list *vlist2; vlist2=vlist; if(vlist2) { while(vlist2->next) vlist2=vlist2->next; vlist2->next=vlist1; } else vlist=vlist1; return vlist; } static void set_locus_array(struct bin_node *node) { struct scan_data *sd; int i; sd=node->data; if(sd->vtype&ST_ARRAY) { for(i=0;in_elements;i++) { set_locus_element(sd->element+i); } } else yyerror("Not an array"); } static void set_locus_element(struct var_element *element) { element->type|=(ST_MARKER|ST_FACTOR|ST_CONSTANT); if(hap_list[0]) { if(hap_list[0]->arg.element && hap_list[0]->arg.element!=element) { yyerror1("Haplotype vector (left) used twice"); hap_list[0]->arg.element=0; } else hap_list[0]->arg.element=element; } if(hap_list[1]) { if(hap_list[1]->arg.element && hap_list[1]->arg.element!=element) { yyerror1("Haplotype vector (right) used twice"); hap_list[1]->arg.element=0; } else hap_list[1]->arg.element=element; } hap_list[0]=hap_list[1]=0; } static void set_haplo_element(struct var_element *element,struct var_element *element1) { element->type|=(ST_HAPLO|ST_FACTOR|ST_CONSTANT); if(element1) element1->type|=(ST_HAPLO|ST_FACTOR|ST_CONSTANT); hap_list[0]=element; hap_list[1]=element1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_file_com" static void do_file_com(char *fname,struct format_clause *fc,struct fformat *ff,struct var_list *vlist) { int i,j; struct InFile *file; struct format *format; struct var_list *vlist1; struct var_element *element; struct scan_data *sd; if(!vlist) { yyerror1("No variables listed for FILE command\n"); return; } else if(!fname) { free_vlist(vlist); return; } else if(!fname[0]) { yyerror1("Zero length filename for FILE command\n"); free_vlist(vlist); return; } file=Infiles; if(!(Infiles=calloc(1,sizeof(struct InFile)))) ABT_FUNC(MMsg); Infiles->next=file; Infiles->nvar=count_var_list(vlist); if(!(Infiles->element=malloc(sizeof(void *)*Infiles->nvar))) ABT_FUNC(MMsg); i=0; while(vlist) { if(vlist->var) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { element=sd->element+vlist->index-1; element->type|=ST_DATA; Infiles->element[i++]=element; } else { for(j=0;jn_elements;j++) { element=sd->element+j; element->type|=ST_DATA; Infiles->element[i++]=element; } } } else { element=sd->element; element->type|=ST_DATA; Infiles->element[i++]=element; } } else Infiles->element[i++]=0; vlist1=vlist->next; free(vlist); vlist=vlist1; } if(fc) { format=setup_format(fc); Infiles->format=format; if(!(scan_error&FORMAT_ERR)) { if(format->n_atomsn_atoms = %d\n",format->n_atoms); (void)printf("i = %d\n",i); print_scan_err("Line %d: Error - Too many variables for format clause\n",format->line); scan_error|=FORMAT_ERR; } else if(format->n_atoms>i) print_scan_warn("Line %d: Warning - Too few variables for format clause\n",format->line); } } else if(ff) Infiles->fformat=ff; Infiles->name=fname; Infiles->shell_flag=shell_flag; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "change_type" static void change_type(int type,struct var_list *vlist) { int j; struct scan_data *sd; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) sd->element[vlist->index-1].type|=type; else for(j=0;jn_elements;j++) sd->element[j].type|=type; } else sd->element[0].type|=type; vlist=vlist->next; } } static void free_vlist(struct var_list *vlist) { struct var_list *vlist1; while(vlist) { vlist1=vlist->next; free(vlist); vlist=vlist1; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_link_com" static void do_link_com(char *s,int type,struct var_list *vlist) { struct Link *l,*l1,**ll; struct var_list *vlist1; struct var_element *element; struct scan_data *sd=0; int i,j,k; if(vlist) sd=vlist->var->data; if(!s && sd) { if(sd->vtype&ST_ARRAY && vlist->index) { element=sd->element+vlist->index-1; if(element->type&ST_STRING) { s=element->arg.string; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else { element=sd->element; if(element->type&ST_STRING) { s=element->arg.string; vlist1=vlist->next; free(vlist); vlist=vlist1; } } } ll=&links; while(*ll) { l=*ll; if(s) { if(l->name) { if(!strcasecmp(s,l->name)) break; } } else if(!l->name) break; ll=&l->next; } if(*ll) l1=*ll; else { if(!(l1=malloc(sizeof(struct Link)))) ABT_FUNC(MMsg); l1->next=0; l1->name=s; l1->n_loci=0; l1->element=0; l1->type=-1; *ll=l1; } i=count_var_list(vlist); if(l1->type>=0 && l1->type!=type) print_scan_err("Error: Linkage group has inconsistent linkage type\n"); l1->type=type; if(i) { k=i+l1->n_loci; if(l1->element) { if(!(l1->element=realloc(l1->element,sizeof(void *)*k))) ABT_FUNC(MMsg); } else if(!(l1->element=malloc(sizeof(void *)*k))) ABT_FUNC(MMsg); while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { element=sd->element+vlist->index-1; for(i=0;in_loci;i++) { if(l1->element[i]==element) break; } if(i==l1->n_loci) { if(element->type&ST_LINKED) { print_scan_err("Error: %s(%d) appears in multiple linkage groups\n",sd->name,vlist->index); scan_error|=LINK_ERR; } else { element->type|=ST_LINKED; l1->element[l1->n_loci++]=element; } } } else { for(j=0;jn_elements;j++) { element=sd->element+j; for(i=0;in_loci;i++) { if(l1->element[i]==element) break; } if(i==l1->n_loci) { if(element->type&ST_LINKED) { print_scan_err("Error: %s(%d) appears in multiple linkage groups\n",sd->name,vlist->index); scan_error|=LINK_ERR; } else { element->type|=ST_LINKED; l1->element[l1->n_loci++]=element; } } sd->vtype|=ST_LINKED; } } } else { element=sd->element; for(i=0;in_loci;i++) { if(l1->element[i]==element) break; } if(i==l1->n_loci) { if(element->type&ST_LINKED) { print_scan_err("Error: %s appears in multiple linkage groups\n",sd->name); scan_error|=LINK_ERR; } else { element->type|=ST_LINKED; l1->element[l1->n_loci++]=element; } } } vlist1=vlist->next; free(vlist); vlist=vlist1; } if(l1->n_locielement=realloc(l1->element,sizeof(void *)*l1->n_loci))) ABT_FUNC(MMsg); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_missing_com" static void do_missing_com(struct express *expr,struct var_list *vlist,char *s1) { struct var_list *vlist1; struct scan_data *sd; struct var_element **elem; struct Miss *m; int i,j; char *p; if(s1) { if(vlist) ABT_FUNC("Can't have both explicit and implicit scope\n"); if(s1[0]==0) { print_scan_err("Empty scope - MISSING directive ignored\n"); if(expr->type==ST_STRING) free(expr->arg.string); free(s1); return; } qstrip(s1); p=s1; i=j=0; while(*p) { switch(toupper((int)*p)) { case '!': case 'F': case 'G': case 'P': case 'C': case 'R': case 'I': break; default: i=1; } if(i) break; p++; } if(*p) { j=1; print_scan_err("Illegal character '%c' in MISSING scope\n",*p); } else if(*(--p)=='!') { j=1; print_scan_err("MISSING scope can not end with a '!'\n",*p); } if(j) { free(s1); if(expr->type==ST_STRING) free(expr->arg.string); return; } } m=Miss; if(!(Miss=malloc(sizeof(struct Miss)))) ABT_FUNC(MMsg); Miss->Missing.arg=expr->arg; Miss->Missing.type=expr->type; Miss->next=m; Miss->element=0; Miss->scope=0; if((i=count_var_list(vlist))) { if(!(elem=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) elem[i++]=sd->element+vlist->index-1; else for(j=0;jn_elements;j++) elem[i++]=sd->element+j; } else elem[i++]=sd->element; Miss->element=elem; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else if(s1) Miss->scope=s1; Miss->nvar=i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_model_com" static void do_model_com(struct model_list *mlist,struct bin_node *node,struct express *express) { struct model *model,*model1; struct var_element *element; struct scan_data *sd; sd=node->data; if(!(model=malloc(sizeof(struct model)))) ABT_FUNC(MMsg); model->next=0; if(Models) { model1=Models; while(model1->next) model1=model1->next; model1->next=model; } else Models=model; model->trait=sd; if(!express) { model->index=0; sd->element[0].type|=ST_TRAIT; } else { element=get_element(node,express); if(element) { model->index=(int)express->arg.value; element->index=element->oindex=model->index; element->type|=ST_TRAIT; } else model->trait=0; } model->model_list=mlist; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_censored" static void add_censored(struct var_element *element,const int fg) { struct operation *ops,*ops1,*ops2; struct Censor *cen; if(fg==1 && !element) { print_scan_err("Error: Nothing to censor!\n"); return; } ops=Op_List; /* Reverse list order (really return list to original order! */ if(ops) { ops1=ops->next; while(ops1) { ops2=ops1->next; ops1->next=ops; ops=ops1; ops1=ops2; } Op_List->next=0; Op_List=ops; } switch(fg) { case 1: if(!(cen=malloc(sizeof(struct Censor)))) ABT_FUNC(MMsg); cen->next=Censored; Censored=cen; cen->Op_List=ops; cen->element=element; element->type|=ST_CENSORED; break; case 0: if(Affected) print_scan_warn("Warning - new affected statement overrules previous statement\n"); Affected=ops; break; case 2: if(Unaffected) print_scan_warn("Warning - new unaffected statement overrules previous statement\n"); Unaffected=ops; break; } ops=Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_RESTRICT; ops=ops->next; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_restriction" static void add_restriction(struct var_list *vlist) { struct operation *ops,*ops1,*ops2; struct Restrict *res; struct var_list *vlist1; struct scan_data *sd; int i,j; ops=Op_List; /* Reverse list order (really return list to original order! */ if(ops) { ops1=ops->next; while(ops1) { ops2=ops1->next; ops1->next=ops; ops=ops1; ops1=ops2; } Op_List->next=0; Op_List=ops; } if(!(res=malloc(sizeof(struct Restrict)))) ABT_FUNC(MMsg); res->next=Restrictions; Restrictions=res; res->Op_List=ops; if((res->nvar=count_var_list(vlist))) { if(!(res->element=malloc(sizeof(void *)*res->nvar))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) res->element[i++]=sd->element+vlist->index-1; else for(j=0;jn_elements;j++) res->element[i++]=sd->element+j; } else res->element[i++]=sd->element; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else res->element=0; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_RESTRICT; ops=ops->next; } } static void find_markers(struct bin_node *node,int *i) { int j; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) if(sd->element[j].type&ST_MARKER) { if(sd->element[j].type&ST_REQUIRED) { markers[*i].element=sd->element+j; markers[*i].var=sd; markers[(*i)++].index=j+1; } } } static void find_trait_loci(struct bin_node *node,int *i) { int j; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) if(sd->element[j].type&ST_TRAITLOCUS) { if(traitlocus) { traitlocus[*i].element=sd->element+j; traitlocus[*i].var=sd; traitlocus[(*i)].index=j+1; } (*i)++; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_haplo" static void find_haplo(struct bin_node *node) { int j,k; struct scan_data *sd; sd=node->data; for(k=0;kn_elements;k++) if(sd->element[k].type&ST_HAPLO) { for(j=0;jelement[k].arg.element==markers[j].element) { if(!markers[j].hap_element[0]) markers[j].hap_element[0]=sd->element+k; else if(!markers[j].hap_element[1]) markers[j].hap_element[1]=sd->element+k; else { if(markers[j].index) print_scan_err("Error: marker %s(%d) has >2 haplotype vectors associated with it\n",markers[j].var->name,markers[j].index); else print_scan_err("Error: marker %s has >2 haplotype vectors associated with it\n",markers[j].var->name); } break; } if(j==n_markers) ABT_FUNC("Internal error: can not find marker for haplotype vector\n"); } } static void strip_names(struct bin_node *node) { char *p; int i; struct scan_data *sd; sd=node->data; if((p=sd->name)) { i=strlen(p); if(i>2) { if(p[i-1]=='_' && p[0]=='_') { p[i-1]=0; memmove(p,p+1,i-1); } } } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "ReadControl" int ReadControl(FILE *fptr,char *cname,char **lfile) { int i,j,k; void yy_cleanup(void); struct InFile *infile,**infile_p; struct Restrict *res,*res1,**res_p; struct Censor *cen,**cen_p; struct var_element *elem; struct Link *linkp; struct operation *ops; struct express tmp_expr; yyin=fptr; fname_list[0]=cname; list_ptr=0; if(!(f_atom_list=malloc(sizeof(struct format_atom)*f_atom_size))) ABT_FUNC(MMsg); for(i=0;itype&ST_INTTYPE) break; if(i<3) for(i=0;i<3;i++) pedlist[i+family_id]->type|=ST_INTTYPE; } if(root_var) Check_var(root_var); /* Flag variables used as the operands to a restriction statement *whose result is used* as ST_REQUIRED */ res=0; while(res!=Restrictions) { res1=Restrictions; while(res1->next!=res) res1=res1->next; for(i=j=0;invar;i++) if(res1->element[i]->type&ST_REQUIRED) { j=1; break; } if(!res1->nvar || j) { ops=res1->Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } res=res1; } /* Delete restrict structures that are not used */ res=Restrictions; res_p= &Restrictions; while(res) { for(i=j=0;invar;i++) if(res->element[i]->type&ST_REQUIRED) { j=1; break; } if(res->nvar && !j) { *res_p=res->next; free_restrict(res); res= *res_p; } else { res_p= &res->next; res=res->next; } } if(Unaffected && !Affected) print_scan_err("Error: Unaffected definition without affected definition\n"); /* Flag variables used in censored statements as required. Delete unused censored statements */ cen=Censored; cen_p= &Censored; while(cen) { if(cen->element->type&ST_TRAIT) { ops=cen->Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } cen_p= &cen->next; cen=cen->next; } else { *cen_p=cen->next; free_op(cen->Op_List); free(cen); cen= *cen_p; } } if((ops=Affected)) { while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } if((ops=Unaffected)) { while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } /* Check file structures - remove ones that aren't needed */ infile=Infiles; infile_p= &Infiles; while(infile) { infile->ncol=0; for(i=0;invar;i++) { elem=infile->element[i]; if(elem) elem->type&=~ST_FLAG; } for(k=infile->nvar-1;k>=0;k--) { elem=infile->element[k]; if(elem && (elem->type&ST_REQUIRED)) break; } for(i=j=0;invar;i++) { elem=infile->element[i]; if(elem) { if((elem->type&ST_MARKER) && !(elem->type&ST_REQUIRED)) { if(jtype|=(ST_REQUIRED|ST_NOT_REALLY_REQUIRED); else elem->type=0; } if(elem->type&ST_REQUIRED) { if(elem->type&ST_FLAG) { print_scan_err("Error: Duplicate variables for file %s\n",infile->name); break; } elem->type|=ST_FLAG; if(elem->type&ST_ID) { j|=1; infile->id_col=infile->ncol; } else if(elem->type&ST_FAMILY) { j|=2; infile->family_col=infile->ncol; } infile->ncol++; } else infile->element[i]=0; } } for(i=0;invar;i++) if(infile->element[i]) infile->element[i]->type&=~ST_FLAG; if(!(j&1)) print_scan_err("Error: No id column for file %s\n",infile->name); else if(family_id && j!=3) print_scan_err("Error: No family column for file %s\n",infile->name); if(infile->ncol==1) { *infile_p=infile->next; free_infile(infile); infile= *infile_p; } else { infile_p= &infile->next; infile=infile->next; } } if(!Infiles) print_scan_err("Error: No input files with data\n"); free(f_atom_list); /* Count markers and link up with haplotype vectors */ if(n_markers) { if(!(markers=calloc((size_t)n_markers,sizeof(struct Marker)))) ABT_FUNC(MMsg); for(i=0;itype&ST_NOT_REALLY_REQUIRED) continue; linkp=links; j=0; while(linkp) { j++; for(k=0;kn_loci;k++) { if(linkp->element[k]==markers[i].element) { markers[i].link=j; break; } } if(kn_loci) break; linkp=linkp->next; } if(!linkp) { if(markers[i].var->vtype&ST_ARRAY) abt(__FILE__,__LINE__,"%s(): No linkage group specified for candidate gene %s(%d)\n",FUNC_NAME,markers[i].var->name,markers[i].index); else abt(__FILE__,__LINE__,"%s(): No linkage group specified for candidate gene %s\n",FUNC_NAME,markers[i].var->name); } if(markers[i].hap_element[0]) { if(markers[i].element->type&ST_DATA) { if(markers[i].var->vtype&ST_ARRAY) print_scan_err("Error: marker variable %s(%d) can not have both genotype and haplotype data\n",markers[i].var->name,markers[i].index); else print_scan_err("Error: marker variable %s can not have both genotype and haplotype data\n",markers[i].var->name); } if(markers[i].hap_element[0]->type&ST_INTTYPE) markers[i].hap_element[1]->type|=ST_INTTYPE; if(markers[i].hap_element[1] && markers[i].hap_element[1]->type&ST_INTTYPE) markers[i].hap_element[0]->type|=ST_INTTYPE; } else { if(!(markers[i].element->type&ST_DATA)) { if(markers[i].var->vtype&ST_ARRAY) print_scan_err("Error: marker variable %s(%d) has no data\n",markers[i].var->name,markers[i].index); else print_scan_err("Error: marker variable %s has no data\n",markers[i].var->name); } } } } i=0; if(root_var) check_vars(root_var,&i,find_trait_loci); if(i) { if(i>1) print_scan_err("Error: multiple trait loci indicated\n"); else { if(!(traitlocus=calloc(1,sizeof(struct Marker)))) ABT_FUNC(MMsg); traitlocus->order=0; traitlocus->o_size=0; i=0; check_vars(root_var,&i,find_trait_loci); } } if(Models && Models->next && !syst_var[MULTIVARIATE_TEST]) { print_scan_err("Error: Multiple models not currently supported\n"); } } *lfile=LogFile; if(!scan_error_n && !Miss && !syst_var[NO_DEFAULT_MISSING]) { tmp_expr.arg.string=strdup("0"); tmp_expr.type=ST_STRING; do_missing_com(&tmp_expr,0,strdup("PF")); } return scan_error_n; } loki/prepsrc/control_parse.h0100644000076500007650000001010307747752271015511 0ustar heathheath/* A Bison parser, made from control_parse.y, by GNU bison 1.75. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ #ifndef BISON_Y_TAB_H # define BISON_Y_TAB_H /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { FILEC = 258, MARKER = 259, LOCUS = 260, TRAIT = 261, RANDOM = 262, PEDIGREE = 263, LOG = 264, MODEL = 265, FILTER = 266, LINK = 267, MISSING = 268, FACTOR = 269, BREAK = 270, DOLOOP = 271, WHILE = 272, USE = 273, WHERE = 274, ORSYMBOL = 275, ANDSYMBOL = 276, NEQSYMBOL = 277, LEQSYMBOL = 278, GEQSYMBOL = 279, NOTSYMBOL = 280, LOGICAL = 281, SHELL = 282, ARRAY = 283, PRINTEXP = 284, INCLUDE = 285, RAWOUTPUT = 286, LOOP_CLAUSE_START = 287, LOOP_CLAUSE_END = 288, CONSTANT = 289, MULTIPLE = 290, RSFORMAT = 291, FSFORMAT = 292, SKIPFORMAT = 293, GSFORMAT = 294, CENSORED = 295, GROUP = 296, SET = 297, GENDER = 298, AFFECTED = 299, OUTPUT = 300, ERRORDIR = 301, LAUROUTPUT = 302, UNAFFECTED = 303, POSITION = 304, FREQUENCY = 305, STRING = 306, VARIABLE = 307, ASSIGN = 308, ARRAY_VAR = 309, INTEGER = 310, SYSTEM_VAR = 311, REAL = 312, UMINUS = 313 }; #endif #define FILEC 258 #define MARKER 259 #define LOCUS 260 #define TRAIT 261 #define RANDOM 262 #define PEDIGREE 263 #define LOG 264 #define MODEL 265 #define FILTER 266 #define LINK 267 #define MISSING 268 #define FACTOR 269 #define BREAK 270 #define DOLOOP 271 #define WHILE 272 #define USE 273 #define WHERE 274 #define ORSYMBOL 275 #define ANDSYMBOL 276 #define NEQSYMBOL 277 #define LEQSYMBOL 278 #define GEQSYMBOL 279 #define NOTSYMBOL 280 #define LOGICAL 281 #define SHELL 282 #define ARRAY 283 #define PRINTEXP 284 #define INCLUDE 285 #define RAWOUTPUT 286 #define LOOP_CLAUSE_START 287 #define LOOP_CLAUSE_END 288 #define CONSTANT 289 #define MULTIPLE 290 #define RSFORMAT 291 #define FSFORMAT 292 #define SKIPFORMAT 293 #define GSFORMAT 294 #define CENSORED 295 #define GROUP 296 #define SET 297 #define GENDER 298 #define AFFECTED 299 #define OUTPUT 300 #define ERRORDIR 301 #define LAUROUTPUT 302 #define UNAFFECTED 303 #define POSITION 304 #define FREQUENCY 305 #define STRING 306 #define VARIABLE 307 #define ASSIGN 308 #define ARRAY_VAR 309 #define INTEGER 310 #define SYSTEM_VAR 311 #define REAL 312 #define UMINUS 313 #ifndef YYSTYPE #line 44 "control_parse.y" typedef union { char *string; struct bin_node *var; int value; double rvalue; struct format_clause *format_clause; struct fformat *fformat; struct format_atom *f_atom; struct model_list *model_list; struct var_list *var_list; struct var_element *element; struct express *express; } yystype; /* Line 1281 of /usr/local/share/bison/yacc.c. */ #line 170 "y.tab.h" # define YYSTYPE yystype #endif extern YYSTYPE yylval; #endif /* not BISON_Y_TAB_H */ loki/prepsrc/control_parse.y0100644000076500007650000020000207747752267015536 0ustar heathheath%{ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * control_parse.y: * * * * yacc source for control file parser. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include "utils.h" #ifndef YYDEBUG #define YYDEBUG 0 #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 0 #endif #ifndef __GNUC__ #define __GNUC__ 0 #endif %} %union { char *string; struct bin_node *var; int value; double rvalue; struct format_clause *format_clause; struct fformat *fformat; struct format_atom *f_atom; struct model_list *model_list; struct var_list *var_list; struct var_element *element; struct express *express; } %token FILEC MARKER LOCUS TRAIT RANDOM PEDIGREE LOG %token MODEL FILTER LINK MISSING FACTOR BREAK DOLOOP WHILE %token USE WHERE ORSYMBOL ANDSYMBOL NEQSYMBOL LEQSYMBOL GEQSYMBOL %token NOTSYMBOL LOGICAL SHELL ARRAY PRINTEXP INCLUDE RAWOUTPUT %token LOOP_CLAUSE_START LOOP_CLAUSE_END CONSTANT MULTIPLE RSFORMAT FSFORMAT %token SKIPFORMAT GSFORMAT CENSORED GROUP SET GENDER AFFECTED OUTPUT %token ERRORDIR LAUROUTPUT UNAFFECTED POSITION FREQUENCY %token STRING %token VARIABLE ASSIGN ARRAY_VAR %token INTEGER SYSTEM_VAR %token REAL %type complex_string complex_string1 filename_string %type formatlist %type fformatlist fformat %type format %type modellist %type fsingle_vlist filevarlist varlist interactionlist single_vlist simple_varlist loop_clause %type single_element assignment %type expression condition %type linkcom1 %type variable %left ORSYMBOL %left ANDSYMBOL %left '=' NEQSYMBOL %left '<' '>' LEQSYMBOL GEQSYMBOL %left '+' '-' %left '*' '.' '/' %left NOTSYMBOL UMINUS %{ #include "scan.h" #include "scanner.h" static struct format_atom *make_f_atom(int,int); static struct format_clause *add_f_atom(struct format_clause *,struct format_atom *); static struct format_clause *add_f_list(struct format_clause *,struct format_clause *,int); static struct format *setup_format(struct format_clause *); static struct bin_node *create_var(char *); static struct model_list *add_to_model(struct model_list *,struct var_list *); static struct var_list *add_to_var_list(struct var_list *,struct bin_node *,struct express *); static struct var_list *add_var_lists(struct var_list *,struct var_list *); static struct var_element *get_element(struct bin_node *,struct express *); static struct var_element *assign_var(struct bin_node *,struct express *,struct express *); static struct express *alloc_express(void); static struct express *do_express_op(struct express *,struct express *,int); static struct express *do_logical_op(struct express *,struct express *,int); static struct fformat *add_fformat(struct fformat *,struct fformat *); static struct fformat *create_fformat(void *,int); static void begin_looping(struct var_element *, struct express *, struct express *); static void free_vlist(struct var_list *); static void do_ped_com(struct var_list *); static void add_restriction(struct var_list *); static void add_censored(struct var_element *,const int); static void do_file_com(char *,struct format_clause *,struct fformat *,struct var_list *); static void set_locus_array(struct bin_node *); static void set_locus_element(struct var_element *); static void set_haplo_element(struct var_element *,struct var_element *); static void do_link_com(char *s,int type, struct var_list *); static void do_missing_com(struct express *,struct var_list *,char *); static void change_type(int,struct var_list *); static void do_model_com(struct model_list *,struct bin_node *,struct express *); static void add_operation(void *,int,int); static void set_array_var(struct scan_data *,struct express *); static void check_element_add_op(struct var_element *); static void enter_loop(void); static void start_loopclause(void); static void do_while_com(struct express *); static void print_exp(struct express *); static void new_command(void); static void set_sex(struct var_element *,struct express *,struct express *); static void set_group(struct var_element *); static int count_var_list(struct var_list *),shell_flag; static struct format_atom *f_atom_list; static struct var_element *pedlist[4]; static int f_atom_n,f_atom_size=32,pedflag; struct operation *Affected,*Unaffected; struct bin_node *root_var; struct InFile *Infiles; struct Link *links; struct Miss *Miss; struct Restrict *Restrictions; struct Censor *Censored; struct model *Models; static struct operation *Op_List; struct Marker *markers,*traitlocus; static struct var_element *hap_list[2]; struct express *sex_exp[2]; struct sex_def *sex_def; struct var_element *group_elem; static char *string_copy(char *s1,char *s2); static char *LogFile; int scan_error,scan_error_n,scan_warn_n; int max_scan_errors=30,max_scan_warnings=30,n_markers,iflag,file_skip; char *Filter,*ErrorDir,*rsformat,*fsformat,*gsformat,*OutputFile,*OutputRawFile,*OutputLaurFile; int loop_level,loop_ptr[MAX_LOOP],loop_stat[MAX_LOOP],loop_record,loop_stack_size=256; int loop_main_ptr,in_loopclause,loop_clause_end,loop_clause_step,loop_clause_ptr; int syst_var[NUM_SYSTEM_VAR]; int family_id; struct var_element *loop_clause_element; struct token_store *loop_stack; %} %% comfile: command { new_command(); } | error { new_command(); } | comfile BREAK | comfile BREAK command { new_command(); } | comfile BREAK error { new_command(); } ; command: filecommand | filtercommand | includecommand | logcommand | pedcommand | locicommand | changetypecommand | linkcommand | modelcommand | missingcommand | usecommand | wherecommand | assigncommand | arraycommand | printcommand | docommand | whilecommand | censorcommand | affectedcommand | groupcommand | setcommand | defformatcommand | sexcommand | outputcommand | errordircommand ; assigncommand: assignment {} ; assignment: ASSIGN '=' expression { $$=assign_var($1,0,$3); if($3) free($3);} | ASSIGN '(' expression ')' '=' expression { $$=assign_var($1,$3,$6); if($3) free($3); if($6) free($6);} ; expression: REAL { $$=alloc_express(); $$->type=ST_REAL; $$->arg.rvalue=$1; } | INTEGER { $$=alloc_express(); $$->type=ST_INTEGER; $$->arg.value=$1; } | STRING { $$=alloc_express(); $$->type=ST_STRING; $$->arg.string=$1; } | single_element { $$=alloc_express(); $$->type=$1->type; if($1->type==ST_STRING) $$->arg.string=string_copy(0,$1->arg.string); else $$->arg=$1->arg; } | expression '+' expression { $$=do_express_op($1,$3,'+'); } | expression '-' expression { $$=do_express_op($1,$3,'-'); } | expression '*' expression { $$=do_express_op($1,$3,'*'); } | expression '/' expression { $$=do_express_op($1,$3,'/'); } | '-' expression %prec UMINUS { $$=do_express_op($2,0,'-'); } | '(' expression ')' { $$=$2; } ; setcommand: SET SYSTEM_VAR INTEGER { syst_var[$2]=$3; } | SET variable INTEGER { yyerror("Unrecognized system variable"); } ; docommand: DOLOOP { enter_loop(); } ; includecommand: INCLUDE {iflag=1;} complex_string {include_control_file($3);} ; censorcommand: CENSORED single_element WHERE '(' res_condition ')' { add_censored($2,1); at_use=0;} ; affectedcommand: AFFECTED WHERE '(' res_condition ')' { add_censored(0,0); at_use=0;} | UNAFFECTED WHERE '(' res_condition ')' { add_censored(0,2); at_use=0;} ; sexcommand: GENDER single_element expression ',' expression { set_sex($2,$3,$5); } ; whilecommand: WHILE '(' condition ')' { do_while_com($3); if($3) free($3);} ; condition: expression | condition '=' condition {$$=do_logical_op($1,$3,'=');} | condition NEQSYMBOL condition {$$=do_logical_op($1,$3,NEQSYMBOL);} | condition LEQSYMBOL condition {$$=do_logical_op($1,$3,LEQSYMBOL);} | condition GEQSYMBOL condition {$$=do_logical_op($1,$3,GEQSYMBOL);} | condition '<' condition {$$=do_logical_op($1,$3,'<');} | condition '>' condition {$$=do_logical_op($1,$3,'>');} | condition ORSYMBOL condition {$$=do_logical_op($1,$3,ORSYMBOL);} | condition ANDSYMBOL condition {$$=do_logical_op($1,$3,ANDSYMBOL);} | NOTSYMBOL condition {$$=do_logical_op($2,0,NOTSYMBOL);} ; printcommand: PRINTEXP printlist { (void)fputc('\n',stdout); } ; printlist: expression { print_exp($1); if($1) free($1); } | printlist ',' expression { print_exp($3); if($3) free($3); } ; defformatcommand: RSFORMAT complex_string {if(rsformat) free(rsformat); rsformat=$2;} | FSFORMAT complex_string {if(fsformat) free(fsformat); fsformat=$2;} | GSFORMAT complex_string {if(gsformat) free(gsformat); gsformat=$2;} | SKIPFORMAT INTEGER {file_skip=$2;} ; arraycommand: ARRAY arraylist; arraylist: VARIABLE '(' expression ')' {set_array_var($1->data,$3); if($3) free($3); } | arraylist ',' VARIABLE '(' expression ')' {set_array_var($3->data,$5); if($5) free($5); } ; usecommand: USE varlist WHERE '(' res_condition ')' {add_restriction($2);at_use=0;} | USE WHERE '(' res_condition ')' {add_restriction(0);at_use=0;} ; wherecommand: WHERE '(' res_condition ')' USE varlist {add_restriction($6);at_use=0;} | WHERE '(' res_condition ')' {add_restriction(0);at_use=0;} ; res_condition: INTEGER {add_operation(&($1),INTEGER,0);} | REAL {add_operation(&($1),REAL,0);} | STRING {add_operation($1,STRING,0);} | single_element {if($1) check_element_add_op($1);} | res_condition '+' res_condition {add_operation(0,0,'+');} | res_condition '-' res_condition {add_operation(0,0,'-');} | res_condition '*' res_condition {add_operation(0,0,'*');} | res_condition '/' res_condition {add_operation(0,0,'/');} | '(' res_condition ')' | '-' res_condition %prec UMINUS {add_operation(0,0,UMINUS);} | res_condition '=' res_condition {add_operation(0,0,'=');} | res_condition NEQSYMBOL res_condition {add_operation(0,0,NEQSYMBOL);} | res_condition LEQSYMBOL res_condition {add_operation(0,0,LEQSYMBOL);} | res_condition GEQSYMBOL res_condition {add_operation(0,0,GEQSYMBOL);} | res_condition '<' res_condition {add_operation(0,0,'<');} | res_condition '>' res_condition {add_operation(0,0,'>');} | res_condition ORSYMBOL res_condition {add_operation(0,0,ORSYMBOL);} | res_condition ANDSYMBOL res_condition {add_operation(0,0,ANDSYMBOL);} | NOTSYMBOL res_condition {add_operation(0,0,NOTSYMBOL);} ; filecommand: FILEC filename_string ',' filevarlist { do_file_com($2,0,0,$4); } | FILEC '[' formatlist ']' filename_string ',' filevarlist { do_file_com($5,$3,0,$7); } | FILEC '[' fformatlist ']' filename_string ',' filevarlist { do_file_com($5,0,$3,$7); } ; filename_string: complex_string { $$=$1; } | SHELL '(' complex_string ')' { $$=$3; shell_flag=1; } ; formatlist: format {$$=add_f_atom(0,$1); } | formatlist ',' format {$$=add_f_atom($1,$3); } | INTEGER '(' formatlist ')' {$$=add_f_list(0,$3,$1); } | formatlist ',' INTEGER '(' formatlist ')' {$$=add_f_list($1,$5,$3); } ; fformatlist: fformat | fformatlist ',' fformat {$$=add_fformat($1,$3); } | fformatlist ';' fformat {$$=add_fformat($1,$3); } ; fformat: FSFORMAT complex_string {$$=create_fformat($2,2); } | RSFORMAT complex_string {$$=create_fformat($2,1); } | GSFORMAT complex_string {$$=create_fformat($2,4); } | SKIPFORMAT INTEGER {$$=create_fformat(&$2,3); } ; format: INTEGER {$$=make_f_atom($1,0);} | INTEGER 'x' {$$=make_f_atom($1,1);} | 'x' {$$=make_f_atom(1,1);} | INTEGER error {$$=make_f_atom(0,1); scan_error|=FORMAT_ERR; } | error {$$=make_f_atom(0,1); scan_error|=FORMAT_ERR; } ; logcommand: LOG complex_string { if(LogFile) free(LogFile); LogFile=$2; } ; outputcommand: OUTPUT complex_string { if(OutputFile) free(OutputFile); OutputFile=$2; } | LAUROUTPUT complex_string { if(OutputLaurFile) free(OutputLaurFile); OutputLaurFile=$2; } | RAWOUTPUT complex_string { if(OutputRawFile) free(OutputRawFile); OutputRawFile=$2; } ; errordircommand: ERRORDIR complex_string { if(ErrorDir) free(ErrorDir); ErrorDir=$2;} ; missingcommand: MISSING expression { do_missing_com($2,0,0); free($2); } | MISSING expression varlist { do_missing_com($2,$3,0); free($2); } | MISSING expression ',' varlist { do_missing_com($2,$4,0); free($2); } | MISSING '[' complex_string ']' expression { do_missing_com($5,0,$3); free($5); } ; pedcommand: PEDIGREE varlist { do_ped_com($2); } ; locicommand: MARKER LOCUS locuslist | TRAIT LOCUS varlist { change_type(ST_TRAITLOCUS,$3); free_vlist($3);} ; changetypecommand: CONSTANT varlist { change_type(ST_CONSTANT,$2); free_vlist($2);} | MULTIPLE varlist { change_type(ST_MULTIPLE,$2); free_vlist($2);} | RANDOM varlist { change_type(ST_RANDOM|ST_FACTOR,$2); free_vlist($2);} | FACTOR varlist { change_type(ST_FACTOR,$2); free_vlist($2);} | REAL varlist {change_type(ST_REALTYPE,$2); free_vlist($2);} | INTEGER varlist {change_type(ST_INTTYPE,$2); free_vlist($2);} ; linkcom1: LINK { $$=LINK_AUTO; } | LINK '[' 'x' ']' { $$=LINK_X; } | LINK '[' 'y' ']' { $$=LINK_Y; } ; linkcommand: linkcom1 varlist { do_link_com(0,$1,$2); } | linkcom1 complex_string1 ',' varlist { do_link_com($2,$1,$4); } | linkcom1 complex_string1 { do_link_com($2,$1,0); } ; filtercommand: FILTER complex_string { if(Filter) { print_scan_warn("Line %d: Warning - Filter defined twice\n",lineno); free(Filter); } Filter=$2; } ; modelcommand: MODEL variable '=' modellist {do_model_com($4,$2,0);} | MODEL ARRAY_VAR '(' expression ')' '=' modellist {do_model_com($7,$2,$4); if($4) free($4); } ; groupcommand: GROUP single_element {set_group($2);} ; modellist: modellist '+' single_vlist { $$=add_to_model($1,$3); } | modellist '+' interactionlist { $$=add_to_model($1,$3); } | interactionlist { $$=add_to_model(0,$1); } | single_vlist { $$=add_to_model(0,$1); } ; interactionlist: single_vlist '*' single_vlist { $$=add_var_lists($1,$3); } | single_vlist '.' single_vlist { $$=add_var_lists($1,$3); } | interactionlist '*' single_vlist { $$=add_var_lists($1,$3); } | interactionlist '.' single_vlist { $$=add_var_lists($1,$3); } ; variable: VARIABLE | GENDER { $$=create_var("SEX"); } ; single_vlist: variable { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR '(' expression ')' { $$=add_to_var_list(0,$1,$3); if($3) free($3); } ; single_element: variable { $$=get_element($1,0); } | ARRAY_VAR '(' expression ')' { $$=get_element($1,$3); if($3) free($3); } ; locuslist: locus | locuslist ',' locus; locus: single_element lociclause { if($1) set_locus_element($1); } | single_element { if($1) set_locus_element($1); } | ARRAY_VAR { if($1) set_locus_array($1); } ; lociclause: '[' single_element ']' { if($2) set_haplo_element($2,0); } | '[' single_element ',' single_element ']' { if($2) set_haplo_element($2,$4); } | '[' error ']' ; simple_varlist: single_vlist | simple_varlist ',' single_vlist { $$=add_var_lists($1,$3); } ; open_bracket: '(' { start_loopclause(); } ; loop_clause1: open_bracket simple_varlist ',' BREAK assignment ',' expression ')' { free_vlist($2); begin_looping($5,$7,0); } | open_bracket simple_varlist ',' BREAK assignment ',' expression ',' expression ')' { free_vlist($2); begin_looping($5,$7,$9); } ; loop_clause: loop_clause1 LOOP_CLAUSE_START simple_varlist LOOP_CLAUSE_END { $$=$3; in_loopclause=0; } | loop_clause1 { $$=0; in_loopclause=0; } ; fsingle_vlist: { $$=add_to_var_list(0,0,0); } | variable { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR '(' expression ')' { $$=add_to_var_list(0,$1,$3); if($3) free($3); } ; filevarlist: fsingle_vlist | loop_clause | filevarlist ',' fsingle_vlist { $$=add_var_lists($1,$3); } | filevarlist ',' loop_clause { $$=add_var_lists($1,$3); } ; varlist: single_vlist | loop_clause | varlist ',' single_vlist { $$=add_var_lists($1,$3); } | varlist ',' loop_clause { $$=add_var_lists($1,$3); } ; complex_string1: STRING { $$ = $1; } | complex_string1 '+' STRING { $$ = string_copy($1,$3); free($3); } | single_element '+' complex_string1 { if($1 && ($1->type&ST_STRING)) $$ = string_copy($3,$1->arg.string); else $$=$3; } ; complex_string: STRING { $$ = $1; } | single_element { if($1 && ($1->type&ST_STRING)) $$ = string_copy(0,$1->arg.string); else $$=0; } | complex_string '+' STRING { $$ = string_copy($1,$3); free($3); } | complex_string '+' single_element { if($3 && ($3->type&ST_STRING)) $$ = string_copy($1,$3->arg.string); else $$=$1; } ; %% static void enter_loop(void) { if(loop_leveltype==ST_INTEGER) loop_clause_end=(int)exp1->arg.value; else er=1; if(!er && exp2) { if(exp2->type==ST_INTEGER) loop_clause_step=(int)exp2->arg.value; else er=1; } else loop_clause_step=1; if(element->type&ST_INTEGER) { i=(int)element->arg.value; if(loop_clause_step<0) { if(iloop_clause_end) er= -1; } else er=1; } else er=2; if(er) { switch(er) { case 1: yyerror("Loop variable not integer type\n"); break; case 2: yyerror("Syntax error\n"); break; } loop_record=loop_stat[--loop_level]; if(!loop_record) loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; in_loopclause=0; } else { in_loopclause= -1; loop_record= -1; loop_clause_ptr=loop_main_ptr; loop_clause_element=element; loop_main_ptr=loop_ptr[loop_level-1]; } if(exp1) free(exp1); if(exp2) free(exp2); } static int if_true(struct express *express) { int l=0; if(express) { switch(express->type) { case ST_INTEGER: l=(express->arg.value!=0); break; case ST_REAL: l=(express->arg.rvalue!=0.0); break; case ST_STRING: if(express->arg.string && express->arg.string[0]) l=1; } } return l; } static void do_while_com(struct express *express) { int i; if(loop_level) { if(!scan_error_n && if_true(express)) { loop_record= -1; loop_main_ptr=loop_ptr[loop_level-1]; } else { loop_record=loop_stat[--loop_level]; if(!loop_record) { i=loop_main_ptr-1; loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; for(;i>=loop_main_ptr;i--) { if(loop_stack[i].token==STRING) free(loop_stack[i].yylval.string); } } } } else yyerror("WHILE outside of do loop\n"); } static void print_exp(struct express *express) { if(!express) return; switch(express->type) { case ST_STRING: (void)fputs(express->arg.string,stdout); free(express->arg.string); break; case ST_INTEGER: (void)printf("%ld",express->arg.value); break; case ST_REAL: (void)printf("%g",express->arg.rvalue); break; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_sex" static void set_sex(struct var_element *elem,struct express *exp1,struct express *exp2) { struct sex_def *se; if(!exp1 || !exp2) yyerror1("Null arguments to sex command\n"); else { if(exp1->type != exp2->type) yyerror1("Arguments to sex command of different type\n"); else if(exp1->type!=ST_INTEGER && exp1->type!=ST_STRING) yyerror1("Arguments to sex command of invalid type\n"); else { if(!(se=malloc(sizeof(struct sex_def)))) ABT_FUNC(MMsg); se->sex_exp[0]=exp1; se->sex_exp[1]=exp2; se->sex_elem=elem; elem->type|=(ST_SEX|ST_FACTOR|ST_CONSTANT|ST_DATA); if(exp1->type==ST_INTEGER) elem->type|=ST_INTTYPE; se->next=sex_def; sex_def=se; } } } static void set_group(struct var_element *elem) { if(group_elem) yyerror1("Error: Multiple group commands"); else { group_elem=elem; group_elem->type|=(ST_GROUP|ST_FACTOR|ST_CONSTANT); } } static void do_ped_com(struct var_list *vlist) { int i,j,n; struct var_list *vlist1; struct scan_data *sd; if(pedflag) { yyerror1("Error: Multiple pedigree commands"); scan_error|=PED_ERR; } pedflag=1; n=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { if(n<4) pedlist[n]=sd->element+vlist->index-1; n++; } else for(i=0;in_elements;i++) { if(n<4) pedlist[n]=sd->element+i; n++; } } else { if(n<4) pedlist[n]=sd->element; n++; } vlist1=vlist->next; free(vlist); vlist=vlist1; } if(n!=3 && n!=4) { yyerror1("Error: Wrong no. variables for pedigree command (3 or 4 required)"); scan_error|=PED_ERR; } else { for(i=1;itype|=(ST_FAMILY|ST_FACTOR|ST_CONSTANT); family_id=1; i=1; } else i=0; pedlist[i++]->type|=(ST_ID|ST_FACTOR|ST_CONSTANT); pedlist[i++]->type|=(ST_SIRE|ST_FACTOR|ST_CONSTANT); pedlist[i++]->type|=(ST_DAM|ST_FACTOR|ST_CONSTANT); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_express" static struct express *alloc_express(void) { struct express *e; if(!(e=malloc(sizeof(struct express)))) ABT_FUNC(MMsg); return e; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_logical_op" static struct express *do_logical_op(struct express *ex1,struct express *ex2,int op) { int i=0,l=0; double rv1,rv2; char *s1,*s2; s1=s2=0; if(ex1->type&ST_STRING) { s1=ex1->arg.string; i++; } if(ex2 && ex2->type&ST_STRING) { s2=ex2->arg.string; i++; } if(i==2) { switch(op) { case '=': l=mystrcmp(s1,s2)?0:1; break; case NEQSYMBOL: l=mystrcmp(s1,s2)?1:0; break; case '<': l=mystrcmp(s1,s2)<0?1:0; break; case '>': l=mystrcmp(s1,s2)>0?1:0; break; case LEQSYMBOL: l=mystrcmp(s1,s2)>=0?1:0; break; case GEQSYMBOL: l=mystrcmp(s1,s2)>=0?1:0; break; case ORSYMBOL: l=(s1 || s2); break; case ANDSYMBOL: l=(s1 && s2); break; default: ABT_FUNC("Internal error - invalid string op\n"); } } else if(i && !ex2) { if(op!=NOTSYMBOL) ABT_FUNC("Internal error - invalid unary string op\n"); else l=s1?0:1; } else if(i) { switch(op) { case ORSYMBOL: if(ex1->type&ST_STRING) l=(s1 || ex2->arg.value); else l=(s2 || ex1->arg.value); break; case ANDSYMBOL: if(ex1->type&ST_STRING) l=(s1 && ex2->arg.value); else l=(s2 && ex1->arg.value); break; default: ABT_FUNC("Internal error - invalid string op\n"); } } else { rv1=rv2=0.0; if(ex1->type&ST_INTEGER) rv1=(double)ex1->arg.value; else if(ex1->type&ST_REAL) rv1=ex1->arg.rvalue; if(ex2) { if(ex2->type&ST_INTEGER) rv2=(double)ex2->arg.value; else if(ex2->type&ST_REAL) rv2=ex2->arg.rvalue; } switch(op) { case '=': l=(rv1==rv2); break; case NEQSYMBOL: l=(rv1!=rv2); break; case '<': l=(rv1': l=(rv1>rv2); break; case LEQSYMBOL: l=(rv1<=rv2); break; case GEQSYMBOL: l=(rv1>=rv2); break; case ORSYMBOL: l=(rv1 || rv2); break; case ANDSYMBOL: l=(rv1 && rv2); break; case NOTSYMBOL: l=(rv1==0.0); break; default: ABT_FUNC("Internal error - invalid op\n"); } } if(ex2) free(ex2); ex1->type=ST_INTEGER; ex1->arg.value=l; return ex1; } static struct express *do_express_op(struct express *ex1,struct express *ex2,int op) { double rv1,rv2; int i; if(ex1->type&ST_STRING) { if(ex2 && ex2->type&ST_STRING) { if(op!='+') yyerror("Illegal string operation\n"); else { ex1->arg.string=string_copy(ex1->arg.string,ex2->arg.string); free(ex2->arg.string); } } else yyerror("Can't mix numeric and string expressions\n"); } else if(ex2 && ex2->type&ST_STRING) yyerror("Can't mix numeric and string expressions\n"); else { rv1=rv2=0.0; if(ex1->type&ST_INTEGER) rv1=(double)ex1->arg.value; else if(ex1->type&ST_REAL) rv1=ex1->arg.rvalue; if(ex2) { if(ex2->type&ST_INTEGER) rv2=(double)ex2->arg.value; else if(ex2->type&ST_REAL) rv2=ex2->arg.rvalue; } switch(op) { case '+': rv1+=rv2; break; case '-': if(ex2) rv1-=rv2; else rv1= -rv1; break; case '*': rv1*=rv2; break; case '/': if(rv2==0.0) { yyerror("Divide by zero error\n"); rv1=0.0; } else rv1/=rv2; break; } i=(int)rv1; if((double)i==rv1) { ex1->type=ST_INTEGER; ex1->arg.value=i; } else { ex1->type=ST_REAL; ex1->arg.rvalue=rv1; } } if(ex2) free(ex2); return ex1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "check_element_add_op" static void check_element_add_op(struct var_element *element) { switch(element->type&(ST_REAL|ST_INTEGER|ST_STRING)) { case ST_STRING: add_operation(string_copy(0,element->arg.string),STRING,0); break; case ST_INTEGER: add_operation(&element->arg,INTEGER,0); break; case ST_REAL: add_operation(&element->arg,REAL,0); break; case 0: add_operation(element,VARIABLE,0); break; default: ABT_FUNC("Internal error - illegal element type\n"); } } static int check_index(struct scan_data *sd,struct express *express) { int i; if(express->type!=ST_INTEGER) { if(in_loopclause<=0) yyerror("Non-integral expression for array index"); } else if(sd->vtype&ST_ARRAY) { i=(int)express->arg.value; if(i<1 || i>sd->n_elements) { if(in_loopclause<=0) yyerror("Array index out of bounds"); } else return i; } else yyerror("Not an array"); return 0; } static struct var_element *get_element(struct bin_node *node,struct express *express) { int i; struct scan_data *sd; sd=node->data; if(express) { if(!(i=check_index(sd,express))) return 0; return sd->element+i-1; } else { if(sd->vtype&ST_ARRAY) { yyerror("Illegal reference to array"); return 0; } } return sd->element; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_array_var" static void set_array_var(struct scan_data *sd,struct express *express) { int i; if(express->type!=ST_INTEGER) yyerror("Non-integral expression for array size"); else if((i=(int)express->arg.value)<1) yyerror("Illegal array size"); else if(sd->vtype) yyerror("Can't redefine variable"); else { sd->vtype|=ST_ARRAY; sd->n_elements=i; free(sd->element); if(!(sd->element=calloc((size_t)sd->n_elements,sizeof(struct var_element)))) ABT_FUNC(MMsg); } } static int count_var_list(struct var_list *vlist) { int i=0; struct scan_data *sd=0; while(vlist) { sd=vlist->var?vlist->var->data:0; if(sd && (sd->vtype&ST_ARRAY) && !vlist->index) i+=sd->n_elements; else i++; vlist=vlist->next; } return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "assign_var" static struct var_element *assign_var(struct bin_node *node,struct express *ix,struct express *express) { struct var_element *element; struct scan_data *sd; if(!express) return 0; if(!(element=get_element(node,ix))) return 0; switch(express->type) { case ST_STRING: element->arg.string=express->arg.string; RemBlock=AddRemem(element->arg.string,RemBlock); break; case ST_REAL: case ST_INTEGER: element->arg=express->arg; break; case 0: yyerror1("Undefined assignment\n"); element->type=0; element->arg.string=0; break; default: ABT_FUNC(IntErr); } if(!ix) { sd=node->data; sd->vtype|=ST_SCALAR; } element->type=express->type; return element; } void check_vars(struct bin_node *node,int *i,void check_func(struct bin_node *,int *)) { if(node->left) { check_vars(node->left,i,check_func); } check_func(node,i); if(node->right) { check_vars(node->right,i,check_func); } } static void check_vars_1(struct bin_node *node,void check_func(struct bin_node *)) { if(node->left) { check_vars_1(node->left,check_func); } check_func(node); if(node->right) { check_vars_1(node->right,check_func); } } void print_scan_err(char *fmt, ...) { va_list args; va_start(args,fmt); (void)vfprintf(stderr,fmt,args); va_end(args); if((++scan_error_n)>=max_scan_errors) abt(__FILE__,__LINE__,"Too many errors - aborting\n"); } void print_scan_warn(char *fmt, ...) { va_list args; if(scan_warn_nnext=Op_List; Op_List=o; o->type=type; o->op=op; switch(type) { case VARIABLE: o->arg.element= (struct var_element *)arg; break; case INTEGER: o->arg.value= *(int *)arg; break; case REAL: o->arg.rvalue= *(double *)arg; break; case STRING: o->arg.string= (char *)arg; break; } } static void new_command(void) { shell_flag=in_loopclause=0; Op_List=0; iflag=0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_to_model" static struct model_list *add_to_model(struct model_list *model,struct var_list *vlist) { struct var_list *vlist1; struct scan_data *sd; struct model_list *m1; int i; if(!(m1=malloc(sizeof(struct model_list)))) ABT_FUNC(MMsg); if(vlist) { i=count_var_list(vlist); if(!(m1->element=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { sd->element[vlist->index-1].type|=ST_MODEL; sd->element[vlist->index-1].index=vlist->index; sd->element[vlist->index-1].oindex=vlist->index; m1->element[i++]=sd->element+vlist->index-1; } else yyerror("Error - Can't use whole arrays as model parameters"); } else { sd->element[0].type|=ST_MODEL; sd->element[0].index=0; m1->element[i++]=sd->element; } vlist1=vlist->next; free(vlist); vlist=vlist1; } m1->nvar=i; } else ABT_FUNC("Nothing to add...\n"); m1->next=model; return m1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "string_copy" static char *string_copy(char *s1,char *s2) { if(s1) { if(!(s1=realloc(s1,strlen(s1)+strlen(s2)+1))) ABT_FUNC(MMsg); (void)strcat(s1,s2); } else { if(!(s1=malloc(strlen(s2)+1))) ABT_FUNC(MMsg); (void)strcpy(s1,s2); } return s1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "setup_format" static struct format *setup_format(struct format_clause *fc) { int i,n=0,pp=0; struct format_atom **fa; struct format *format; fa=fc->f_atoms; for(i=0;in_atoms;i++) if(!fa[i]->pos) n++; if(!n) { if(!(scan_error&FORMAT_ERR)) yyerror("Error - Empty format clause"); free(fa); free(fc); scan_error|=FORMAT_ERR; scan_error_n++; return 0; } if(!(format=malloc(sizeof(struct format)))) ABT_FUNC(MMsg); format->line=lineno; if(!(format->f_atoms=malloc(sizeof(struct format_atom)*n))) ABT_FUNC(MMsg); for(i=n=0;in_atoms;i++) { if(!fa[i]->pos) { format->f_atoms[n].size=fa[i]->size; format->f_atoms[n++].pos=pp; } pp+=fa[i]->size; } free(fa); format->n_atoms=n; f_atom_n=0; free(fc); return format; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "make_f_atom" static struct format_atom *make_f_atom(int n,int flag) { if(f_atom_n>=f_atom_size) { f_atom_size*=2; if(!(f_atom_list=realloc(f_atom_list,sizeof(struct format_atom)*f_atom_size))) ABT_FUNC(MMsg); } f_atom_list[f_atom_n].size=n; f_atom_list[f_atom_n].pos=flag; return &f_atom_list[f_atom_n++]; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_fformat" static struct fformat *add_fformat(struct fformat *f1,struct fformat *f2) { if(f2->rs) { if(f1->rs) free(f1->rs); f1->rs=f2->rs; } if(f2->fs) { if(f1->fs) free(f1->fs); f1->fs=f2->fs; } if(f2->gs) { if(f1->gs) free(f1->gs); f1->gs=f2->gs; } if(f2->skip) f1->skip=f2->skip; free(f2); return f1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "create_fformat" static struct fformat *create_fformat(void *p,int fg) { struct fformat *ff; int *i; if(!(ff=malloc(sizeof(struct fformat)))) ABT_FUNC(MMsg); ff->rs=ff->fs=ff->gs=0; ff->skip=0; switch(fg) { case 1: ff->rs=p; break; case 2: ff->fs=p; break; case 3: i=p; ff->skip=*i; break; case 4: ff->gs=p; break; default: ABT_FUNC("Internal error - incorrect flag\n"); } return ff; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_f_atom" static struct format_clause *add_f_atom(struct format_clause *fc,struct format_atom *fa) { if(!fc) { if(!(fc=malloc(sizeof(struct format_clause)))) ABT_FUNC(MMsg); fc->fc_size=16; fc->n_atoms=0; if(!(fc->f_atoms=malloc(sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } if(fc->n_atoms>=fc->fc_size) { fc->fc_size*=2; if(!(fc->f_atoms=realloc(fc->f_atoms,sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } fc->f_atoms[fc->n_atoms++]=fa; return fc; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_f_list" static struct format_clause *add_f_list(struct format_clause *fc,struct format_clause *fc1,int n) { int sz,i,j; sz=fc1->n_atoms*n; if(!fc) { if(!(fc=malloc(sizeof(struct format_clause)))) ABT_FUNC(MMsg); fc->fc_size=16; if(sz>16) fc->fc_size=sz; fc->n_atoms=0; if(!(fc->f_atoms=malloc(sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } else { if(sz>(fc->fc_size-fc->n_atoms)) { fc->fc_size=sz+fc->n_atoms; if(!(fc->f_atoms=realloc(fc->f_atoms,sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } } for(i=0;in_atoms;j++) fc->f_atoms[fc->n_atoms++]=fc1->f_atoms[j]; free(fc1->f_atoms); free(fc1); return fc; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_var" static struct bin_node *alloc_var(char *p) { struct bin_node *node; struct scan_data *sd; int i; if(!(node=malloc(sizeof(struct bin_node)))) ABT_FUNC(MMsg); node->left=node->right=0; node->balance=0; if(!(sd=malloc(sizeof(struct scan_data)))) ABT_FUNC(MMsg); node->data=sd; sd->vtype=0; i=(int)strlen(p); if(!(sd->name=malloc((size_t)i+1))) ABT_FUNC(MMsg); sd->name[i--]=0; for(;i>=0;i--) sd->name[i]=toupper((int)p[i]); sd->n_elements=1; if(!(sd->element=calloc(1,sizeof(struct var_element)))) ABT_FUNC(MMsg); sd->element->arg.element=0; return node; } static struct bin_node *find_var(char *p,struct bin_node *node,struct bin_node **node1,int *balanced) { int i; struct scan_data *sd; sd=node->data; if((i=strcasecmp(p,sd->name))) { if(i<0) { if(node->left) { node->left=find_var(p,node->left,node1,balanced); } else { *node1=node->left=alloc_var(p); *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node=rotate_left(node); *balanced=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *balanced=1; } } } else { if(node->right) { node->right=find_var(p,node->right,node1,balanced); } else { *node1=node->right=alloc_var(p); *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node->balance=0; *balanced=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *balanced=1; } } } } else { *node1=node; *balanced=1; } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Check_var" static void Check_var(struct bin_node *node) { int i; struct var_element *element; struct scan_data *sd; char *nbuf; if(node->left) Check_var(node->left); sd=node->data; i=strlen(sd->name)+4+log((double)(sd->n_elements+1))/log(10.0); if(!(nbuf=malloc((size_t)i))) ABT_FUNC(MMsg); for(i=0;in_elements;i++) { if(sd->vtype&ST_ARRAY) (void)sprintf(nbuf,"%s(%d)",sd->name,i+1); else (void)strcpy(nbuf,sd->name); element=sd->element+i; if(!(element->type&(ST_DATA|ST_TRAITLOCUS|ST_LINKED))) { if(element->type&(ST_MODEL|ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_TRAIT|ST_GROUP)) print_scan_err("Error: No data for variable %s\n",nbuf); } if((element->type&ST_DATA) && (element->type&ST_TRAITLOCUS)) print_scan_err("Error: Variable %s can not have data\n",nbuf); else if((element->type&ST_LINKED) && !(element->type&(ST_TRAITLOCUS|ST_MARKER))) print_scan_err("Error: Variable %s is not a locus and so can not be linked\n",nbuf); else if((element->type&ST_TRAIT) && (element->type&(ST_GROUP|ST_MARKER|ST_TRAITLOCUS|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_LINKED|ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for trait\n",nbuf); else if((element->type&ST_TRAITLOCUS) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_RANDOM|ST_MARKER|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_STRING|ST_REAL|ST_INTEGER|ST_REALTYPE|ST_INTTYPE))) print_scan_err("Error: Variable %s inappropriate type for trait locus\n",nbuf); else if((element->type&ST_MARKER) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_REAL|ST_INTEGER|ST_RANDOM|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_STRING|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for marker\n",nbuf); else if((element->type&ST_HAPLO) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_REAL|ST_RANDOM|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for haplotype\n",nbuf); else if((element->type&ST_RANDOM) && (element->type&(ST_SEX|ST_GROUP|ST_STRING|ST_REAL|ST_INTEGER|ST_REAL))) print_scan_err("Error: Variable %s inappropriate type to be random\n",nbuf); else if((element->type&(ST_INTTYPE|ST_REALTYPE)) && (element->type&(ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Type collision for variable %s\n",nbuf); else if((element->type&ST_INTTYPE) && (element->type&ST_REALTYPE)) print_scan_err("Error: Real variable %s can not also be integer type\n",nbuf); else if((element->type&(ST_STRING|ST_REAL)) && (element->type&(ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM))) print_scan_err("Error: Variable %s can not be a pedigree or sex variable\n",nbuf); else if((element->type&ST_REAL) && (element->type&(ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_SEX))) print_scan_err("Error: Real variable %s can not be a pedigree or sex variable\n",nbuf); else if((element->type&ST_FACTOR) && (element->type&ST_REAL)) print_scan_err("Error: Real variable %s can not be a factor\n",nbuf); else if((element->type&ST_CONSTANT)&&(element->type&ST_MULTIPLE)) print_scan_err("Error: Variable %s can not be in multiple records and be constant\n",nbuf); else if(element->type&(ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_TRAITLOCUS|ST_GROUP|ST_LINKED|ST_MODEL|ST_TRAIT)) element->type|=ST_REQUIRED; else if(element->type&ST_HAPLO) { if(element->arg.element && element->arg.element->type&ST_LINKED) { element->type|=ST_REQUIRED; if(!(element->type&ST_DATA)) print_scan_err("Error: No data for variable %s\n",nbuf); } } if(element->type&ST_MARKER) n_markers++; if(!(element->type&(ST_CONSTANT|ST_MULTIPLE))) element->type|=syst_var[MULTIPLE_RECORDS]?ST_MULTIPLE:ST_CONSTANT; if(element->type&(ST_MARKER|ST_REQUIRED|ST_RESTRICT)) { if(!(element->type&ST_HAPLO)) element->arg.var=node; } else element->type=0; } free(nbuf); if(node->right) Check_var(node->right); } static struct bin_node *create_var(char *p) { int k; struct bin_node *node; if(!root_var) node=root_var=alloc_var(p); else { root_var=find_var(p,root_var,&node,&k); } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "symbol_lookup" int symbol_lookup(char *p,int fg) { static char *Coms[] = {"FILE","LOCUS","LOCI","MARKER","DISCRETE","MODEL","PEDIGREE","LOG", "FILTER","MISSING","MODEL","LINK","RANDOM","TRAIT","WHERE","USE", "REAL","INTEGER","SHELL","ARRAY","PRINT","DO","WHILE","CONSTANT", "MULTIPLE","CENSORED","GROUP","SET","SEX","AFFECTED","UNAFFECTED","OUTPUT","INCLUDE","ERRORDIR", "LAUROUTPUT","RAWOUTPUT","POSITION","FREQUENCY",(char *)0}; static int Com_token[] = {FILEC,LOCUS,LOCUS,MARKER,FACTOR,MODEL,PEDIGREE,LOG, FILTER,MISSING,MODEL,LINK,RANDOM,TRAIT,WHERE,USE, REAL,INTEGER,SHELL,ARRAY,PRINTEXP,DOLOOP,WHILE,CONSTANT, MULTIPLE,CENSORED,GROUP,SET,GENDER,AFFECTED,UNAFFECTED,OUTPUT,INCLUDE,ERRORDIR, LAUROUTPUT,RAWOUTPUT,POSITION,FREQUENCY,SYSTEM_VAR,VARIABLE,ARRAY_VAR}; static char *Syst[] = {"PRUNE_OPTION","RECODE_OPTION","NO_EXTRA_ALLELE", "PEEL_OPTION","TRACE_RESTRICT","TRACE_CENSORED","TRACE_AFFECTED", "CORRECT_ERRORS","TRACE_PEEL","MULTIPLE_RECORDS","MULTIVARIATE_TEST", "ERROR_CHECK","NO_DEFAULT_MISSING","SKIP_BAD_REALS","SKIP_BAD_INTS","IGNORE_CASE",(char *)0}; int i=0,j=0; static struct scan_data *sd; while(Coms[i]) { if(!strcasecmp(Coms[i],p)) break; i++; } at_file=0; if(Com_token[i]==FILEC || Com_token[i]==LINK) at_file=1; if(Com_token[i]==SYSTEM_VAR) { i++; while(Syst[j]) { if(!strcasecmp(Syst[j],p)) { yylval.value=j; i--; break; } j++; } } if(Com_token[i]==VARIABLE) { if(fg==1 && begin_comm) { begin_comm=0; return BREAK; } yylval.var=create_var(p); sd=yylval.var->data; if(sd->vtype&ST_ARRAY) i++; if(fg==1) { begin_comm=1; (void)strcpy(linebuf1,linebuf); lineno1=lineno; } } else if(begin_comm && Com_token[i]!=SYSTEM_VAR && Com_token[i]!=LOCUS && Com_token[i]!=SHELL && !(at_use==1 && Com_token[i]==WHERE) && !(at_use==2 && Com_token[i]==USE)) { begin_comm=0; at_use=0; return BREAK; } else { begin_comm=1; (void)strcpy(linebuf1,linebuf); lineno1=lineno; if(Com_token[i]==MODEL) at_model=1; else at_model=0; if(Com_token[i]==USE || Com_token[i]==CENSORED || Com_token[i]==AFFECTED || Com_token[i]==UNAFFECTED) at_use|=1; else if(Com_token[i]==WHERE) at_use|=2; else at_use=0; } return Com_token[i]; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "symbol_lookup" static struct var_list *add_to_var_list(struct var_list *vlist,struct bin_node *node,struct express *express) { struct var_list *vlist1,*vlist2; struct scan_data *sd=0; int i; if(node) sd=node->data; if(express) i=check_index(sd,express); else { i=0; if(sd && !(sd->vtype&ST_ARRAY)) sd->vtype|=ST_SCALAR; } if(!(vlist1=malloc(sizeof(struct var_list)))) ABT_FUNC(MMsg); vlist1->next=0; vlist1->var=node; vlist1->index=i; vlist2=vlist; if(vlist2) { while(vlist2->next) vlist2=vlist2->next; vlist2->next=vlist1; } else vlist=vlist1; return vlist; } struct var_list *add_var_lists(struct var_list *vlist,struct var_list *vlist1) { struct var_list *vlist2; vlist2=vlist; if(vlist2) { while(vlist2->next) vlist2=vlist2->next; vlist2->next=vlist1; } else vlist=vlist1; return vlist; } static void set_locus_array(struct bin_node *node) { struct scan_data *sd; int i; sd=node->data; if(sd->vtype&ST_ARRAY) { for(i=0;in_elements;i++) { set_locus_element(sd->element+i); } } else yyerror("Not an array"); } static void set_locus_element(struct var_element *element) { element->type|=(ST_MARKER|ST_FACTOR|ST_CONSTANT); if(hap_list[0]) { if(hap_list[0]->arg.element && hap_list[0]->arg.element!=element) { yyerror1("Haplotype vector (left) used twice"); hap_list[0]->arg.element=0; } else hap_list[0]->arg.element=element; } if(hap_list[1]) { if(hap_list[1]->arg.element && hap_list[1]->arg.element!=element) { yyerror1("Haplotype vector (right) used twice"); hap_list[1]->arg.element=0; } else hap_list[1]->arg.element=element; } hap_list[0]=hap_list[1]=0; } static void set_haplo_element(struct var_element *element,struct var_element *element1) { element->type|=(ST_HAPLO|ST_FACTOR|ST_CONSTANT); if(element1) element1->type|=(ST_HAPLO|ST_FACTOR|ST_CONSTANT); hap_list[0]=element; hap_list[1]=element1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_file_com" static void do_file_com(char *fname,struct format_clause *fc,struct fformat *ff,struct var_list *vlist) { int i,j; struct InFile *file; struct format *format; struct var_list *vlist1; struct var_element *element; struct scan_data *sd; if(!vlist) { yyerror1("No variables listed for FILE command\n"); return; } else if(!fname) { free_vlist(vlist); return; } else if(!fname[0]) { yyerror1("Zero length filename for FILE command\n"); free_vlist(vlist); return; } file=Infiles; if(!(Infiles=calloc(1,sizeof(struct InFile)))) ABT_FUNC(MMsg); Infiles->next=file; Infiles->nvar=count_var_list(vlist); if(!(Infiles->element=malloc(sizeof(void *)*Infiles->nvar))) ABT_FUNC(MMsg); i=0; while(vlist) { if(vlist->var) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { element=sd->element+vlist->index-1; element->type|=ST_DATA; Infiles->element[i++]=element; } else { for(j=0;jn_elements;j++) { element=sd->element+j; element->type|=ST_DATA; Infiles->element[i++]=element; } } } else { element=sd->element; element->type|=ST_DATA; Infiles->element[i++]=element; } } else Infiles->element[i++]=0; vlist1=vlist->next; free(vlist); vlist=vlist1; } if(fc) { format=setup_format(fc); Infiles->format=format; if(!(scan_error&FORMAT_ERR)) { if(format->n_atomsn_atoms = %d\n",format->n_atoms); (void)printf("i = %d\n",i); print_scan_err("Line %d: Error - Too many variables for format clause\n",format->line); scan_error|=FORMAT_ERR; } else if(format->n_atoms>i) print_scan_warn("Line %d: Warning - Too few variables for format clause\n",format->line); } } else if(ff) Infiles->fformat=ff; Infiles->name=fname; Infiles->shell_flag=shell_flag; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "change_type" static void change_type(int type,struct var_list *vlist) { int j; struct scan_data *sd; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) sd->element[vlist->index-1].type|=type; else for(j=0;jn_elements;j++) sd->element[j].type|=type; } else sd->element[0].type|=type; vlist=vlist->next; } } static void free_vlist(struct var_list *vlist) { struct var_list *vlist1; while(vlist) { vlist1=vlist->next; free(vlist); vlist=vlist1; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_link_com" static void do_link_com(char *s,int type,struct var_list *vlist) { struct Link *l,*l1,**ll; struct var_list *vlist1; struct var_element *element; struct scan_data *sd=0; int i,j,k; if(vlist) sd=vlist->var->data; if(!s && sd) { if(sd->vtype&ST_ARRAY && vlist->index) { element=sd->element+vlist->index-1; if(element->type&ST_STRING) { s=element->arg.string; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else { element=sd->element; if(element->type&ST_STRING) { s=element->arg.string; vlist1=vlist->next; free(vlist); vlist=vlist1; } } } ll=&links; while(*ll) { l=*ll; if(s) { if(l->name) { if(!strcasecmp(s,l->name)) break; } } else if(!l->name) break; ll=&l->next; } if(*ll) l1=*ll; else { if(!(l1=malloc(sizeof(struct Link)))) ABT_FUNC(MMsg); l1->next=0; l1->name=s; l1->n_loci=0; l1->element=0; l1->type=-1; *ll=l1; } i=count_var_list(vlist); if(l1->type>=0 && l1->type!=type) print_scan_err("Error: Linkage group has inconsistent linkage type\n"); l1->type=type; if(i) { k=i+l1->n_loci; if(l1->element) { if(!(l1->element=realloc(l1->element,sizeof(void *)*k))) ABT_FUNC(MMsg); } else if(!(l1->element=malloc(sizeof(void *)*k))) ABT_FUNC(MMsg); while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { element=sd->element+vlist->index-1; for(i=0;in_loci;i++) { if(l1->element[i]==element) break; } if(i==l1->n_loci) { if(element->type&ST_LINKED) { print_scan_err("Error: %s(%d) appears in multiple linkage groups\n",sd->name,vlist->index); scan_error|=LINK_ERR; } else { element->type|=ST_LINKED; l1->element[l1->n_loci++]=element; } } } else { for(j=0;jn_elements;j++) { element=sd->element+j; for(i=0;in_loci;i++) { if(l1->element[i]==element) break; } if(i==l1->n_loci) { if(element->type&ST_LINKED) { print_scan_err("Error: %s(%d) appears in multiple linkage groups\n",sd->name,vlist->index); scan_error|=LINK_ERR; } else { element->type|=ST_LINKED; l1->element[l1->n_loci++]=element; } } sd->vtype|=ST_LINKED; } } } else { element=sd->element; for(i=0;in_loci;i++) { if(l1->element[i]==element) break; } if(i==l1->n_loci) { if(element->type&ST_LINKED) { print_scan_err("Error: %s appears in multiple linkage groups\n",sd->name); scan_error|=LINK_ERR; } else { element->type|=ST_LINKED; l1->element[l1->n_loci++]=element; } } } vlist1=vlist->next; free(vlist); vlist=vlist1; } if(l1->n_locielement=realloc(l1->element,sizeof(void *)*l1->n_loci))) ABT_FUNC(MMsg); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_missing_com" static void do_missing_com(struct express *expr,struct var_list *vlist,char *s1) { struct var_list *vlist1; struct scan_data *sd; struct var_element **elem; struct Miss *m; int i,j; char *p; if(s1) { if(vlist) ABT_FUNC("Can't have both explicit and implicit scope\n"); if(s1[0]==0) { print_scan_err("Empty scope - MISSING directive ignored\n"); if(expr->type==ST_STRING) free(expr->arg.string); free(s1); return; } qstrip(s1); p=s1; i=j=0; while(*p) { switch(toupper((int)*p)) { case '!': case 'F': case 'G': case 'P': case 'C': case 'R': case 'I': break; default: i=1; } if(i) break; p++; } if(*p) { j=1; print_scan_err("Illegal character '%c' in MISSING scope\n",*p); } else if(*(--p)=='!') { j=1; print_scan_err("MISSING scope can not end with a '!'\n",*p); } if(j) { free(s1); if(expr->type==ST_STRING) free(expr->arg.string); return; } } m=Miss; if(!(Miss=malloc(sizeof(struct Miss)))) ABT_FUNC(MMsg); Miss->Missing.arg=expr->arg; Miss->Missing.type=expr->type; Miss->next=m; Miss->element=0; Miss->scope=0; if((i=count_var_list(vlist))) { if(!(elem=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) elem[i++]=sd->element+vlist->index-1; else for(j=0;jn_elements;j++) elem[i++]=sd->element+j; } else elem[i++]=sd->element; Miss->element=elem; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else if(s1) Miss->scope=s1; Miss->nvar=i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_model_com" static void do_model_com(struct model_list *mlist,struct bin_node *node,struct express *express) { struct model *model,*model1; struct var_element *element; struct scan_data *sd; sd=node->data; if(!(model=malloc(sizeof(struct model)))) ABT_FUNC(MMsg); model->next=0; if(Models) { model1=Models; while(model1->next) model1=model1->next; model1->next=model; } else Models=model; model->trait=sd; if(!express) { model->index=0; sd->element[0].type|=ST_TRAIT; } else { element=get_element(node,express); if(element) { model->index=(int)express->arg.value; element->index=element->oindex=model->index; element->type|=ST_TRAIT; } else model->trait=0; } model->model_list=mlist; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_censored" static void add_censored(struct var_element *element,const int fg) { struct operation *ops,*ops1,*ops2; struct Censor *cen; if(fg==1 && !element) { print_scan_err("Error: Nothing to censor!\n"); return; } ops=Op_List; /* Reverse list order (really return list to original order! */ if(ops) { ops1=ops->next; while(ops1) { ops2=ops1->next; ops1->next=ops; ops=ops1; ops1=ops2; } Op_List->next=0; Op_List=ops; } switch(fg) { case 1: if(!(cen=malloc(sizeof(struct Censor)))) ABT_FUNC(MMsg); cen->next=Censored; Censored=cen; cen->Op_List=ops; cen->element=element; element->type|=ST_CENSORED; break; case 0: if(Affected) print_scan_warn("Warning - new affected statement overrules previous statement\n"); Affected=ops; break; case 2: if(Unaffected) print_scan_warn("Warning - new unaffected statement overrules previous statement\n"); Unaffected=ops; break; } ops=Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_RESTRICT; ops=ops->next; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_restriction" static void add_restriction(struct var_list *vlist) { struct operation *ops,*ops1,*ops2; struct Restrict *res; struct var_list *vlist1; struct scan_data *sd; int i,j; ops=Op_List; /* Reverse list order (really return list to original order! */ if(ops) { ops1=ops->next; while(ops1) { ops2=ops1->next; ops1->next=ops; ops=ops1; ops1=ops2; } Op_List->next=0; Op_List=ops; } if(!(res=malloc(sizeof(struct Restrict)))) ABT_FUNC(MMsg); res->next=Restrictions; Restrictions=res; res->Op_List=ops; if((res->nvar=count_var_list(vlist))) { if(!(res->element=malloc(sizeof(void *)*res->nvar))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) res->element[i++]=sd->element+vlist->index-1; else for(j=0;jn_elements;j++) res->element[i++]=sd->element+j; } else res->element[i++]=sd->element; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else res->element=0; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_RESTRICT; ops=ops->next; } } static void find_markers(struct bin_node *node,int *i) { int j; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) if(sd->element[j].type&ST_MARKER) { if(sd->element[j].type&ST_REQUIRED) { markers[*i].element=sd->element+j; markers[*i].var=sd; markers[(*i)++].index=j+1; } } } static void find_trait_loci(struct bin_node *node,int *i) { int j; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) if(sd->element[j].type&ST_TRAITLOCUS) { if(traitlocus) { traitlocus[*i].element=sd->element+j; traitlocus[*i].var=sd; traitlocus[(*i)].index=j+1; } (*i)++; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_haplo" static void find_haplo(struct bin_node *node) { int j,k; struct scan_data *sd; sd=node->data; for(k=0;kn_elements;k++) if(sd->element[k].type&ST_HAPLO) { for(j=0;jelement[k].arg.element==markers[j].element) { if(!markers[j].hap_element[0]) markers[j].hap_element[0]=sd->element+k; else if(!markers[j].hap_element[1]) markers[j].hap_element[1]=sd->element+k; else { if(markers[j].index) print_scan_err("Error: marker %s(%d) has >2 haplotype vectors associated with it\n",markers[j].var->name,markers[j].index); else print_scan_err("Error: marker %s has >2 haplotype vectors associated with it\n",markers[j].var->name); } break; } if(j==n_markers) ABT_FUNC("Internal error: can not find marker for haplotype vector\n"); } } static void strip_names(struct bin_node *node) { char *p; int i; struct scan_data *sd; sd=node->data; if((p=sd->name)) { i=strlen(p); if(i>2) { if(p[i-1]=='_' && p[0]=='_') { p[i-1]=0; memmove(p,p+1,i-1); } } } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "ReadControl" int ReadControl(FILE *fptr,char *cname,char **lfile) { int i,j,k; void yy_cleanup(void); struct InFile *infile,**infile_p; struct Restrict *res,*res1,**res_p; struct Censor *cen,**cen_p; struct var_element *elem; struct Link *linkp; struct operation *ops; struct express tmp_expr; yyin=fptr; fname_list[0]=cname; list_ptr=0; if(!(f_atom_list=malloc(sizeof(struct format_atom)*f_atom_size))) ABT_FUNC(MMsg); for(i=0;itype&ST_INTTYPE) break; if(i<3) for(i=0;i<3;i++) pedlist[i+family_id]->type|=ST_INTTYPE; } if(root_var) Check_var(root_var); /* Flag variables used as the operands to a restriction statement *whose result is used* as ST_REQUIRED */ res=0; while(res!=Restrictions) { res1=Restrictions; while(res1->next!=res) res1=res1->next; for(i=j=0;invar;i++) if(res1->element[i]->type&ST_REQUIRED) { j=1; break; } if(!res1->nvar || j) { ops=res1->Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } res=res1; } /* Delete restrict structures that are not used */ res=Restrictions; res_p= &Restrictions; while(res) { for(i=j=0;invar;i++) if(res->element[i]->type&ST_REQUIRED) { j=1; break; } if(res->nvar && !j) { *res_p=res->next; free_restrict(res); res= *res_p; } else { res_p= &res->next; res=res->next; } } if(Unaffected && !Affected) print_scan_err("Error: Unaffected definition without affected definition\n"); /* Flag variables used in censored statements as required. Delete unused censored statements */ cen=Censored; cen_p= &Censored; while(cen) { if(cen->element->type&ST_TRAIT) { ops=cen->Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } cen_p= &cen->next; cen=cen->next; } else { *cen_p=cen->next; free_op(cen->Op_List); free(cen); cen= *cen_p; } } if((ops=Affected)) { while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } if((ops=Unaffected)) { while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } /* Check file structures - remove ones that aren't needed */ infile=Infiles; infile_p= &Infiles; while(infile) { infile->ncol=0; for(i=0;invar;i++) { elem=infile->element[i]; if(elem) elem->type&=~ST_FLAG; } for(k=infile->nvar-1;k>=0;k--) { elem=infile->element[k]; if(elem && (elem->type&ST_REQUIRED)) break; } for(i=j=0;invar;i++) { elem=infile->element[i]; if(elem) { if((elem->type&ST_MARKER) && !(elem->type&ST_REQUIRED)) { if(jtype|=(ST_REQUIRED|ST_NOT_REALLY_REQUIRED); else elem->type=0; } if(elem->type&ST_REQUIRED) { if(elem->type&ST_FLAG) { print_scan_err("Error: Duplicate variables for file %s\n",infile->name); break; } elem->type|=ST_FLAG; if(elem->type&ST_ID) { j|=1; infile->id_col=infile->ncol; } else if(elem->type&ST_FAMILY) { j|=2; infile->family_col=infile->ncol; } infile->ncol++; } else infile->element[i]=0; } } for(i=0;invar;i++) if(infile->element[i]) infile->element[i]->type&=~ST_FLAG; if(!(j&1)) print_scan_err("Error: No id column for file %s\n",infile->name); else if(family_id && j!=3) print_scan_err("Error: No family column for file %s\n",infile->name); if(infile->ncol==1) { *infile_p=infile->next; free_infile(infile); infile= *infile_p; } else { infile_p= &infile->next; infile=infile->next; } } if(!Infiles) print_scan_err("Error: No input files with data\n"); free(f_atom_list); /* Count markers and link up with haplotype vectors */ if(n_markers) { if(!(markers=calloc((size_t)n_markers,sizeof(struct Marker)))) ABT_FUNC(MMsg); for(i=0;itype&ST_NOT_REALLY_REQUIRED) continue; linkp=links; j=0; while(linkp) { j++; for(k=0;kn_loci;k++) { if(linkp->element[k]==markers[i].element) { markers[i].link=j; break; } } if(kn_loci) break; linkp=linkp->next; } if(!linkp) { if(markers[i].var->vtype&ST_ARRAY) abt(__FILE__,__LINE__,"%s(): No linkage group specified for candidate gene %s(%d)\n",FUNC_NAME,markers[i].var->name,markers[i].index); else abt(__FILE__,__LINE__,"%s(): No linkage group specified for candidate gene %s\n",FUNC_NAME,markers[i].var->name); } if(markers[i].hap_element[0]) { if(markers[i].element->type&ST_DATA) { if(markers[i].var->vtype&ST_ARRAY) print_scan_err("Error: marker variable %s(%d) can not have both genotype and haplotype data\n",markers[i].var->name,markers[i].index); else print_scan_err("Error: marker variable %s can not have both genotype and haplotype data\n",markers[i].var->name); } if(markers[i].hap_element[0]->type&ST_INTTYPE) markers[i].hap_element[1]->type|=ST_INTTYPE; if(markers[i].hap_element[1] && markers[i].hap_element[1]->type&ST_INTTYPE) markers[i].hap_element[0]->type|=ST_INTTYPE; } else { if(!(markers[i].element->type&ST_DATA)) { if(markers[i].var->vtype&ST_ARRAY) print_scan_err("Error: marker variable %s(%d) has no data\n",markers[i].var->name,markers[i].index); else print_scan_err("Error: marker variable %s has no data\n",markers[i].var->name); } } } } i=0; if(root_var) check_vars(root_var,&i,find_trait_loci); if(i) { if(i>1) print_scan_err("Error: multiple trait loci indicated\n"); else { if(!(traitlocus=calloc(1,sizeof(struct Marker)))) ABT_FUNC(MMsg); traitlocus->order=0; traitlocus->o_size=0; i=0; check_vars(root_var,&i,find_trait_loci); } } if(Models && Models->next && !syst_var[MULTIVARIATE_TEST]) { print_scan_err("Error: Multiple models not currently supported\n"); } } *lfile=LogFile; if(!scan_error_n && !Miss && !syst_var[NO_DEFAULT_MISSING]) { tmp_expr.arg.string=strdup("0"); tmp_expr.type=ST_STRING; do_missing_com(&tmp_expr,0,strdup("PF")); } return scan_error_n; } loki/prepsrc/control_parse1.y0100644000076500007650000017547507747734245015644 0ustar heathheath%{ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * control_parse.y: * * * * yacc source for control file parser. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include "utils.h" #ifndef YYDEBUG #define YYDEBUG 0 #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 0 #endif #ifndef __GNUC__ #define __GNUC__ 0 #endif %} %union { char *string; struct bin_node *var; int value; double rvalue; struct format_clause *format_clause; struct fformat *fformat; struct format_atom *f_atom; struct model_list *model_list; struct var_list *var_list; struct var_element *element; struct express *express; } %token FILEC MARKER LOCUS TRAIT RANDOM PEDIGREE LOG %token MODEL FILTER LINK MISSING FACTOR BREAK DOLOOP WHILE %token USE WHERE ORSYMBOL ANDSYMBOL NEQSYMBOL LEQSYMBOL GEQSYMBOL %token NOTSYMBOL LOGICAL SHELL ARRAY PRINTEXP INCLUDE RAWOUTPUT %token LOOP_CLAUSE_START LOOP_CLAUSE_END CONSTANT MULTIPLE RSFORMAT FSFORMAT %token SKIPFORMAT GSFORMAT CENSORED GROUP SET GENDER AFFECTED OUTPUT %token ERRORDIR LAUROUTPUT UNAFFECTED %token STRING %token VARIABLE ASSIGN ARRAY_VAR %token INTEGER SYSTEM_VAR %token REAL %type complex_string complex_string1 filename_string %type formatlist %type fformatlist fformat %type format %type modellist %type fsingle_vlist filevarlist varlist interactionlist single_vlist simple_varlist loop_clause %type single_element assignment %type expression condition %type linkcom1 %type variable %left ORSYMBOL %left ANDSYMBOL %left '=' NEQSYMBOL %left '<' '>' LEQSYMBOL GEQSYMBOL %left '+' '-' %left '*' '.' '/' %left NOTSYMBOL UMINUS %{ #include "scan.h" #include "scanner.h" static struct format_atom *make_f_atom(int,int); static struct format_clause *add_f_atom(struct format_clause *,struct format_atom *); static struct format_clause *add_f_list(struct format_clause *,struct format_clause *,int); static struct format *setup_format(struct format_clause *); static struct bin_node *create_var(char *); static struct model_list *add_to_model(struct model_list *,struct var_list *); static struct var_list *add_to_var_list(struct var_list *,struct bin_node *,struct express *); static struct var_list *add_var_lists(struct var_list *,struct var_list *); static struct var_element *get_element(struct bin_node *,struct express *); static struct var_element *assign_var(struct bin_node *,struct express *,struct express *); static struct express *alloc_express(void); static struct express *do_express_op(struct express *,struct express *,int); static struct express *do_logical_op(struct express *,struct express *,int); static struct fformat *add_fformat(struct fformat *,struct fformat *); static struct fformat *create_fformat(void *,int); static void begin_looping(struct var_element *, struct express *, struct express *); static void free_vlist(struct var_list *); static void do_ped_com(struct var_list *); static void add_restriction(struct var_list *); static void add_censored(struct var_element *,const int); static void do_file_com(char *,struct format_clause *,struct fformat *,struct var_list *); static void set_locus_array(struct bin_node *); static void set_locus_element(struct var_element *); static void set_haplo_element(struct var_element *,struct var_element *); static void do_link_com(char *s,int type, struct var_list *); static void do_missing_com(struct express *,struct var_list *,char *); static void change_type(int,struct var_list *); static void do_model_com(struct model_list *,struct bin_node *,struct express *); static void add_operation(void *,int,int); static void set_array_var(struct scan_data *,struct express *); static void check_element_add_op(struct var_element *); static void enter_loop(void); static void start_loopclause(void); static void do_while_com(struct express *); static void print_exp(struct express *); static void new_command(void); static void set_sex(struct var_element *,struct express *,struct express *); static void set_group(struct var_element *); static int count_var_list(struct var_list *),shell_flag; static struct format_atom *f_atom_list; static struct var_element *pedlist[4]; static int f_atom_n,f_atom_size=32,pedflag; struct operation *Affected,*Unaffected; struct bin_node *root_var; struct InFile *Infiles; struct Link *links; struct Miss *Miss; struct Restrict *Restrictions; struct Censor *Censored; struct model *Models; static struct operation *Op_List; struct Marker *markers,*traitlocus; static struct var_element *hap_list[2]; struct express *sex_exp[2]; struct sex_def *sex_def; struct var_element *group_elem; static char *string_copy(char *s1,char *s2); static char *LogFile; int scan_error,scan_error_n,scan_warn_n; int max_scan_errors=30,max_scan_warnings=30,n_markers,iflag,file_skip; char *Filter,*ErrorDir,*rsformat,*fsformat,*gsformat,*OutputFile,*OutputRawFile,*OutputLaurFile; int loop_level,loop_ptr[MAX_LOOP],loop_stat[MAX_LOOP],loop_record,loop_stack_size=256; int loop_main_ptr,in_loopclause,loop_clause_end,loop_clause_step,loop_clause_ptr; int syst_var[NUM_SYSTEM_VAR]; int family_id; struct var_element *loop_clause_element; struct token_store *loop_stack; %} %% comfile: command { new_command(); } | error { new_command(); } | comfile BREAK | comfile BREAK command { new_command(); } | comfile BREAK error { new_command(); } ; command: filecommand | filtercommand | includecommand | logcommand | pedcommand | locicommand | changetypecommand | linkcommand | modelcommand | missingcommand | usecommand | wherecommand | assigncommand | arraycommand | printcommand | docommand | whilecommand | censorcommand | affectedcommand | groupcommand | setcommand | defformatcommand | sexcommand | outputcommand | errordircommand ; assigncommand: assignment {} ; assignment: ASSIGN '=' expression { $$=assign_var($1,0,$3); if($3) free($3);} | ASSIGN '(' expression ')' '=' expression { $$=assign_var($1,$3,$6); if($3) free($3); if($6) free($6);} ; expression: REAL { $$=alloc_express(); $$->type=ST_REAL; $$->arg.rvalue=$1; } | INTEGER { $$=alloc_express(); $$->type=ST_INTEGER; $$->arg.value=$1; } | STRING { $$=alloc_express(); $$->type=ST_STRING; $$->arg.string=$1; } | single_element { $$=alloc_express(); $$->type=$1->type; if($1->type==ST_STRING) $$->arg.string=string_copy(0,$1->arg.string); else $$->arg=$1->arg; } | expression '+' expression { $$=do_express_op($1,$3,'+'); } | expression '-' expression { $$=do_express_op($1,$3,'-'); } | expression '*' expression { $$=do_express_op($1,$3,'*'); } | expression '/' expression { $$=do_express_op($1,$3,'/'); } | '-' expression %prec UMINUS { $$=do_express_op($2,0,'-'); } | '(' expression ')' { $$=$2; } ; setcommand: SET SYSTEM_VAR INTEGER { syst_var[$2]=$3; } | SET variable INTEGER { yyerror("Unrecognized system variable"); } ; docommand: DOLOOP { enter_loop(); } ; includecommand: INCLUDE {iflag=1;} complex_string {include_control_file($3);} ; censorcommand: CENSORED single_element WHERE '(' res_condition ')' { add_censored($2,1); at_use=0;} ; affectedcommand: AFFECTED WHERE '(' res_condition ')' { add_censored(0,0); at_use=0;} | UNAFFECTED WHERE '(' res_condition ')' { add_censored(0,2); at_use=0;} ; sexcommand: GENDER single_element expression ',' expression { set_sex($2,$3,$5); } ; whilecommand: WHILE '(' condition ')' { do_while_com($3); if($3) free($3);} ; condition: expression | condition '=' condition {$$=do_logical_op($1,$3,'=');} | condition NEQSYMBOL condition {$$=do_logical_op($1,$3,NEQSYMBOL);} | condition LEQSYMBOL condition {$$=do_logical_op($1,$3,LEQSYMBOL);} | condition GEQSYMBOL condition {$$=do_logical_op($1,$3,GEQSYMBOL);} | condition '<' condition {$$=do_logical_op($1,$3,'<');} | condition '>' condition {$$=do_logical_op($1,$3,'>');} | condition ORSYMBOL condition {$$=do_logical_op($1,$3,ORSYMBOL);} | condition ANDSYMBOL condition {$$=do_logical_op($1,$3,ANDSYMBOL);} | NOTSYMBOL condition {$$=do_logical_op($2,0,NOTSYMBOL);} ; printcommand: PRINTEXP printlist { (void)fputc('\n',stdout); } ; printlist: expression { print_exp($1); if($1) free($1); } | printlist ',' expression { print_exp($3); if($3) free($3); } ; defformatcommand: RSFORMAT complex_string {if(rsformat) free(rsformat); rsformat=$2;} | FSFORMAT complex_string {if(fsformat) free(fsformat); fsformat=$2;} | GSFORMAT complex_string {if(gsformat) free(gsformat); gsformat=$2;} | SKIPFORMAT INTEGER {file_skip=$2;} ; arraycommand: ARRAY arraylist; arraylist: VARIABLE '(' expression ')' {set_array_var($1->data,$3); if($3) free($3); } | arraylist ',' VARIABLE '(' expression ')' {set_array_var($3->data,$5); if($5) free($5); } ; usecommand: USE varlist WHERE '(' res_condition ')' {add_restriction($2);at_use=0;} | USE WHERE '(' res_condition ')' {add_restriction(0);at_use=0;} ; wherecommand: WHERE '(' res_condition ')' USE varlist {add_restriction($6);at_use=0;} | WHERE '(' res_condition ')' {add_restriction(0);at_use=0;} ; res_condition: INTEGER {add_operation(&($1),INTEGER,0);} | REAL {add_operation(&($1),REAL,0);} | STRING {add_operation($1,STRING,0);} | single_element {if($1) check_element_add_op($1);} | res_condition '+' res_condition {add_operation(0,0,'+');} | res_condition '-' res_condition {add_operation(0,0,'-');} | res_condition '*' res_condition {add_operation(0,0,'*');} | res_condition '/' res_condition {add_operation(0,0,'/');} | '(' res_condition ')' | '-' res_condition %prec UMINUS {add_operation(0,0,UMINUS);} | res_condition '=' res_condition {add_operation(0,0,'=');} | res_condition NEQSYMBOL res_condition {add_operation(0,0,NEQSYMBOL);} | res_condition LEQSYMBOL res_condition {add_operation(0,0,LEQSYMBOL);} | res_condition GEQSYMBOL res_condition {add_operation(0,0,GEQSYMBOL);} | res_condition '<' res_condition {add_operation(0,0,'<');} | res_condition '>' res_condition {add_operation(0,0,'>');} | res_condition ORSYMBOL res_condition {add_operation(0,0,ORSYMBOL);} | res_condition ANDSYMBOL res_condition {add_operation(0,0,ANDSYMBOL);} | NOTSYMBOL res_condition {add_operation(0,0,NOTSYMBOL);} ; filecommand: FILEC filename_string ',' filevarlist { do_file_com($2,0,0,$4); } | FILEC '[' formatlist ']' filename_string ',' filevarlist { do_file_com($5,$3,0,$7); } | FILEC '[' fformatlist ']' filename_string ',' filevarlist { do_file_com($5,0,$3,$7); } ; filename_string: complex_string { $$=$1; } | SHELL '(' complex_string ')' { $$=$3; shell_flag=1; } ; formatlist: format {$$=add_f_atom(0,$1); } | formatlist ',' format {$$=add_f_atom($1,$3); } | INTEGER '(' formatlist ')' {$$=add_f_list(0,$3,$1); } | formatlist ',' INTEGER '(' formatlist ')' {$$=add_f_list($1,$5,$3); } ; fformatlist: fformat | fformatlist ',' fformat {$$=add_fformat($1,$3); } | fformatlist ';' fformat {$$=add_fformat($1,$3); } ; fformat: FSFORMAT complex_string {$$=create_fformat($2,2); } | RSFORMAT complex_string {$$=create_fformat($2,1); } | GSFORMAT complex_string {$$=create_fformat($2,4); } | SKIPFORMAT INTEGER {$$=create_fformat(&$2,3); } ; format: INTEGER {$$=make_f_atom($1,0);} | INTEGER 'x' {$$=make_f_atom($1,1);} | 'x' {$$=make_f_atom(1,1);} | INTEGER error {$$=make_f_atom(0,1); scan_error|=FORMAT_ERR; } | error {$$=make_f_atom(0,1); scan_error|=FORMAT_ERR; } ; logcommand: LOG complex_string { if(LogFile) free(LogFile); LogFile=$2; } ; outputcommand: OUTPUT complex_string { if(OutputFile) free(OutputFile); OutputFile=$2; } | LAUROUTPUT complex_string { if(OutputLaurFile) free(OutputLaurFile); OutputLaurFile=$2; } | RAWOUTPUT complex_string { if(OutputRawFile) free(OutputRawFile); OutputRawFile=$2; } ; errordircommand: ERRORDIR complex_string { if(ErrorDir) free(ErrorDir); ErrorDir=$2;} ; missingcommand: MISSING expression { do_missing_com($2,0,0); free($2); } | MISSING expression varlist { do_missing_com($2,$3,0); free($2); } | MISSING expression ',' varlist { do_missing_com($2,$4,0); free($2); } | MISSING '[' complex_string ']' expression { do_missing_com($5,0,$3); free($5); } ; pedcommand: PEDIGREE varlist { do_ped_com($2); } ; locicommand: MARKER LOCUS locuslist | TRAIT LOCUS varlist { change_type(ST_TRAITLOCUS,$3); free_vlist($3);} ; changetypecommand: CONSTANT varlist { change_type(ST_CONSTANT,$2); free_vlist($2);} | MULTIPLE varlist { change_type(ST_MULTIPLE,$2); free_vlist($2);} | RANDOM varlist { change_type(ST_RANDOM|ST_FACTOR,$2); free_vlist($2);} | FACTOR varlist { change_type(ST_FACTOR,$2); free_vlist($2);} | REAL varlist {change_type(ST_REALTYPE,$2); free_vlist($2);} | INTEGER varlist {change_type(ST_INTTYPE,$2); free_vlist($2);} ; linkcom1: LINK { $$=LINK_AUTO; } | LINK '[' 'x' ']' { $$=LINK_X; } | LINK '[' 'y' ']' { $$=LINK_Y; } ; linkcommand: linkcom1 varlist { do_link_com(0,$1,$2); } | linkcom1 complex_string1 ',' varlist { do_link_com($2,$1,$4); } | linkcom1 complex_string1 { yyerror1("No variable list for LINK command\n"); } ; filtercommand: FILTER complex_string { if(Filter) { print_scan_warn("Line %d: Warning - Filter defined twice\n",lineno); free(Filter); } Filter=$2; } ; modelcommand: MODEL variable '=' modellist {do_model_com($4,$2,0);} | MODEL ARRAY_VAR '(' expression ')' '=' modellist {do_model_com($7,$2,$4); if($4) free($4); } ; groupcommand: GROUP single_element {set_group($2);} ; modellist: modellist '+' single_vlist { $$=add_to_model($1,$3); } | modellist '+' interactionlist { $$=add_to_model($1,$3); } | interactionlist { $$=add_to_model(0,$1); } | single_vlist { $$=add_to_model(0,$1); } ; interactionlist: single_vlist '*' single_vlist { $$=add_var_lists($1,$3); } | single_vlist '.' single_vlist { $$=add_var_lists($1,$3); } | interactionlist '*' single_vlist { $$=add_var_lists($1,$3); } | interactionlist '.' single_vlist { $$=add_var_lists($1,$3); } ; variable: VARIABLE | GENDER { $$=create_var("SEX"); } ; single_vlist: variable { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR '(' expression ')' { $$=add_to_var_list(0,$1,$3); if($3) free($3); } ; single_element: variable { $$=get_element($1,0); } | ARRAY_VAR '(' expression ')' { $$=get_element($1,$3); if($3) free($3); } ; locuslist: locus | locuslist ',' locus; locus: single_element lociclause { if($1) set_locus_element($1); } | single_element { if($1) set_locus_element($1); } | ARRAY_VAR { if($1) set_locus_array($1); } ; lociclause: '[' single_element ']' { if($2) set_haplo_element($2,0); } | '[' single_element ',' single_element ']' { if($2) set_haplo_element($2,$4); } | '[' error ']' ; simple_varlist: single_vlist | simple_varlist ',' single_vlist { $$=add_var_lists($1,$3); } ; open_bracket: '(' { start_loopclause(); } ; loop_clause1: open_bracket simple_varlist ',' BREAK assignment ',' expression ')' { free_vlist($2); begin_looping($5,$7,0); } | open_bracket simple_varlist ',' BREAK assignment ',' expression ',' expression ')' { free_vlist($2); begin_looping($5,$7,$9); } ; loop_clause: loop_clause1 LOOP_CLAUSE_START simple_varlist LOOP_CLAUSE_END { $$=$3; in_loopclause=0; } | loop_clause1 { $$=0; in_loopclause=0; } ; fsingle_vlist: { $$=add_to_var_list(0,0,0); } | variable { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR { $$=add_to_var_list(0,$1,0); } | ARRAY_VAR '(' expression ')' { $$=add_to_var_list(0,$1,$3); if($3) free($3); } ; filevarlist: fsingle_vlist | loop_clause | filevarlist ',' fsingle_vlist { $$=add_var_lists($1,$3); } | filevarlist ',' loop_clause { $$=add_var_lists($1,$3); } ; varlist: single_vlist | loop_clause | varlist ',' single_vlist { $$=add_var_lists($1,$3); } | varlist ',' loop_clause { $$=add_var_lists($1,$3); } ; complex_string1: STRING { $$ = $1; } | complex_string1 '+' STRING { $$ = string_copy($1,$3); free($3); } | single_element '+' complex_string1 { if($1 && ($1->type&ST_STRING)) $$ = string_copy($3,$1->arg.string); else $$=$3; } ; complex_string: STRING { $$ = $1; } | single_element { if($1 && ($1->type&ST_STRING)) $$ = string_copy(0,$1->arg.string); else $$=0; } | complex_string '+' STRING { $$ = string_copy($1,$3); free($3); } | complex_string '+' single_element { if($3 && ($3->type&ST_STRING)) $$ = string_copy($1,$3->arg.string); else $$=$1; } ; %% static void enter_loop(void) { if(loop_leveltype==ST_INTEGER) loop_clause_end=(int)exp1->arg.value; else er=1; if(!er && exp2) { if(exp2->type==ST_INTEGER) loop_clause_step=(int)exp2->arg.value; else er=1; } else loop_clause_step=1; if(element->type&ST_INTEGER) { i=(int)element->arg.value; if(loop_clause_step<0) { if(iloop_clause_end) er= -1; } else er=1; } else er=2; if(er) { switch(er) { case 1: yyerror("Loop variable not integer type\n"); break; case 2: yyerror("Syntax error\n"); break; } loop_record=loop_stat[--loop_level]; if(!loop_record) loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; in_loopclause=0; } else { in_loopclause= -1; loop_record= -1; loop_clause_ptr=loop_main_ptr; loop_clause_element=element; loop_main_ptr=loop_ptr[loop_level-1]; } if(exp1) free(exp1); if(exp2) free(exp2); } static int if_true(struct express *express) { int l=0; if(express) { switch(express->type) { case ST_INTEGER: l=(express->arg.value!=0); break; case ST_REAL: l=(express->arg.rvalue!=0.0); break; case ST_STRING: if(express->arg.string && express->arg.string[0]) l=1; } } return l; } static void do_while_com(struct express *express) { int i; if(loop_level) { if(!scan_error_n && if_true(express)) { loop_record= -1; loop_main_ptr=loop_ptr[loop_level-1]; } else { loop_record=loop_stat[--loop_level]; if(!loop_record) { i=loop_main_ptr-1; loop_main_ptr=loop_level?loop_ptr[loop_level-1]:0; for(;i>=loop_main_ptr;i--) { if(loop_stack[i].token==STRING) free(loop_stack[i].yylval.string); } } } } else yyerror("WHILE outside of do loop\n"); } static void print_exp(struct express *express) { if(!express) return; switch(express->type) { case ST_STRING: (void)fputs(express->arg.string,stdout); free(express->arg.string); break; case ST_INTEGER: (void)printf("%ld",express->arg.value); break; case ST_REAL: (void)printf("%g",express->arg.rvalue); break; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_sex" static void set_sex(struct var_element *elem,struct express *exp1,struct express *exp2) { struct sex_def *se; if(!exp1 || !exp2) yyerror1("Null arguments to sex command\n"); else { if(exp1->type != exp2->type) yyerror1("Arguments to sex command of different type\n"); else if(exp1->type!=ST_INTEGER && exp1->type!=ST_STRING) yyerror1("Arguments to sex command of invalid type\n"); else { if(!(se=malloc(sizeof(struct sex_def)))) ABT_FUNC(MMsg); se->sex_exp[0]=exp1; se->sex_exp[1]=exp2; se->sex_elem=elem; elem->type|=(ST_SEX|ST_FACTOR|ST_CONSTANT|ST_DATA); if(exp1->type==ST_INTEGER) elem->type|=ST_INTTYPE; se->next=sex_def; sex_def=se; } } } static void set_group(struct var_element *elem) { if(group_elem) yyerror1("Error: Multiple group commands"); else { group_elem=elem; group_elem->type|=(ST_GROUP|ST_FACTOR|ST_CONSTANT); } } static void do_ped_com(struct var_list *vlist) { int i,j,n; struct var_list *vlist1; struct scan_data *sd; if(pedflag) { yyerror1("Error: Multiple pedigree commands"); scan_error|=PED_ERR; } pedflag=1; n=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { if(n<4) pedlist[n]=sd->element+vlist->index-1; n++; } else for(i=0;in_elements;i++) { if(n<4) pedlist[n]=sd->element+i; n++; } } else { if(n<4) pedlist[n]=sd->element; n++; } vlist1=vlist->next; free(vlist); vlist=vlist1; } if(n!=3 && n!=4) { yyerror1("Error: Wrong no. variables for pedigree command (3 or 4 required)"); scan_error|=PED_ERR; } else { for(i=1;itype|=(ST_FAMILY|ST_FACTOR|ST_CONSTANT); family_id=1; i=1; } else i=0; pedlist[i++]->type|=(ST_ID|ST_FACTOR|ST_CONSTANT); pedlist[i++]->type|=(ST_SIRE|ST_FACTOR|ST_CONSTANT); pedlist[i++]->type|=(ST_DAM|ST_FACTOR|ST_CONSTANT); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_express" static struct express *alloc_express(void) { struct express *e; if(!(e=malloc(sizeof(struct express)))) ABT_FUNC(MMsg); return e; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_logical_op" static struct express *do_logical_op(struct express *ex1,struct express *ex2,int op) { int i=0,l=0; double rv1,rv2; char *s1,*s2; s1=s2=0; if(ex1->type&ST_STRING) { s1=ex1->arg.string; i++; } if(ex2 && ex2->type&ST_STRING) { s2=ex2->arg.string; i++; } if(i==2) { switch(op) { case '=': l=mystrcmp(s1,s2)?0:1; break; case NEQSYMBOL: l=mystrcmp(s1,s2)?1:0; break; case '<': l=mystrcmp(s1,s2)<0?1:0; break; case '>': l=mystrcmp(s1,s2)>0?1:0; break; case LEQSYMBOL: l=mystrcmp(s1,s2)>=0?1:0; break; case GEQSYMBOL: l=mystrcmp(s1,s2)>=0?1:0; break; case ORSYMBOL: l=(s1 || s2); break; case ANDSYMBOL: l=(s1 && s2); break; default: ABT_FUNC("Internal error - invalid string op\n"); } } else if(i && !ex2) { if(op!=NOTSYMBOL) ABT_FUNC("Internal error - invalid unary string op\n"); else l=s1?0:1; } else if(i) { switch(op) { case ORSYMBOL: if(ex1->type&ST_STRING) l=(s1 || ex2->arg.value); else l=(s2 || ex1->arg.value); break; case ANDSYMBOL: if(ex1->type&ST_STRING) l=(s1 && ex2->arg.value); else l=(s2 && ex1->arg.value); break; default: ABT_FUNC("Internal error - invalid string op\n"); } } else { rv1=rv2=0.0; if(ex1->type&ST_INTEGER) rv1=(double)ex1->arg.value; else if(ex1->type&ST_REAL) rv1=ex1->arg.rvalue; if(ex2) { if(ex2->type&ST_INTEGER) rv2=(double)ex2->arg.value; else if(ex2->type&ST_REAL) rv2=ex2->arg.rvalue; } switch(op) { case '=': l=(rv1==rv2); break; case NEQSYMBOL: l=(rv1!=rv2); break; case '<': l=(rv1': l=(rv1>rv2); break; case LEQSYMBOL: l=(rv1<=rv2); break; case GEQSYMBOL: l=(rv1>=rv2); break; case ORSYMBOL: l=(rv1 || rv2); break; case ANDSYMBOL: l=(rv1 && rv2); break; case NOTSYMBOL: l=(rv1==0.0); break; default: ABT_FUNC("Internal error - invalid op\n"); } } if(ex2) free(ex2); ex1->type=ST_INTEGER; ex1->arg.value=l; return ex1; } static struct express *do_express_op(struct express *ex1,struct express *ex2,int op) { double rv1,rv2; int i; if(ex1->type&ST_STRING) { if(ex2 && ex2->type&ST_STRING) { if(op!='+') yyerror("Illegal string operation\n"); else { ex1->arg.string=string_copy(ex1->arg.string,ex2->arg.string); free(ex2->arg.string); } } else yyerror("Can't mix numeric and string expressions\n"); } else if(ex2 && ex2->type&ST_STRING) yyerror("Can't mix numeric and string expressions\n"); else { rv1=rv2=0.0; if(ex1->type&ST_INTEGER) rv1=(double)ex1->arg.value; else if(ex1->type&ST_REAL) rv1=ex1->arg.rvalue; if(ex2) { if(ex2->type&ST_INTEGER) rv2=(double)ex2->arg.value; else if(ex2->type&ST_REAL) rv2=ex2->arg.rvalue; } switch(op) { case '+': rv1+=rv2; break; case '-': if(ex2) rv1-=rv2; else rv1= -rv1; break; case '*': rv1*=rv2; break; case '/': if(rv2==0.0) { yyerror("Divide by zero error\n"); rv1=0.0; } else rv1/=rv2; break; } i=(int)rv1; if((double)i==rv1) { ex1->type=ST_INTEGER; ex1->arg.value=i; } else { ex1->type=ST_REAL; ex1->arg.rvalue=rv1; } } if(ex2) free(ex2); return ex1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "check_element_add_op" static void check_element_add_op(struct var_element *element) { switch(element->type&(ST_REAL|ST_INTEGER|ST_STRING)) { case ST_STRING: add_operation(string_copy(0,element->arg.string),STRING,0); break; case ST_INTEGER: add_operation(&element->arg,INTEGER,0); break; case ST_REAL: add_operation(&element->arg,REAL,0); break; case 0: add_operation(element,VARIABLE,0); break; default: ABT_FUNC("Internal error - illegal element type\n"); } } static int check_index(struct scan_data *sd,struct express *express) { int i; if(express->type!=ST_INTEGER) { if(in_loopclause<=0) yyerror("Non-integral expression for array index"); } else if(sd->vtype&ST_ARRAY) { i=(int)express->arg.value; if(i<1 || i>sd->n_elements) { if(in_loopclause<=0) yyerror("Array index out of bounds"); } else return i; } else yyerror("Not an array"); return 0; } static struct var_element *get_element(struct bin_node *node,struct express *express) { int i; struct scan_data *sd; sd=node->data; if(express) { if(!(i=check_index(sd,express))) return 0; return sd->element+i-1; } else { if(sd->vtype&ST_ARRAY) { yyerror("Illegal reference to array"); return 0; } } return sd->element; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "set_array_var" static void set_array_var(struct scan_data *sd,struct express *express) { int i; if(express->type!=ST_INTEGER) yyerror("Non-integral expression for array size"); else if((i=(int)express->arg.value)<1) yyerror("Illegal array size"); else if(sd->vtype) yyerror("Can't redefine variable"); else { sd->vtype|=ST_ARRAY; sd->n_elements=i; free(sd->element); if(!(sd->element=calloc((size_t)sd->n_elements,sizeof(struct var_element)))) ABT_FUNC(MMsg); } } static int count_var_list(struct var_list *vlist) { int i=0; struct scan_data *sd=0; while(vlist) { sd=vlist->var?vlist->var->data:0; if(sd && (sd->vtype&ST_ARRAY) && !vlist->index) i+=sd->n_elements; else i++; vlist=vlist->next; } return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "assign_var" static struct var_element *assign_var(struct bin_node *node,struct express *ix,struct express *express) { struct var_element *element; struct scan_data *sd; if(!express) return 0; if(!(element=get_element(node,ix))) return 0; switch(express->type) { case ST_STRING: element->arg.string=express->arg.string; RemBlock=AddRemem(element->arg.string,RemBlock); break; case ST_REAL: case ST_INTEGER: element->arg=express->arg; break; case 0: yyerror1("Undefined assignment\n"); element->type=0; element->arg.string=0; break; default: ABT_FUNC(IntErr); } if(!ix) { sd=node->data; sd->vtype|=ST_SCALAR; } element->type=express->type; return element; } void check_vars(struct bin_node *node,int *i,void check_func(struct bin_node *,int *)) { if(node->left) { check_vars(node->left,i,check_func); } check_func(node,i); if(node->right) { check_vars(node->right,i,check_func); } } static void check_vars_1(struct bin_node *node,void check_func(struct bin_node *)) { if(node->left) { check_vars_1(node->left,check_func); } check_func(node); if(node->right) { check_vars_1(node->right,check_func); } } void print_scan_err(char *fmt, ...) { va_list args; va_start(args,fmt); (void)vfprintf(stderr,fmt,args); va_end(args); if((++scan_error_n)>=max_scan_errors) abt(__FILE__,__LINE__,"Too many errors - aborting\n"); } void print_scan_warn(char *fmt, ...) { va_list args; if(scan_warn_nnext=Op_List; Op_List=o; o->type=type; o->op=op; switch(type) { case VARIABLE: o->arg.element= (struct var_element *)arg; break; case INTEGER: o->arg.value= *(int *)arg; break; case REAL: o->arg.rvalue= *(double *)arg; break; case STRING: o->arg.string= (char *)arg; break; } } static void new_command(void) { shell_flag=in_loopclause=0; Op_List=0; iflag=0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_to_model" static struct model_list *add_to_model(struct model_list *model,struct var_list *vlist) { struct var_list *vlist1; struct scan_data *sd; struct model_list *m1; int i; if(!(m1=malloc(sizeof(struct model_list)))) ABT_FUNC(MMsg); if(vlist) { i=count_var_list(vlist); if(!(m1->element=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { sd->element[vlist->index-1].type|=ST_MODEL; sd->element[vlist->index-1].index=vlist->index; sd->element[vlist->index-1].oindex=vlist->index; m1->element[i++]=sd->element+vlist->index-1; } else yyerror("Error - Can't use whole arrays as model parameters"); } else { sd->element[0].type|=ST_MODEL; sd->element[0].index=0; m1->element[i++]=sd->element; } vlist1=vlist->next; free(vlist); vlist=vlist1; } m1->nvar=i; } else ABT_FUNC("Nothing to add...\n"); m1->next=model; return m1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "string_copy" static char *string_copy(char *s1,char *s2) { if(s1) { if(!(s1=realloc(s1,strlen(s1)+strlen(s2)+1))) ABT_FUNC(MMsg); (void)strcat(s1,s2); } else { if(!(s1=malloc(strlen(s2)+1))) ABT_FUNC(MMsg); (void)strcpy(s1,s2); } return s1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "setup_format" static struct format *setup_format(struct format_clause *fc) { int i,n=0,pp=0; struct format_atom **fa; struct format *format; fa=fc->f_atoms; for(i=0;in_atoms;i++) if(!fa[i]->pos) n++; if(!n) { if(!(scan_error&FORMAT_ERR)) yyerror("Error - Empty format clause"); free(fa); free(fc); scan_error|=FORMAT_ERR; scan_error_n++; return 0; } if(!(format=malloc(sizeof(struct format)))) ABT_FUNC(MMsg); format->line=lineno; if(!(format->f_atoms=malloc(sizeof(struct format_atom)*n))) ABT_FUNC(MMsg); for(i=n=0;in_atoms;i++) { if(!fa[i]->pos) { format->f_atoms[n].size=fa[i]->size; format->f_atoms[n++].pos=pp; } pp+=fa[i]->size; } free(fa); format->n_atoms=n; f_atom_n=0; free(fc); return format; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "make_f_atom" static struct format_atom *make_f_atom(int n,int flag) { if(f_atom_n>=f_atom_size) { f_atom_size*=2; if(!(f_atom_list=realloc(f_atom_list,sizeof(struct format_atom)*f_atom_size))) ABT_FUNC(MMsg); } f_atom_list[f_atom_n].size=n; f_atom_list[f_atom_n].pos=flag; return &f_atom_list[f_atom_n++]; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_fformat" static struct fformat *add_fformat(struct fformat *f1,struct fformat *f2) { if(f2->rs) { if(f1->rs) free(f1->rs); f1->rs=f2->rs; } if(f2->fs) { if(f1->fs) free(f1->fs); f1->fs=f2->fs; } if(f2->gs) { if(f1->gs) free(f1->gs); f1->gs=f2->gs; } if(f2->skip) f1->skip=f2->skip; free(f2); return f1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "create_fformat" static struct fformat *create_fformat(void *p,int fg) { struct fformat *ff; int *i; if(!(ff=malloc(sizeof(struct fformat)))) ABT_FUNC(MMsg); ff->rs=ff->fs=ff->gs=0; ff->skip=0; switch(fg) { case 1: ff->rs=p; break; case 2: ff->fs=p; break; case 3: i=p; ff->skip=*i; break; case 4: ff->gs=p; break; default: ABT_FUNC("Internal error - incorrect flag\n"); } return ff; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_f_atom" static struct format_clause *add_f_atom(struct format_clause *fc,struct format_atom *fa) { if(!fc) { if(!(fc=malloc(sizeof(struct format_clause)))) ABT_FUNC(MMsg); fc->fc_size=16; fc->n_atoms=0; if(!(fc->f_atoms=malloc(sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } if(fc->n_atoms>=fc->fc_size) { fc->fc_size*=2; if(!(fc->f_atoms=realloc(fc->f_atoms,sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } fc->f_atoms[fc->n_atoms++]=fa; return fc; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_f_list" static struct format_clause *add_f_list(struct format_clause *fc,struct format_clause *fc1,int n) { int sz,i,j; sz=fc1->n_atoms*n; if(!fc) { if(!(fc=malloc(sizeof(struct format_clause)))) ABT_FUNC(MMsg); fc->fc_size=16; if(sz>16) fc->fc_size=sz; fc->n_atoms=0; if(!(fc->f_atoms=malloc(sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } else { if(sz>(fc->fc_size-fc->n_atoms)) { fc->fc_size=sz+fc->n_atoms; if(!(fc->f_atoms=realloc(fc->f_atoms,sizeof(struct format_atom *)*fc->fc_size))) ABT_FUNC(MMsg); } } for(i=0;in_atoms;j++) fc->f_atoms[fc->n_atoms++]=fc1->f_atoms[j]; free(fc1->f_atoms); free(fc1); return fc; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_var" static struct bin_node *alloc_var(char *p) { struct bin_node *node; struct scan_data *sd; int i; if(!(node=malloc(sizeof(struct bin_node)))) ABT_FUNC(MMsg); node->left=node->right=0; node->balance=0; if(!(sd=malloc(sizeof(struct scan_data)))) ABT_FUNC(MMsg); node->data=sd; sd->vtype=0; i=(int)strlen(p); if(!(sd->name=malloc((size_t)i+1))) ABT_FUNC(MMsg); sd->name[i--]=0; for(;i>=0;i--) sd->name[i]=toupper((int)p[i]); sd->n_elements=1; if(!(sd->element=calloc(1,sizeof(struct var_element)))) ABT_FUNC(MMsg); sd->element->arg.element=0; return node; } static struct bin_node *find_var(char *p,struct bin_node *node,struct bin_node **node1,int *balanced) { int i; struct scan_data *sd; sd=node->data; if((i=strcasecmp(p,sd->name))) { if(i<0) { if(node->left) { node->left=find_var(p,node->left,node1,balanced); } else { *node1=node->left=alloc_var(p); *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node=rotate_left(node); *balanced=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *balanced=1; } } } else { if(node->right) { node->right=find_var(p,node->right,node1,balanced); } else { *node1=node->right=alloc_var(p); *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node->balance=0; *balanced=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *balanced=1; } } } } else { *node1=node; *balanced=1; } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Check_var" static void Check_var(struct bin_node *node) { int i; struct var_element *element; struct scan_data *sd; char *nbuf; if(node->left) Check_var(node->left); sd=node->data; i=strlen(sd->name)+4+log((double)(sd->n_elements+1))/log(10.0); if(!(nbuf=malloc((size_t)i))) ABT_FUNC(MMsg); for(i=0;in_elements;i++) { if(sd->vtype&ST_ARRAY) (void)sprintf(nbuf,"%s(%d)",sd->name,i+1); else (void)strcpy(nbuf,sd->name); element=sd->element+i; if(!(element->type&(ST_DATA|ST_TRAITLOCUS|ST_LINKED))) { if(element->type&(ST_MODEL|ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_TRAIT|ST_GROUP)) print_scan_err("Error: No data for variable %s\n",nbuf); } if((element->type&ST_DATA) && (element->type&ST_TRAITLOCUS)) print_scan_err("Error: Variable %s can not have data\n",nbuf); else if((element->type&ST_LINKED) && !(element->type&(ST_TRAITLOCUS|ST_MARKER))) print_scan_err("Error: Variable %s is not a locus and so can not be linked\n",nbuf); else if((element->type&ST_TRAIT) && (element->type&(ST_GROUP|ST_MARKER|ST_TRAITLOCUS|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_LINKED|ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for trait\n",nbuf); else if((element->type&ST_TRAITLOCUS) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_RANDOM|ST_MARKER|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_STRING|ST_REAL|ST_INTEGER|ST_REALTYPE|ST_INTTYPE))) print_scan_err("Error: Variable %s inappropriate type for trait locus\n",nbuf); else if((element->type&ST_MARKER) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_REAL|ST_INTEGER|ST_RANDOM|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_STRING|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for marker\n",nbuf); else if((element->type&ST_HAPLO) && (element->type&(ST_SEX|ST_GROUP|ST_CENSORED|ST_REAL|ST_RANDOM|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Variable %s inappropriate type for haplotype\n",nbuf); else if((element->type&ST_RANDOM) && (element->type&(ST_SEX|ST_GROUP|ST_STRING|ST_REAL|ST_INTEGER|ST_REAL))) print_scan_err("Error: Variable %s inappropriate type to be random\n",nbuf); else if((element->type&(ST_INTTYPE|ST_REALTYPE)) && (element->type&(ST_STRING|ST_REAL|ST_INTEGER))) print_scan_err("Error: Type collision for variable %s\n",nbuf); else if((element->type&ST_INTTYPE) && (element->type&ST_REALTYPE)) print_scan_err("Error: Real variable %s can not also be integer type\n",nbuf); else if((element->type&(ST_STRING|ST_REAL)) && (element->type&(ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM))) print_scan_err("Error: Variable %s can not be a pedigree or sex variable\n",nbuf); else if((element->type&ST_REAL) && (element->type&(ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_SEX))) print_scan_err("Error: Real variable %s can not be a pedigree or sex variable\n",nbuf); else if((element->type&ST_FACTOR) && (element->type&ST_REAL)) print_scan_err("Error: Real variable %s can not be a factor\n",nbuf); else if((element->type&ST_CONSTANT)&&(element->type&ST_MULTIPLE)) print_scan_err("Error: Variable %s can not be in multiple records and be constant\n",nbuf); else if(element->type&(ST_SEX|ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_TRAITLOCUS|ST_GROUP|ST_LINKED|ST_MODEL|ST_TRAIT)) element->type|=ST_REQUIRED; else if(element->type&ST_HAPLO) { if(element->arg.element && element->arg.element->type&ST_LINKED) { element->type|=ST_REQUIRED; if(!(element->type&ST_DATA)) print_scan_err("Error: No data for variable %s\n",nbuf); } } if((element->type&(ST_MARKER|ST_REQUIRED)) == (ST_MARKER|ST_REQUIRED)) n_markers++; if(!(element->type&(ST_CONSTANT|ST_MULTIPLE))) element->type|=syst_var[MULTIPLE_RECORDS]?ST_MULTIPLE:ST_CONSTANT; if(element->type&(ST_REQUIRED|ST_RESTRICT)) { if(!(element->type&ST_HAPLO)) element->arg.var=node; } else element->type=0; } free(nbuf); if(node->right) Check_var(node->right); } static struct bin_node *create_var(char *p) { int k; struct bin_node *node; if(!root_var) node=root_var=alloc_var(p); else { root_var=find_var(p,root_var,&node,&k); } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "symbol_lookup" int symbol_lookup(char *p,int fg) { static char *Coms[] = {"FILE","LOCUS","LOCI","MARKER","DISCRETE","MODEL","PEDIGREE","LOG", "FILTER","MISSING","MODEL","LINK","RANDOM","TRAIT","WHERE","USE", "REAL","INTEGER","SHELL","ARRAY","PRINT","DO","WHILE","CONSTANT", "MULTIPLE","CENSORED","GROUP","SET","SEX","AFFECTED","UNAFFECTED","OUTPUT","INCLUDE","ERRORDIR", "LAUROUTPUT","RAWOUTPUT",(char *)0}; static int Com_token[] = {FILEC,LOCUS,LOCUS,MARKER,FACTOR,MODEL,PEDIGREE,LOG, FILTER,MISSING,MODEL,LINK,RANDOM,TRAIT,WHERE,USE, REAL,INTEGER,SHELL,ARRAY,PRINTEXP,DOLOOP,WHILE,CONSTANT, MULTIPLE,CENSORED,GROUP,SET,GENDER,AFFECTED,UNAFFECTED,OUTPUT,INCLUDE,ERRORDIR, LAUROUTPUT,RAWOUTPUT,SYSTEM_VAR,VARIABLE,ARRAY_VAR}; static char *Syst[] = {"PRUNE_OPTION","RECODE_OPTION","NO_EXTRA_ALLELE", "PEEL_OPTION","TRACE_RESTRICT","TRACE_CENSORED","TRACE_AFFECTED", "CORRECT_ERRORS","TRACE_PEEL","MULTIPLE_RECORDS","MULTIVARIATE_TEST", "ERROR_CHECK","NO_DEFAULT_MISSING","SKIP_BAD_REALS","SKIP_BAD_INTS",(char *)0}; int i=0,j=0; static struct scan_data *sd; while(Coms[i]) { if(!strcasecmp(Coms[i],p)) break; i++; } at_file=0; if(Com_token[i]==FILEC || Com_token[i]==LINK) at_file=1; if(Com_token[i]==SYSTEM_VAR) { i++; while(Syst[j]) { if(!strcasecmp(Syst[j],p)) { yylval.value=j; i--; break; } j++; } } if(Com_token[i]==VARIABLE) { if(fg==1 && begin_comm) { begin_comm=0; return BREAK; } yylval.var=create_var(p); sd=yylval.var->data; if(sd->vtype&ST_ARRAY) i++; if(fg==1) { begin_comm=1; (void)strcpy(linebuf1,linebuf); lineno1=lineno; } } else if(begin_comm && Com_token[i]!=SYSTEM_VAR && Com_token[i]!=LOCUS && Com_token[i]!=SHELL && !(at_use==1 && Com_token[i]==WHERE) && !(at_use==2 && Com_token[i]==USE)) { begin_comm=0; at_use=0; return BREAK; } else { begin_comm=1; (void)strcpy(linebuf1,linebuf); lineno1=lineno; if(Com_token[i]==MODEL) at_model=1; else at_model=0; if(Com_token[i]==USE || Com_token[i]==CENSORED || Com_token[i]==AFFECTED || Com_token[i]==UNAFFECTED) at_use|=1; else if(Com_token[i]==WHERE) at_use|=2; else at_use=0; } return Com_token[i]; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "symbol_lookup" static struct var_list *add_to_var_list(struct var_list *vlist,struct bin_node *node,struct express *express) { struct var_list *vlist1,*vlist2; struct scan_data *sd=0; int i; if(node) sd=node->data; if(express) i=check_index(sd,express); else { i=0; if(sd && !(sd->vtype&ST_ARRAY)) sd->vtype|=ST_SCALAR; } if(!(vlist1=malloc(sizeof(struct var_list)))) ABT_FUNC(MMsg); vlist1->next=0; vlist1->var=node; vlist1->index=i; vlist2=vlist; if(vlist2) { while(vlist2->next) vlist2=vlist2->next; vlist2->next=vlist1; } else vlist=vlist1; return vlist; } struct var_list *add_var_lists(struct var_list *vlist,struct var_list *vlist1) { struct var_list *vlist2; vlist2=vlist; if(vlist2) { while(vlist2->next) vlist2=vlist2->next; vlist2->next=vlist1; } else vlist=vlist1; return vlist; } static void set_locus_array(struct bin_node *node) { struct scan_data *sd; int i; sd=node->data; if(sd->vtype&ST_ARRAY) { for(i=0;in_elements;i++) { set_locus_element(sd->element+i); } } else yyerror("Not an array"); } static void set_locus_element(struct var_element *element) { element->type|=(ST_MARKER|ST_FACTOR|ST_CONSTANT); if(hap_list[0]) { if(hap_list[0]->arg.element && hap_list[0]->arg.element!=element) { yyerror1("Haplotype vector (left) used twice"); hap_list[0]->arg.element=0; } else hap_list[0]->arg.element=element; } if(hap_list[1]) { if(hap_list[1]->arg.element && hap_list[1]->arg.element!=element) { yyerror1("Haplotype vector (right) used twice"); hap_list[1]->arg.element=0; } else hap_list[1]->arg.element=element; } hap_list[0]=hap_list[1]=0; } static void set_haplo_element(struct var_element *element,struct var_element *element1) { element->type|=(ST_HAPLO|ST_FACTOR|ST_CONSTANT); if(element1) element1->type|=(ST_HAPLO|ST_FACTOR|ST_CONSTANT); hap_list[0]=element; hap_list[1]=element1; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_file_com" static void do_file_com(char *fname,struct format_clause *fc,struct fformat *ff,struct var_list *vlist) { int i,j; struct InFile *file; struct format *format; struct var_list *vlist1; struct var_element *element; struct scan_data *sd; if(!vlist) { yyerror1("No variables listed for FILE command\n"); return; } else if(!fname) { free_vlist(vlist); return; } else if(!fname[0]) { yyerror1("Zero length filename for FILE command\n"); free_vlist(vlist); return; } file=Infiles; if(!(Infiles=calloc(1,sizeof(struct InFile)))) ABT_FUNC(MMsg); Infiles->next=file; Infiles->nvar=count_var_list(vlist); if(!(Infiles->element=malloc(sizeof(void *)*Infiles->nvar))) ABT_FUNC(MMsg); i=0; while(vlist) { if(vlist->var) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { element=sd->element+vlist->index-1; element->type|=ST_DATA; Infiles->element[i++]=element; } else { for(j=0;jn_elements;j++) { element=sd->element+j; element->type|=ST_DATA; Infiles->element[i++]=element; } } } else { element=sd->element; element->type|=ST_DATA; Infiles->element[i++]=element; } } else Infiles->element[i++]=0; vlist1=vlist->next; free(vlist); vlist=vlist1; } if(fc) { format=setup_format(fc); Infiles->format=format; if(!(scan_error&FORMAT_ERR)) { if(format->n_atomsn_atoms = %d\n",format->n_atoms); (void)printf("i = %d\n",i); print_scan_err("Line %d: Error - Too many variables for format clause\n",format->line); scan_error|=FORMAT_ERR; } else if(format->n_atoms>i) print_scan_warn("Line %d: Warning - Too few variables for format clause\n",format->line); } } else if(ff) Infiles->fformat=ff; Infiles->name=fname; Infiles->shell_flag=shell_flag; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "change_type" static void change_type(int type,struct var_list *vlist) { int j; struct scan_data *sd; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) sd->element[vlist->index-1].type|=type; else for(j=0;jn_elements;j++) sd->element[j].type|=type; } else sd->element[0].type|=type; vlist=vlist->next; } } static void free_vlist(struct var_list *vlist) { struct var_list *vlist1; while(vlist) { vlist1=vlist->next; free(vlist); vlist=vlist1; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_link_com" static void do_link_com(char *s,int type,struct var_list *vlist) { struct Link *l,*l1; struct var_list *vlist1; struct var_element *element; struct scan_data *sd; int i,j; if(!vlist) ABT_FUNC("Zero var_list pointer\n"); sd=vlist->var->data; if(!(l1=malloc(sizeof(struct Link)))) ABT_FUNC(MMsg); l1->next=0; l=links; if(l) { while(l->next) l=l->next; l->next=l1; } else links=l1; if(!s) { if(sd->vtype&ST_ARRAY && vlist->index) { element=sd->element+vlist->index-1; if(element->type&ST_STRING) { s=element->arg.string; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else { element=sd->element; if(element->type&ST_STRING) { s=element->arg.string; vlist1=vlist->next; free(vlist); vlist=vlist1; } } } l1->name=s; if(!vlist) { if(s) print_scan_err("Error: No variable list for LINK command (%s)\n",s); else print_scan_err("Error: No variable list for LINK command\n"); scan_error|=LINK_ERR; return; } i=count_var_list(vlist); l1->n_loci=i; l1->type=type; if(!(l1->element=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) { element=sd->element+vlist->index-1; if(element->type&ST_LINKED) { print_scan_err("Error: %s(%d) appears in multiple linkage groups\n",sd->name,vlist->index); scan_error|=LINK_ERR; } else element->type|=ST_LINKED; l1->element[i++]=element; } else { if(sd->vtype&ST_LINKED) { print_scan_err("Error: %s appears in multiple linkage groups\n",sd->name); scan_error|=LINK_ERR; } else { for(j=0;jn_elements;j++) { element=sd->element+j; element->type|=ST_LINKED; l1->element[i++]=element; } sd->vtype|=ST_LINKED; } } } else { element=sd->element; if(element->type&ST_LINKED) { print_scan_err("Error: %s appears in multiple linkage groups\n",sd->name); scan_error|=LINK_ERR; } element->type|=ST_LINKED; l1->element[i++]=element; } vlist1=vlist->next; free(vlist); vlist=vlist1; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_missing_com" static void do_missing_com(struct express *expr,struct var_list *vlist,char *s1) { struct var_list *vlist1; struct scan_data *sd; struct var_element **elem; struct Miss *m; int i,j; char *p; if(s1) { if(vlist) ABT_FUNC("Can't have both explicit and implicit scope\n"); if(s1[0]==0) { print_scan_err("Empty scope - MISSING directive ignored\n"); if(expr->type==ST_STRING) free(expr->arg.string); free(s1); return; } qstrip(s1); p=s1; i=j=0; while(*p) { switch(toupper((int)*p)) { case '!': case 'F': case 'G': case 'P': case 'C': case 'R': case 'I': break; default: i=1; } if(i) break; p++; } if(*p) { j=1; print_scan_err("Illegal character '%c' in MISSING scope\n",*p); } else if(*(--p)=='!') { j=1; print_scan_err("MISSING scope can not end with a '!'\n",*p); } if(j) { free(s1); if(expr->type==ST_STRING) free(expr->arg.string); return; } } m=Miss; if(!(Miss=malloc(sizeof(struct Miss)))) ABT_FUNC(MMsg); Miss->Missing.arg=expr->arg; Miss->Missing.type=expr->type; Miss->next=m; Miss->element=0; Miss->scope=0; if((i=count_var_list(vlist))) { if(!(elem=malloc(sizeof(void *)*i))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) elem[i++]=sd->element+vlist->index-1; else for(j=0;jn_elements;j++) elem[i++]=sd->element+j; } else elem[i++]=sd->element; Miss->element=elem; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else if(s1) Miss->scope=s1; Miss->nvar=i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_model_com" static void do_model_com(struct model_list *mlist,struct bin_node *node,struct express *express) { struct model *model,*model1; struct var_element *element; struct scan_data *sd; sd=node->data; if(!(model=malloc(sizeof(struct model)))) ABT_FUNC(MMsg); model->next=0; if(Models) { model1=Models; while(model1->next) model1=model1->next; model1->next=model; } else Models=model; model->trait=sd; if(!express) { model->index=0; sd->element[0].type|=ST_TRAIT; } else { element=get_element(node,express); if(element) { model->index=(int)express->arg.value; element->index=element->oindex=model->index; element->type|=ST_TRAIT; } else model->trait=0; } model->model_list=mlist; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_censored" static void add_censored(struct var_element *element,const int fg) { struct operation *ops,*ops1,*ops2; struct Censor *cen; if(fg==1 && !element) { print_scan_err("Error: Nothing to censor!\n"); return; } ops=Op_List; /* Reverse list order (really return list to original order! */ if(ops) { ops1=ops->next; while(ops1) { ops2=ops1->next; ops1->next=ops; ops=ops1; ops1=ops2; } Op_List->next=0; Op_List=ops; } switch(fg) { case 1: if(!(cen=malloc(sizeof(struct Censor)))) ABT_FUNC(MMsg); cen->next=Censored; Censored=cen; cen->Op_List=ops; cen->element=element; element->type|=ST_CENSORED; break; case 0: if(Affected) print_scan_warn("Warning - new affected statement overrules previous statement\n"); Affected=ops; break; case 2: if(Unaffected) print_scan_warn("Warning - new unaffected statement overrules previous statement\n"); Unaffected=ops; break; } ops=Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_RESTRICT; ops=ops->next; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_restriction" static void add_restriction(struct var_list *vlist) { struct operation *ops,*ops1,*ops2; struct Restrict *res; struct var_list *vlist1; struct scan_data *sd; int i,j; ops=Op_List; /* Reverse list order (really return list to original order! */ if(ops) { ops1=ops->next; while(ops1) { ops2=ops1->next; ops1->next=ops; ops=ops1; ops1=ops2; } Op_List->next=0; Op_List=ops; } if(!(res=malloc(sizeof(struct Restrict)))) ABT_FUNC(MMsg); res->next=Restrictions; Restrictions=res; res->Op_List=ops; if((res->nvar=count_var_list(vlist))) { if(!(res->element=malloc(sizeof(void *)*res->nvar))) ABT_FUNC(MMsg); i=0; while(vlist) { sd=vlist->var->data; if(sd->vtype&ST_ARRAY) { if(vlist->index) res->element[i++]=sd->element+vlist->index-1; else for(j=0;jn_elements;j++) res->element[i++]=sd->element+j; } else res->element[i++]=sd->element; vlist1=vlist->next; free(vlist); vlist=vlist1; } } else res->element=0; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_RESTRICT; ops=ops->next; } } static void find_markers(struct bin_node *node,int *i) { int j; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) if(sd->element[j].type&ST_MARKER) { markers[*i].element=sd->element+j; markers[*i].var=sd; markers[(*i)++].index=j+1; } } static void find_trait_loci(struct bin_node *node,int *i) { int j; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) if(sd->element[j].type&ST_TRAITLOCUS) { if(traitlocus) { traitlocus[*i].element=sd->element+j; traitlocus[*i].var=sd; traitlocus[(*i)].index=j+1; } (*i)++; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_haplo" static void find_haplo(struct bin_node *node) { int j,k; struct scan_data *sd; sd=node->data; for(k=0;kn_elements;k++) if(sd->element[k].type&ST_HAPLO) { for(j=0;jelement[k].arg.element==markers[j].element) { if(!markers[j].hap_element[0]) markers[j].hap_element[0]=sd->element+k; else if(!markers[j].hap_element[1]) markers[j].hap_element[1]=sd->element+k; else { if(markers[j].index) print_scan_err("Error: marker %s(%d) has >2 haplotype vectors associated with it\n",markers[j].var->name,markers[j].index); else print_scan_err("Error: marker %s has >2 haplotype vectors associated with it\n",markers[j].var->name); } break; } if(j==n_markers) ABT_FUNC("Internal error: can not find marker for haplotype vector\n"); } } static void strip_names(struct bin_node *node) { char *p; int i; struct scan_data *sd; sd=node->data; if((p=sd->name)) { i=strlen(p); if(i>2) { if(p[i-1]=='_' && p[i-2]=='_') p[i-2]=0; } } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "ReadControl" int ReadControl(FILE *fptr,char *cname,char **lfile) { int i,j,k; void yy_cleanup(void); struct InFile *infile,**infile_p; struct Restrict *res,*res1,**res_p; struct Censor *cen,**cen_p; struct var_element *elem; struct Link *linkp; struct operation *ops; struct express tmp_expr; yyin=fptr; fname_list[0]=cname; list_ptr=0; if(!(f_atom_list=malloc(sizeof(struct format_atom)*f_atom_size))) ABT_FUNC(MMsg); for(i=0;itype&ST_INTTYPE) break; if(i<3) for(i=0;i<3;i++) pedlist[i+family_id]->type|=ST_INTTYPE; } if(root_var) Check_var(root_var); /* Flag variables used as the operands to a restriction statement *whose result is used* as ST_REQUIRED */ res=0; while(res!=Restrictions) { res1=Restrictions; while(res1->next!=res) res1=res1->next; for(i=j=0;invar;i++) if(res1->element[i]->type&ST_REQUIRED) { j=1; break; } if(!res1->nvar || j) { ops=res1->Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } res=res1; } /* Delete restrict structures that are not used */ res=Restrictions; res_p= &Restrictions; while(res) { for(i=j=0;invar;i++) if(res->element[i]->type&ST_REQUIRED) { j=1; break; } if(res->nvar && !j) { *res_p=res->next; free_restrict(res); res= *res_p; } else { res_p= &res->next; res=res->next; } } if(Unaffected && !Affected) print_scan_err("Error: Unaffected definition without affected definition\n"); /* Flag variables used in censored statements as required. Delete unused censored statements */ cen=Censored; cen_p= &Censored; while(cen) { if(cen->element->type&ST_TRAIT) { ops=cen->Op_List; while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } cen_p= &cen->next; cen=cen->next; } else { *cen_p=cen->next; free_op(cen->Op_List); free(cen); cen= *cen_p; } } if((ops=Affected)) { while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } if((ops=Unaffected)) { while(ops) { if(ops->type==VARIABLE) ops->arg.element->type|=ST_REQUIRED; ops=ops->next; } } /* Check file structures - remove ones that aren't needed */ infile=Infiles; infile_p= &Infiles; while(infile) { infile->ncol=0; for(i=0;invar;i++) { elem=infile->element[i]; if(elem) elem->type&=~ST_FLAG; } for(i=j=0;invar;i++) { elem=infile->element[i]; if(elem && elem->type&ST_REQUIRED) { if(elem->type&ST_FLAG) { print_scan_err("Error: Duplicate variables for file %s\n",infile->name); break; } elem->type|=ST_FLAG; if(elem->type&ST_ID) { j|=1; infile->id_col=infile->ncol; } else if(elem->type&ST_FAMILY) { j|=2; infile->family_col=infile->ncol; } infile->ncol++; } else infile->element[i]=0; } for(i=0;invar;i++) if(infile->element[i]) infile->element[i]->type&=~ST_FLAG; if(!(j&1)) print_scan_err("Error: No id column for file %s\n",infile->name); else if(family_id && j!=3) print_scan_err("Error: No family column for file %s\n",infile->name); if(infile->ncol==1) { *infile_p=infile->next; free_infile(infile); infile= *infile_p; } else { infile_p= &infile->next; infile=infile->next; } } if(!Infiles) print_scan_err("Error: No input files with data\n"); free(f_atom_list); /* Count markers and link up with haplotype vectors */ if(n_markers) { if(!(markers=calloc((size_t)n_markers,sizeof(struct Marker)))) ABT_FUNC(MMsg); for(i=0;in_loci;k++) { if(linkp->element[k]==markers[i].element) { markers[i].link=j; break; } } if(kn_loci) break; linkp=linkp->next; } if(!linkp) { if(markers[i].var->vtype&ST_ARRAY) abt(__FILE__,__LINE__,"%s(): No linkage group specified for candidate gene %s(%d)\n",FUNC_NAME,markers[i].var->name,markers[i].index); else abt(__FILE__,__LINE__,"%s(): No linkage group specified for candidate gene %s\n",FUNC_NAME,markers[i].var->name); } if(markers[i].hap_element[0]) { if(markers[i].element->type&ST_DATA) { if(markers[i].var->vtype&ST_ARRAY) print_scan_err("Error: marker variable %s(%d) can not have both genotype and haplotype data\n",markers[i].var->name,markers[i].index); else print_scan_err("Error: marker variable %s can not have both genotype and haplotype data\n",markers[i].var->name); } if(markers[i].hap_element[0]->type&ST_INTTYPE) markers[i].hap_element[1]->type|=ST_INTTYPE; if(markers[i].hap_element[1] && markers[i].hap_element[1]->type&ST_INTTYPE) markers[i].hap_element[0]->type|=ST_INTTYPE; } else { if(!(markers[i].element->type&ST_DATA)) { if(markers[i].var->vtype&ST_ARRAY) print_scan_err("Error: marker variable %s(%d) has no data\n",markers[i].var->name,markers[i].index); else print_scan_err("Error: marker variable %s has no data\n",markers[i].var->name); } } } } i=0; if(root_var) check_vars(root_var,&i,find_trait_loci); if(i) { if(i>1) print_scan_err("Error: multiple trait loci indicated\n"); else { if(!(traitlocus=calloc(1,sizeof(struct Marker)))) ABT_FUNC(MMsg); traitlocus->order=0; traitlocus->o_size=0; i=0; check_vars(root_var,&i,find_trait_loci); } } if(Models && Models->next && !syst_var[MULTIVARIATE_TEST]) { print_scan_err("Error: Multiple models not currently supported\n"); } } *lfile=LogFile; if(!scan_error_n && !Miss && !syst_var[NO_DEFAULT_MISSING]) { tmp_expr.arg.string=strdup("0"); tmp_expr.type=ST_STRING; do_missing_com(&tmp_expr,0,strdup("PF")); } return scan_error_n; } loki/prepsrc/gen_elim.c0100644000076500007650000022316007750231157014407 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * prep_check.c: * * * * (1) Use pattern of marker data to prune the pedigree and split it into * * components on a marker by marker basis. * * * * (2) Recode unused alleles in each component * * * * (3) Perform genotype elimination. * * * * (4) Perform set recoding a la O'Connell & Weeks * * * * (5) Determine a peeling sequence * * * * (6) Perform 'logical peeling' to check genotype consistency and * * allow optimizations for later peeling runs * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include #include #ifdef HAVE_LIMITS_H #include #endif #include "utils.h" #include "libhdr.h" #include "scan.h" #include "control_parse.h" #include "prep_peel.h" #include "min_deg.h" #include "prep_utils.h" extern int catch_sigs,sig_caught; static int *allele_trans,bad_cnt,rec_gen_flag,ge_option; static int *perm,id,*famflag,r_func_size,n_rfuncs,*involved,*prev_inv,*true_involved,*rf_flag; static int no_peel_flag,n_prev_inv,silent_flag,n_all_old; static lk_ulong *temp_set,*id_set[2],mask,**all_set,*req_set[3]; static struct R_Func *r_func; static char *marker_name; static struct Peelseq_Head peelseq_head; int trace_peel; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "FlagFam" static void FlagFam(const int fam) { int j,k,l,ids,idd; ids=family[fam].sire; idd=family[fam].dam; if(!ids) ABT_FUNC("Internal error - fix me\n"); j=id_array[ids-1].family; if(j) famflag[j-1]|=1; for(k=0;ktype==STRING) (void)fputs(factor_recode[n_factors+locus][ch]->data.string,fptr); else (void)fprintf(fptr,"%ld",factor_recode[n_factors+locus][ch]->data.value); } else (void)fputc('*',fptr); if(fg) break; if(!i) (void)fputc(',',fptr); } } else { if(fg) (void)fputc('*',fptr); else (void)fputs("*,*",fptr); } } void print_rec_all(FILE *fptr, int ch,const int locus) { ch=allele_trans[ch]; if(ch== -1) (void)fputs("__LUMP__",fptr); else { if(factor_recode[n_factors+locus][ch]->type==STRING) (void)fputs(factor_recode[n_factors+locus][ch]->data.string,fptr); else (void)fprintf(fptr,"%ld",factor_recode[n_factors+locus][ch]->data.value); } } static void print_code_rec_all(FILE *fptr,int ch,lk_ulong a,int locus) { int l,k; if(a&(LK_ONE<>=1; }; (void)fputc(']',fptr); } else print_rec_all(fptr,ch,locus); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "print_alls" static void print_alls(FILE *fptr,const int i,const int locus,const int n_all,const int linktype,const int flag) { int j,k,k1,l,fg=0; lk_ulong a,*b,m; if(!(b=calloc(n_all,sizeof(lk_ulong)))) ABT_FUNC(MMsg); j=ped_recode1[i-1]-1-id; if(linktype==LINK_Y || (linktype==LINK_X && id_array[i-1].sex==1)) fg=1; m=(LK_ONE<>=1; } } else if(linktype==LINK_X && id_array[i-1].sex==1) { for(k=0;k>=1; } } for(l=0;l ",stderr); print_orig_id1(stderr,++kid,0); (void)fputs(" [",stderr); print_orig_alleles(stderr,kid,locus,linktype); (void)fputs("]\n ",stderr); print_alls(stderr,kid,locus,n_all,linktype,flag); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "DoFamily" static int DoFamily(const int fam,const int n_all,const int locus,const int linktype) { int i,j,k,k1,l,m,ids,idd,nc=0,fg,kid,change=0; int nkids,*tmp,nmc; lk_ulong a,a1,b,b1,c,cm,cm1,*t_all1,*t_all2; static int *kids,*m_set1,*m_set2,max_kids,max_k,max_mc; static lk_ulong *ccm,*ccm1,*tt_all; if(fam<0) { if(kids) free(kids); if(tt_all) free(tt_all); if(m_set1) free(m_set1); return 0; } ids=family[fam].sire; if(!ids) { famflag[fam]&=~1; return 0; } tmp=family[fam].kids; j=family[fam].nkids; ids=ped_recode1[ids-1]-1-id; idd=ped_recode1[family[fam].dam-1]-1-id; nkids=0; k=j*n_all+2*j; if(j>max_kids) { max_kids=j; if(kids) { if(!(kids=realloc(kids,sizeof(int)*j))) ABT_FUNC(MMsg); } else { if(!(kids=malloc(sizeof(int)*j))) ABT_FUNC(MMsg); } } if(k>max_k) { max_k=k; if(tt_all) { if(!(tt_all=realloc(tt_all,sizeof(lk_ulong)*k))) ABT_FUNC(MMsg); } else { if(!(tt_all=malloc(sizeof(lk_ulong)*k))) ABT_FUNC(MMsg); } } k=n_all*n_all; if(k>max_mc) { max_mc=k; if(m_set1) { if(!(m_set1=realloc(m_set1,sizeof(int)*k*2))) ABT_FUNC(MMsg); } else { if(!(m_set1=malloc(sizeof(int)*k*2))) ABT_FUNC(MMsg); } } m_set2=m_set1+k; ccm=tt_all+j*n_all; ccm1=ccm+j; t_all1=tt_all; for(i=0;i>=1; l++; a1<<=1; } } switch(nkids) { case 1: for(a1=LK_ONE,i=0;i>=1; j++; b1<<=1; } } break; case 2: t_all1=tt_all+n_all; for(a1=1,i=0;i>=1; j++; b1<<=1; } } break; case 3: t_all1=tt_all+n_all; t_all2=t_all1+n_all; for(a1=LK_ONE,i=0;i>=1; j++; b1<<=1; } } break; default: for(a1=LK_ONE,i=0;i>=1; j++; b1<<=1; } } } } else if(linktype==LINK_X) { for(i=0;ik && (all_set[l][idd]&(LK_ONE<2) ABT_FUNC("Internal error - illegal sex\n"); if(linktype!=LINK_AUTO && !sex) ABT_FUNC("Internal error - unknown sex with sex-linked locus\n"); if(linktype==LINK_Y) { if(sex==1) j=1; else j=0; } else if(sex==2 || linktype==LINK_AUTO) j=2; else j=1; if((id_array[i].flag&HAP_JNT)||(j==2&&(id_array[i].flag&HAP_DAT))) { rf_flag[n_inv]=0; involved[n_inv++]= -i1; } if(mflag) { /* Put in parents */ if(id_array[i].flag&HAP_P) { if(linktype==LINK_AUTO) { add_to_involved(id_array[i].sire,&n_inv,0); add_to_involved(-id_array[i].sire,&n_inv,0); } else if(linktype==LINK_X) add_to_involved(id_array[i].sire,&n_inv,0); else add_to_involved(-id_array[i].sire,&n_inv,0); if(flag) id_array[i].flag|=HAD_P; } } else { if(id_array[i].flag&HAP_M) { add_to_involved(id_array[i].dam,&n_inv,0); add_to_involved(-id_array[i].dam,&n_inv,0); if(flag) id_array[i].flag|=HAD_M; } } for(j=0;j(int)LK_LONG_BIT) { #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL2)) (void)fputs("Splitting op as n_peel getting too big\n",stdout); #endif n_ops=0; } } if(n_inv && n_ops>=0) { n_peel=n_inv; for(k=0;ktype=PEEL_COMPLEX; pp->ptr.complex=element; pp= &element->next; pp->type=0; element->n_peel=n_peel; element->n_involved=n_inv; for(n_rf=k=0;kn_rfuncs=n_rf; if(!(element->involved=malloc(sizeof(int)*(n_inv*2+n_rf)))) ABT_FUNC(MMsg); element->flags=element->involved+n_inv; element->index=element->flags+n_inv; if(n_peel==n_inv) { free(r_func[k1].id_list); n_rfuncs--; k1= -1; } element->out_index=k1; for(k=0;kflags[k]=0; for(k=0;k0) { element->flags[k]|=id_array[l-1].flag&HAD_M; id_array[l-1].flag&=~HAD_M; } else { element->flags[k]|=id_array[-1-l].flag&HAD_P; id_array[-l-1].flag&=~HAD_P; } } for(j=0;jinvolved[j]=true_involved[j]; /* Make list of R-Functions involved in operation */ for(n_rf=k=0;kflags[j]|=IN_RF; } element->index[n_rf++]=k; r_func[k].flag=2; } for(k=0;kflags[j]|=HAP_JNT; element->flags[k]|=HAP_JNT; } break; } } if(!no_peel_flag) { if(do_peel_op(element,r_func,n_all,id,all_set,req_set)) { if(silent_flag) { k1=abs(element->involved[0])-1; err=id_array[k1].family+1; } else { fputs("Zero probability during peeling operation with genes:\n",stderr); for(k=0;kn_involved;k++) { fputs(" ",stderr); print_orig_allele_id(stderr,element->involved[k]); fputc('\n',stderr); } ABT_FUNC("Aborting\n"); } } } else { k1=element->out_index; if(k1>=0) for(k=0;kn_rfuncs;k++) { k1=element->index[k]; if(r_func[k1].index) free(r_func[k1].index); } n_inv=0; n_prev_inv=0; } if(!pivot || err) break; j=pivot-1; pivot=g_perm[j]; n_ops=count_ops(pivot,1,linktype); if(!n_inv) { if(n_rfuncs>=r_func_size) { r_func_size<<=1; if(!(r_func=realloc(r_func,sizeof(struct R_Func)*r_func_size))) ABT_FUNC(MMsg); } k1=n_rfuncs++; if(!(r_func[k1].id_list=malloc(sizeof(int)*(1+n_ops)))) ABT_FUNC(MMsg); r_func[k1].n_ind=n_ops; r_func[k1].flag=0; r_func[k1].n_terms=0; r_func[k1].index=0; for(k=1;k<=n_ops;k++) r_func[k1].id_list[k-1]=involved[k]; } else if(n_inv) { for(k=0;k2) ABT_FUNC("Internal error - illegal sex\n"); if(linktype!=LINK_AUTO && !sex) ABT_FUNC("Internal error - unknown sex with sex-linked locus\n"); add_to_involved(i1,&n_inv,0); /* How many genes to add for this individual (may depend on sex) */ if(linktype==LINK_Y) { if(sex==1) ng=1; else ng=0; } else if(sex==2 || linktype==LINK_AUTO) ng=2; else ng=1; if((id_array[i].flag&HAP_JNT)||(ng==2 &&(id_array[i].flag&HAP_DAT))) add_to_involved(-i1,&n_inv,0); if(i1<0) { /* Put in parents */ if(id_array[i].flag&HAP_P) { if(linktype==LINK_AUTO) { /* Add in sire's alleles */ add_to_involved(id_array[i].sire,&n_inv,0); add_to_involved(-id_array[i].sire,&n_inv,0); } else if(linktype==LINK_X) { if(sex==1) ABT_FUNC("Internal error - father-male offspring link for X-linked locus\n"); /* Add in sire's maternal allele */ add_to_involved(id_array[i].sire,&n_inv,0); } else { /* Y-Linked */ if(sex==2) ABT_FUNC("Internal error - father-female offspring link for Y-linked locus\n"); /* Add in sire's paternal allele */ add_to_involved(-id_array[i].sire,&n_inv,0); } } } else { if(id_array[i].flag&HAP_M) { if(linktype==LINK_Y) ABT_FUNC("Internal error - mother-offspring link for Y-linked locus\n"); else { /* Add in dam's alleles */ add_to_involved(id_array[i].dam,&n_inv,0); add_to_involved(-id_array[i].dam,&n_inv,0); } } } for(j=0;jk1) k1=i1; } k2= -k2; k1+=k2+1; if(!(trans=malloc(sizeof(int)*k1))) ABT_FUNC(MMsg); for(x=0;x0) { wt[x]=log((double)id_array[i1-1].nhaps[X_MAT]); k1=trans[k2-i1]; if(k1>=0) { wt1[x].pair_node=k1; wt1[k1].pair_node=x; wt1[x].wt=wt1[k1].wt=log((double)id_array[i1-1].ngens); } } else wt[x]=log((double)id_array[-1-i1].nhaps[X_PAT]); } } else { z=log(2.0); for(x=0;x n_genes = %d\n",n_genes); #endif if(!(involved=malloc(sizeof(struct R_Func)*n_genes*6))) ABT_FUNC(MMsg); n_prev_inv=0; prev_inv=involved+n_genes; true_involved=prev_inv+n_genes; rf_flag=true_involved+n_genes; g_perm=rf_flag+n_genes; order1=g_perm+n_genes; n_genes=0; for(j=0;j=r_func_size) { r_func_size<<=1; if(!(r_func=realloc(r_func,sizeof(struct R_Func)*r_func_size))) ABT_FUNC(MMsg); } k=n_rfuncs++; if(!(r_func[k].id_list=malloc(sizeof(int)*2))) ABT_FUNC(MMsg); r_func[k].id_list[0]=pivot; r_func[k].id_list[1]= -pivot; r_func[k].n_ind=2; r_func[k].flag=0; r_func[k].mask=0; r_func[k].peel_elem=pp; piv1=ped_recode1[pivot-1]-1-id; for(k1=k2=0;k2type=PEEL_SIMPLE; pp->ptr.simple=element; pp= &element->next; pp->type=0; element->sire=element->dam=element->pivot=0; element->out_index= -1; if(!(element->off=malloc(sizeof(int)*k))) ABT_FUNC(MMsg); for(k=j=0;joff[k++]=i+1; } element->n_off=k; } nfx=nunfx=nfx1=nunfx1=0; for(j=0;j>=1; } } k2=0; id_array[i].nhaps[X_MAT]=k1; req_set[2][j]=b; while(b) { if(b&1) k2++; b>>=1; } if(k1==1 && k2==1) { id_array[i].flag|=IS_FIXED; } id_array[i].nhaps[X_PAT]=k2; id_array[i].ngens=k3; id_array[i].ngens1=k4; id_array[i].sg[X_MAT]=id_array[i].sg[X_PAT]=-1; if(k1==1) nfx++; else nunfx++; if(k2==1) nfx++; else nunfx++; if((ids=id_array[i].sire) && !(id_array[ids-1].flag&IS_PRUNED)) { ids=ped_recode1[ids-1]-1-id; a=req_set[X_PAT][j]; b=1; k1=k2=0; for(k=0;k Beginning primary family peel (nf = %d)\n",nf); #endif if(!k1) for(i=0;i1) pivot=ids; if(id_array[idd-1].order>1) { if(pivot) pivot= -2; else pivot=idd; } } for(j=0;j1) break; } else if(id_array[kid].order>1) { if(pivot) break; pivot=kid+1; } } if(j==family[fam].nkids) { if(pivot>=0 || !(syst_var[PEEL_OPTION]&4)) { if(!(element=malloc(sizeof(struct Simple_Element)))) ABT_FUNC(MMsg); pp1=pp; pp->type=PEEL_SIMPLE; pp->ptr.simple=element; pp= &element->next; pp->type=0; element->sire=ids; element->dam=idd; if(ids && ids!=pivot && pivot>=0) id_array[ids-1].flag|=PEELED; if(idd && idd!=pivot && pivot>=0) id_array[idd-1].flag|=PEELED; element->pivot=pivot; if((k=id_array[ids-1].rf_idx)>=0) { r_func[k].flag=2; free(r_func[k].index); } if((k=id_array[idd-1].rf_idx)>=0) { r_func[k].flag=2; free(r_func[k].index); } for(j=0;j=0) { r_func[k].flag=2; free(r_func[k].index); } } #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL2)) { (void)fputs("--> Peeling family: ",stdout); if(family_id) print_orig_family(stdout,family[fam].kids[0]+1,0); print_orig_id1(stdout,ids,0); (void)fputc(',',stdout); print_orig_id1(stdout,idd,0); (void)fputc(' ',stdout); for(j=k=0;j ",stdout); if(pivot<0) { print_orig_id1(stdout,ids,0); (void)fputc(',',stdout); print_orig_id1(stdout,idd,0); } else if(!pivot) (void)fputc('.',stdout); else print_orig_id1(stdout,pivot,0); (void)fputc('\n',stdout); } #endif if(pivot) { element->out_index=n_rfuncs; /* Peel to both parents separately - only if all children are fixed */ if(pivot<0) { id_array[ids-1].flag|=WAS_PIVOT; id_array[idd-1].flag|=WAS_PIVOT; id_array[ids-1].order--; id_array[idd-1].order--; id_array[ids-1].rf_idx=n_rfuncs; fill_rf(ids,n_all,n_bits,pp); id_array[idd-1].rf_idx=n_rfuncs; fill_rf(idd,n_all,n_bits,pp); } else { /* Peel normally to a single pivot */ id_array[pivot-1].flag|=WAS_PIVOT; id_array[pivot-1].order--; id_array[pivot-1].rf_idx=n_rfuncs; fill_rf(pivot,n_all,n_bits,pp); } } else element->out_index= -1; if(!(element->off=malloc(sizeof(int)*family[fam].nkids))) ABT_FUNC(MMsg); for(j=k=0;joff[k++]=kid+1; if((kid+1)!=pivot) id_array[kid].flag|=PEELED; } element->n_off=k; famlist[i]=famlist[--nf]; i= -1; } } } if(nf) { /* if(0) joint_peel(nf,famlist,n_all,pp,locus,comp,linktype); */ return find_sequence(nf,famlist,n_all,pp,locus,comp,linktype); } else if(!silent_flag) { if(locusn_levels) j++; if(!j && !traitlocus) { (void)unlink(*fname); free(*fname); return 0; } if(Filter) { i=child_open(WRITE,*fname,Filter); if(!(fptr=fdopen(i,"w"))) DataFileError(*fname); if(errno && errno!=ESPIPE) DataFileError(*fname); errno=0; } else if(!(fptr=fopen(*fname,"w"))) abt(__FILE__,__LINE__,"%s(): File Error. Couldn't open '%s' for writing\n",FUNC_NAME,*fname); if(fprintf(fptr,"Loki.gen:%x,%x,%x,%x\n",RunID,j,n_comp,syst_var[NO_EXTRA_ALLELE])<0) DataFileError(*fname); return fptr; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "write_recoding_info" static void write_recoding_info(FILE *fptr,char *fname,int comp,int n_all,int n_all1,int fg) { int i,j,k; for(k=j=0;ktype) { if(pp->type==PEEL_SIMPLE) { simple_em=pp->ptr.simple; if(simple_em->sire) { simple_em->sire=ped_recode1[simple_em->sire-1]; simple_em->dam=ped_recode1[simple_em->dam-1]; } if(simple_em->pivot>0) simple_em->pivot=ped_recode1[simple_em->pivot-1]; if(fprintf(fptr,"%x,%x,%x,%x,%d,%d",pp->type,simple_em->sire,simple_em->dam, simple_em->n_off,simple_em->pivot,simple_em->out_index)<0) DataFileError(fname); i=simple_em->n_off; for(j=0;joff[j]=ped_recode1[simple_em->off[j]-1]; if(fprintf(fptr,",%x",simple_em->off[j])<0) DataFileError(fname); } pp= &simple_em->next; } else { complex_em=pp->ptr.complex; if(fprintf(fptr,"%x,%x,%x,%d,%x",pp->type,complex_em->n_peel,complex_em->n_involved, complex_em->out_index,complex_em->n_rfuncs)<0) DataFileError(fname); i=complex_em->n_involved; for(j=0;jinvolved[j]; if(k>0) k=ped_recode1[k-1]; else k= -ped_recode1[-1-k]; complex_em->involved[j]=k; if(fprintf(fptr,",%d",complex_em->involved[j])<0) DataFileError(fname); } i=complex_em->n_involved*2+complex_em->n_rfuncs; for(;jinvolved[j])<0) DataFileError(fname); pp= &complex_em->next; } if(fputc('\n',fptr)==EOF) DataFileError(fname); } if(fprintf(fptr,"0,%x\n",n_rfuncs)<0) DataFileError(fname); for(j=0;jn_levels; if(silent_flag!=1 && n_all) { if(!(tmp=calloc((size_t)(n_all*2),sizeof(int)))) ABT_FUNC(MMsg); tmp1=tmp+n_all; for(i=0;in_levels=n_all=k1; for(i=0;iallele_trans=malloc(sizeof(void *)*n_comp))) ABT_FUNC(MMsg); if(!(mark->allele_trans[0]=malloc(sizeof(int)*n_comp*n_all))) ABT_FUNC(MMsg); for(i=1;iallele_trans[i]=mark->allele_trans[i-1]+n_all; } mark->order=0; no_peel_flag=(locus==n_markers); if(silent_flag!=1) if(fprintf(fptr,"LKMK:%x\n",n_all)<0) DataFileError(fname); /* First thing to do is to prune pedigree based on data at this marker. * Remove: * (a) Untyped individuals with no unpruned descendents * (b) Untyped founders with only 1 unpruned child */ for(i=0;itype&ST_MODEL)) for(j=0;jtype&ST_TRAIT) && id_array[i].data[k].flag) { id_array[i].flag|=(HAS_DATA|HAS_GDATA); break; } } if(!id_array[i].flag && id_array[i].data1) for(k1=0;k1type&ST_TRAIT) && id_array[i].data1[k1][k].flag) { id_array[i].flag|=(HAS_DATA|HAS_GDATA); break; } } } nfam[i]=id_array[i].nfam; } if(syst_var[PRUNE_OPTION]==2) do { for(fg=i=0;i0) { for(;compallele_trans[comp]; else allele_trans=all_trans; if(locustype&ST_MODEL) && syst_var[RECODE_OPTION]) { /* Find out which alleles are used in this component */ for(i=0;in_all) n_all1=n_all; } else n_all1=n_all; if(n_all1markers[locus].element->n_levels) allele_trans[n_all-1]= -1; /* While all_flag will (temporarily) have the translation table from the * old codes to the new codes */ for(i=0;i=0) all_flag[j]=i; if((size_t)n_all1>LK_LONG_BIT) abt(__FILE__,__LINE__,"%s(): No. segregating alleles for marker %s exceeds %d\n",FUNC_NAME,markers[locus].var->name,LK_LONG_BIT); /* Use all_flag to recode haplotypes */ if(n_all1type&ST_MODEL)) { /* Find required allele set for each individual (used for set recoding */ for(j=comp_size[comp]-1;j>=0;j--) { i=perm[j+id]; sex=id_array[i].sex; req_set[0][j]=req_set[1][j]=0; if(id_array[i].flag&IS_PRUNED) continue; if(linktype==LINK_Y && sex==2) continue; if(id_array[i].flag&HAS_GDATA) { if(id_array[i].haplo[0]) { ch[0]=id_array[i].haplo[0][locus]; ch[1]=id_array[i].haplo[1][locus]; } else ch[0]=ch[1]=0; if(linktype==LINK_Y || (linktype==LINK_X && sex==1)) { if(ch[0]) { req_set[linktype==LINK_Y?X_PAT:X_MAT][j]|=LK_ONE<<(ch[0]-1); continue; } } else { if(ch[0]) { for(k=0;k<2;k++) if(ch[k]) { m1=LK_ONE<<(ch[k]-1); if(all_set[ch[k]-1][j]) req_set[X_MAT][j]|=m1; for(k1=0;k11 possible but unrequired maternal alleles which can * be lumped into allele km */ k1=km=0; if(linktype!=LINK_Y) { a=req_set[X_MAT][j]; while(a) { k1++; if(a&1) km=k1; a>>=1; if(km) break; } if(!a) { km=0; req_set[X_MAT][j]=0; } } /* Ditto for paternal alleles */ k1=kp=0; if(linktype!=LINK_X || sex==2) { a=req_set[X_PAT][j]; while(a) { k1++; if(a&1) kp=k1; a>>=1; if(kp) break; } if(!a) { kp=0; req_set[X_PAT][j]=0; } } /* Lump together possible sets for unused alleles, zero remainder */ if(km || kp) { if(km) { for(b=0,k1=0;k1=0;j--) { i=perm[j+id]; req_set[0][j]=req_set[1][j]=0; } } err=logical_peel(n_fam,famlist,n_all1,locus,comp,linktype,silent_flag==1?0:lfptr); free_hash_blocks(); if(!err && silent_flag!=1) write_peeling_info(fptr,fname); for(k=0;kallele_trans[0]); free(mark->allele_trans); mark->allele_trans=0; } if(ferr) (void)fclose(ferr); if(fname1) free(fname1); return err; } #ifdef FUNC_NAME # undef FUNC_NAME #endif #define FUNC_NAME "Genotype_Elimination" int Genotype_Elimination(int check_flag,char *lfile,int error_check) { FILE *fptr,*fptr1,*flog,*ferr,*lfptr=0; char *fname,*fname1; int i,j,j1,ids,idd,locus,*bk[2],k,k1,k2,k3,k4,sc,fam1,fam,*tlist,*fam_list,linktype,*blank=0,comp; char bf[256],bf1[256],bf2[256],bf3[256]; struct Link *pl; errno=0; if(!error_check) check_flag=0; ge_option=error_check; trace_peel=syst_var[PEEL_TRACE]; fptr=write_gene_file_header(&fname); if(!fptr) return 0; if(check_flag) { if(!(bk[0]=malloc(sizeof(int)*2*pruned_ped_size))) ABT_FUNC(MMsg); bk[1]=bk[0]+pruned_ped_size; if(!(blank=malloc(sizeof(int)*pruned_ped_size))) ABT_FUNC(MMsg); } if(!(perm=malloc(sizeof(int)*(n_families+2*pruned_ped_size)))) ABT_FUNC(MMsg); tlist=perm+pruned_ped_size; fam_list=tlist+pruned_ped_size; for(i=0;in_levels) continue; pl=links; i=markers[locus].link-1; while(i && pl) { pl=pl->next; i--; } if(!pl) ABT_FUNC("Invalid linkage group\n"); linktype=pl->type; } else linktype=LINK_AUTO; ferr=0; fname1=0; marker_name=get_marker_name(locus); if(locus==n_markers) (void)printf("Processing trait locus '%s'\n",marker_name); else (void)printf("Processing marker '%s' (no. alleles = %d)\n",marker_name,markers[locus].element->n_levels); if(!check_flag || locus==n_markers) { silent_flag=0; (void)Check_Locus(locus,fptr,fname,0,linktype,lfptr); } else if(check_flag) { for(j=0;j=0) { i=perm[j]; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=bk[k][j]; } } markers[locus].element->n_levels=n_all_old; if(fam<0) ABT_FUNC(AbMsg); (void)fputs("Genotype inconsistency - searching for errors\n",stderr); if(!(fname1=get_errfile(marker_name,0))) ABT_FUNC(MMsg); if((ferr=fopen(fname1,"r"))) { k1=0; (void)fprintf(stderr,"Reading 'bad' individuals from %s\n",fname1); for(;;) { if(family_id) { i=fscanf(ferr,"%255s %255s %255s %255s",bf3,bf,bf1,bf2); if(i!=4) break; j=family_recode[0]->type; j1=find_id_code(bf3,j,-1); } else { i=fscanf(ferr,"%255s %255s %255s",bf,bf1,bf2); if(i!=3) break; j1=0; } j=ped_recode[0]->type; i=find_id_code(bf,j,j1); ids=find_id_code(bf1,j,j1); idd=find_id_code(bf2,j,j1); if(i<1 || id<0 || ids<0) { k1=1; break; } j=ped_recode1[i-1]; if(!j || blank[j-1]== -1) { k1=1; (void)fprintf(stderr,"Individual %s specified with no marker data\n",bf); break; } if(i==ids || i==idd) { for(k=0;kn_levels=n_all_old; } } } else k1=1; if(k1) { (void)fputs("Searching for 'bad' subset\n - Pass 1: ",stdout); (void)fflush(stdout); for(j=0;j=0) { i=perm[j]; blank[j]=0; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=bk[k][j]; } sc=0; sig_caught=0; catch_sigs=1; silent_flag=1; k4=0; while(fam && !sig_caught) { add_to_list(fam,&k4,fam_list); k2=0; /* Put all (non-pruned) family members into tlist */ i=family[fam-1].sire; if(i) { j=ped_recode1[i-1]; if(j) tlist[k2++]=j-1; } i=family[fam-1].dam; if(i) { j=ped_recode1[i-1]; if(j) tlist[k2++]=j-1; } for(k1=0;k1=0) { i=perm[j]; blank[j]=fam; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=0; } } fam1=Check_Locus(locus,fptr,fname,-comp,linktype,lfptr); if(rec_gen_flag) { for(j=0;j=0) { i=perm[j]; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=blank[j]?0:bk[k][j]; } } /* Is the same family still giving problems? */ if(fam1==fam) { for(k1=0;k1=0) { i=perm[j]; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=blank[j]?0:bk[k][j]; } } if(fam1==fam){ (void)fprintf(stderr,"Sort of bug - I can't cope with this situation\n"); silent_flag=0; (void)Check_Locus(locus,fptr,fname,0,linktype,lfptr); } } fam=fam1; (void)fputc('.',stdout); (void)fflush(stdout); } silent_flag=1; (void)printf("\n - Pass 2 %4d",k4); (void)fflush(stdout); while(k4 && !sig_caught) { k4--; fam1=fam_list[k4]; k2=0; i=family[fam1-1].sire; if(i) { j=ped_recode1[i-1]; if(j && blank[j-1]>=0) tlist[k2++]=j-1; } i=family[fam1-1].dam; if(i) { j=ped_recode1[i-1]; if(j && blank[j-1]>=0) tlist[k2++]=j-1; } for(k1=0;k1=0) tlist[k2++]=j-1; } comp=id_array[i].component; for(k1=0;k1=0) { i=perm[j]; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=blank[j]?0:bk[k][j]; } } if(fam) { for(;k1>0;k1--) { j=tlist[k1-1]; i=perm[j]; blank[j]=fam1; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=0; fam=Check_Locus(locus,fptr,fname,comp,linktype,lfptr); if(fam) blank[j]=0; if(rec_gen_flag) { for(j=0;j=0) { i=perm[j]; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=blank[j]?0:bk[k][j]; } } else if(fam) for(k=0;k<2;k++) id_array[i].haplo[k][locus]=bk[k][j]; markers[locus].element->n_levels=n_all_old; if(!fam) break; } if(!k1) { for(k1=0;k1=0) { i=perm[j]; for(k=0;k<2;k++) id_array[i].haplo[k][locus]=blank[j]?0:bk[k][j]; } } else if(fam) for(k=0;k<2;k++) id_array[i].haplo[k][locus]=0; } } } (void)printf("\b\b\b\b%4d",k4); (void)fflush(stdout); } silent_flag=2; if(Check_Locus(locus,fptr,fname,0,linktype,lfptr)) { ABT_FUNC("Internal error - OOOK!\n"); } (void)fputc('\n',stdout); for(sc=j=0;j0) sc++; sig_caught=0; catch_sigs=0; ferr=fopen(fname1,"w"); } if(lfile) flog=fopen(lfile,"a"); else flog=0; if(flog) { (void)fputs("\n**************** Removing genotype errors ***************\n\n",flog); (void)fprintf(flog,"Processing marker '%s'\nDeleted subset follows:\n\n",marker_name); } k1=k2=sc=0; for(j=0;j=0) { k2++; i=perm[j]; if(blank[j]>0) { sc++; if(flog) print_orig_id(flog,i+1,1); if(ferr) { if(family_id) print_orig_family(ferr,i+1,0); print_orig_id1(ferr,i+1,1); print_orig_id1(ferr,family[blank[j]-1].sire,1); print_orig_id1(ferr,family[blank[j]-1].dam,1); } if(ferr) (void)fputc('\n',ferr); if(k1==10) { if(flog) (void)fputc('\n',flog); k1=0; } else k1++; } } sc+=bad_cnt; k2+=bad_cnt; (void)printf("(%d out of %d = %.3g%%)\n",sc,k2,100.0*(double)sc/(double)k2); if(flog) { (void)fprintf(flog," (%d out of %d = %.3g%%)\n",sc,k2,100.0*(double)sc/(double)k2); (void)fclose(flog); } if(ferr) (void)fclose(ferr); if(fptr1) { cat_file(fptr1,fptr,fname); fclose(fptr1); } free(fname1); } else { cat_file(fptr1,fptr,fname); fclose(fptr1); } } free(marker_name); } if(fwrite("Lgen.end",8,1,fptr)!=1) DataFileError(fname); if(fclose(fptr)) DataFileError(fname); if(lfptr) (void)fclose(lfptr); free(fname); free(perm); if(check_flag) { free(bk[0]); free(blank); } DoFamily(-1,0,0,0); min_deg(0,0,0,0,0); return locus<(n_markers+(traitlocus?1:0))?1:0; } loki/prepsrc/get_marker_name.c0100644000076500007650000000356407646742735015771 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Paris * * * * August 2002 * * * * get_marker_name.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "scan.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_marker_name" char *get_marker_name(const int locus) { char *s,tbuf[32]; size_t i; struct Marker *mark; if(locus==n_markers) mark=traitlocus; else mark=markers+locus; if(mark->var->vtype&ST_ARRAY) { (void)sprintf(tbuf,"%d",mark->index); i=strlen(tbuf)+strlen(mark->var->name)+3; if(!(s=malloc(i))) ABT_FUNC(MMsg); (void)sprintf(s,"%s(%s)",mark->var->name,tbuf); } else { i=strlen(mark->var->name)+1; if(!(s=malloc(i))) ABT_FUNC(MMsg); (void)strcpy(s,mark->var->name); } return s; } loki/prepsrc/init_fam.c0100644000076500007650000001140507747723563014430 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * init_fam.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "scan.h" int n_families=0; struct Family *family=0; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "InitFamilies" void InitFamilies(char *LogFile) { int i,j,k,kid,ids,idd,*tp,nk,nf; FILE *flog=0; char *tname; for(i=0;i #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "scan.h" #include "control_parse.h" int n_id_records,n_nonid_records; struct var_element **id_elements=0,**nonid_elements=0; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "match_records" void match_records(void) { int i,i1,j,k,k1,k2,k3,id,ncol; struct InFile *infile,*infile1; struct var_element *elem; struct id_data *data,**dataptr=0; struct DataBlock *db; struct scan_data *sd; n_id_records=n_nonid_records=0; /* Count constant and inconstant records */ infile=Infiles; while(infile) { for(i=0;invar;i++) { elem=infile->element[i]; if(elem && !(elem->type&(ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO|ST_FLAG|ST_MARKER))) { if(elem->type&ST_CONSTANT) n_id_records++; else n_nonid_records++; elem->type|=ST_FLAG; } } infile=infile->next; } /* Allocate space for list, and put element pointers for * constant and inconstant records in list */ if(!(n_id_records+n_nonid_records)) return; if(!(id_elements=malloc((n_id_records+n_nonid_records)*sizeof(void *)))) ABT_FUNC(MMsg); nonid_elements=id_elements+n_id_records; infile=Infiles; k=j=0; while(infile) { for(i=0;invar;i++) { elem=infile->element[i]; if(elem && !(elem->type&(ST_ID|ST_FAMILY|ST_SIRE|ST_DAM|ST_HAPLO))) { if(elem->type&ST_FLAG) { if(elem->type&ST_CONSTANT) id_elements[j++]=elem; else nonid_elements[k++]=elem; elem->type&=~ST_FLAG; } } } infile=infile->next; } /* Find out which individuals have data */ for(i=0;idata; ncol=infile->ncol; while(db) { for(j=0;jrecord_ptr;j++) { id=(int)db->records[j*ncol+infile->id_col].value; k1=n_nonid_records?0:1; i=-1; for(i1=0;i1nvar;i1++) { elem=infile->element[i1]; if(!elem) continue; i++; if(check_missing(i,ncol,j,db)) continue; if(!id_array[id-1].flag) for(k=0;knext; } infile=infile->next; } /* Count how many data records we have */ for(i=j=k=0;idata; ncol=infile->ncol; while(db) { for(j=0;jrecord_ptr;j++) { id=(int)db->records[j*ncol+infile->id_col].value; i= -1; for(k1=i1=0;i1nvar;i1++) { elem=infile->element[i1]; if(!elem) continue; i++; if(check_missing(i,ncol,j,db)) continue; for(k=0;ktype&(ST_INTTYPE|ST_FACTOR)) { if(id_array[id-1].data[k].data.value!=db->records[j*ncol+i].value) k2=1; } else if(id_array[id-1].data[k].data.rvalue!=db->records[j*ncol+i].rvalue) k2=1; if(k2) { sd=elem->arg.var->data; if(sd->vtype&ST_ARRAY) (void)fprintf(stderr,"Error: File %s (col %d), variable '%s(%d)', id ",infile->name,i1+1,sd->name,elem->oindex); else (void)fprintf(stderr,"Error: File %s, variable '%s', id ",infile->name,sd->name); print_orig_id(stderr,id,0); (void)fputs(" - constant type isn't\n",stderr); if(elem->type&ST_INTTYPE) (void)fprintf(stderr,"(old: %ld, new: %ld)\n",id_array[id-1].data[k].data.value,db->records[j*ncol+i].value); else if(elem->type&ST_FACTOR) { for(k2=0;k2type==STRING) (void)fprintf(stderr,"(old: '%s', ",factor_recode[k2][k3]->data.string); else (void)fprintf(stderr,"(old: %ld, ",factor_recode[k2][k3]->data.value); k3=db->records[j*ncol+i].value-1; if(factor_recode[k2][k3]->type==STRING) (void)fprintf(stderr,"new: '%s')\n",factor_recode[k2][k3]->data.string); else (void)fprintf(stderr,"new: %ld)\n",factor_recode[k2][k3]->data.value); } else (void)fprintf(stderr,"(old: %g, new: %g)\n",id_array[id-1].data[k].data.rvalue,db->records[j*ncol+i].rvalue); if((++scan_error_n)>=max_scan_errors) abt(__FILE__,__LINE__,"Too many errors - aborting\n"); } } id_array[id-1].data[k].flag=1|(elem->type&(ST_INTTYPE|ST_REALTYPE)); if(elem->type&ST_INTTYPE) id_array[id-1].data[k].data.value=db->records[j*ncol+i].value; else id_array[id-1].data[k].data.rvalue=db->records[j*ncol+i].rvalue; break; } for(k=0;ktype&(ST_INTTYPE|ST_REALTYPE)); if(elem->type&ST_INTTYPE) id_array[id-1].data1[k2][k].data.value=db->records[j*ncol+i].value; else id_array[id-1].data1[k2][k].data.rvalue=db->records[j*ncol+i].rvalue; k1=1; break; } } if(k1) id_array[id-1].nrec++; } db=db->next; } infile1=infile->next; free_infile(infile); infile=infile1; } Infiles=0; for(i=0;i #ifdef USE_DMALLOC #include #endif #include #include "utils.h" #include "scan.h" #include "control_parse.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "Output_Data" void Output_Data(void) { int i,j,ids,idd,*perm; FILE *fptr; if(!pruned_ped_size) return; if((fptr=fopen(OutputFile,"w"))) { if(!(perm=malloc(pruned_ped_size*sizeof(int)))) ABT_FUNC(MMsg); for(i=0;itype==STRING) { (void)fputc(' ',fptr); (void)fputs(factor_recode[n_factors+x][ch]->data.string,fptr); } else (void)fprintf(fptr," %ld",factor_recode[n_factors+x][ch]->data.value); } else (void)fputs(" *",fptr); } } } else for(x=0;x #include #ifdef HAVE_UNISTD_H #include #endif #include #ifdef USE_DMALLOC #include #endif #include #include #include #include "version.h" #include "ranlib.h" #include "utils.h" #include "libhdr.h" #include "scan.h" #include "control_parse.h" #include "compat/compat.h" #include "getopt.h" unsigned int RunID; int nrm_flag,strip_vars; loki_time lt; static int error_check=1; static char *LogFile; void print_version_and_exit(void) { (void)printf("%s\n",PREP_NAME); exit(EXIT_SUCCESS); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "process_loki" static int process_loki(int argc,char *argv[]) { FILE *fptr; int err,i,c,ec_flag=0; while((c=getopt(argc,argv,"evX:d:p:"))!=-1) switch(c) { case 'e': error_check=0; ec_flag=1; break; case 'v': print_version_and_exit(); break; /* Previous command never returns */ case 'd': if((i=set_file_dir(optarg))) { fprintf(stderr,"Error setting default file directory: %s\n",i==UTL_BAD_STAT?strerror(errno):utl_error(i)); exit(EXIT_FAILURE); } break; case 'p': if((i=set_file_prefix(optarg))) { fprintf(stderr,"Error setting default file prefix: %s\n",utl_error(i)); exit(EXIT_FAILURE); } break; case 'X': fputs("-X option must occur as first argument\n",stderr); exit(EXIT_FAILURE); } if(optind>=argc) abt(__FILE__,__LINE__,"No control file specified\n"); init_stuff(&LogFile); if((fptr=fopen(argv[optind],"r"))) err=ReadControl(fptr,argv[optind],&LogFile); else { (void)printf("Couldn't open '%s' for input as control file\nAborting...\n",argv[optind]); exit(EXIT_FAILURE); } (void)fclose(fptr); if(!err) { if(getseed("seedfile",0)) init_ranf(135421); RunID=(unsigned int)(ranf()*(double)0xffffffffU); if(!ec_flag) error_check=syst_var[ERROR_CHECK]; print_start_time(PREP_NAME,"w",LogFile,<); if(!scan_error_n) ReadData(LogFile); /* Read in the datafile(s) and recode (where necessary) */ } return err; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "main" int main(int argc,char *argv[]) { int err,type=LOKI_FORMAT; lt.start_time=time(0); if(argc>1) { if(*argv[1]=='-' && argv[1][1]=='X') { type=check_format(argv[1]); optind=2; optreset=1; } } switch(type) { case LOKI_FORMAT: err=process_loki(argc,argv); break; case QTDT_FORMAT: err=process_qtdt(argc,argv,&LogFile,&error_check,<); break; default: fputs("Input type not yet handled\n",stderr); exit(EXIT_FAILURE); } if(err) { LogFile=0; exit(EXIT_FAILURE); } if(!pruned_ped_size) { (void)printf("Zero size pedigree\nAborting...\n"); exit(EXIT_FAILURE); } if(!scan_error_n) { InitFamilies(LogFile); count_loops(LogFile); check_inbreeding(LogFile); check_ymark(); } if(!scan_error_n && (traitlocus || n_markers)) err=Genotype_Elimination(syst_var[CORRECT_ERRORS],LogFile,error_check); if(!scan_error_n && !err) nrm_flag=Calculate_NRM(LogFile); (void)writeseed("seedfile",1); if(family) free(family); if(!scan_error_n && !err && nrm_flag>=0) { WriteData(LogFile); /* WriteXMLData(LogFile); */ WriteReport(LogFile); } free_nodes(); if(scan_error_n) (void)fprintf(stderr,"Errors: %d ",scan_error_n); if(scan_warn_n) (void)fprintf(stderr,"Warnings: %d ",scan_warn_n); if(scan_error_n || scan_warn_n) (void)fprintf(stderr,"\n"); return sig_caught; } loki/prepsrc/prep_do_peel_op.c0100644000076500007650000003656407750230767016003 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * prep_do_peel_op.c: * * * * Perform complex peeling operation * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "scan.h" #include "prep_peel.h" #define HASHTABLE_SIZE 2053 /* Should be prime */ static int hb_size=2048,n_bits,n_terms,hash_mode; static struct bin_node *hashtable[HASHTABLE_SIZE]; static struct hash_block *first_hash_block=0,*hash_block; static struct R_Func *rf_array; int total_terms=0,total_comb=0; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_gts" static void get_gts(lk_ulong x,const int n,int *gt) { int i; lk_ulong a; a=(LK_ONE<=n) ABT_FUNC("Internal error - invalid index value\n"); gt[i++]=1+(int)(x&a); x>>=n_bits; } for(;iptr>=hash_block->size) { if(!hash_block->next) { if(!(hash_block->next=malloc(sizeof(struct hash_block)))) ABT_FUNC(MMsg); hash_block=hash_block->next; hash_block->next=0; if(!(hash_block->elements=malloc(sizeof(struct bin_node)*hb_size))) ABT_FUNC(MMsg); if(!(hash_block->idx=malloc(sizeof(lk_ulong)*hb_size))) ABT_FUNC(MMsg); hash_block->size=hb_size; } else hash_block=hash_block->next; hash_block->ptr=0; } element=hash_block->elements+hash_block->ptr; p=hash_block->idx+hash_block->ptr++; *p=idx; element->data=p; element->left=element->right=0; element->balance=0; n_terms++; return element; } static struct bin_node *insert_node(struct bin_node *node,lk_ulong idx,int *bal) { int bb; lk_ulong idx1; idx1=*(lk_ulong *)node->data; if(idx!=idx1) { bb=node->balance; if(idxleft) node->left=insert_node(node->left,idx,bal); else { node->left=get_new_element(idx); *bal=0; } if(!(*bal)) { switch(bb) { case -1: node=rotate_left(node); *bal=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *bal=1; } } } else { if(node->right) node->right=insert_node(node->right,idx,bal); else { node->right=get_new_element(idx); *bal=0; } if(!(*bal)) { switch(bb) { case -1: node->balance=0; *bal=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *bal=1; } } } } else *bal=1; return node; } static lk_ulong get_index1(int n,int *gt) { int i; lk_ulong x; x=0; for(i=n-1;i>=0;i--) { x<<=n_bits; x|=gt[i]-1; } return x; } static void get_nodes(struct bin_node *node,lk_ulong *tl,int *j) { if(node->left) get_nodes(node->left,tl,j); tl[(*j)++]=*(lk_ulong *)node->data; if(node->right) get_nodes(node->right,tl,j); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_term" static void add_term(int n_out,int *gt_store) { lk_ulong idx; int i,j; idx=get_index1(n_out,gt_store); if(hash_mode) { i=(int)idx; if(!hashtable[i]) hashtable[i]=get_new_element(idx); } else { i=(int)(idx%HASHTABLE_SIZE); /* Get hash index */ if(hashtable[i]) hashtable[i]=insert_node(hashtable[i],idx,&j); else hashtable[i]=get_new_element(idx); } } /* Performs logical transmission check */ static int check_trans(int i,int par_flag,const int id,lk_ulong *req_set[]) { int par,al,al1,j; lk_ulong m,a,m1; if(par_flag==X_MAT) par=id_array[i-1].dam; else par=id_array[i-1].sire; j=ped_recode1[i-1]-1-id; al=id_array[i-1].allele[par_flag]-1; a=req_set[par_flag][j]; m=LK_ONE<elements) free(hash_block->elements); if(hash_block->idx) free(hash_block->idx); hb1=hash_block->next; free(hash_block); hash_block=hb1; } first_hash_block=0; total_terms=total_comb=0; } static int qs_func(const void *p1,const void *p2) { int i1,i2,k1,k2; i1= rf_array[k1=*((int *)p1)].n_ind; i2= rf_array[k2=*((int *)p2)].n_ind; if(rf_array[k1].n_termsrf_array[k2].n_terms) return -1; if(i1i2) return -1; return 0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_peel_op" int do_peel_op(const struct Complex_Element *element,struct R_Func *r_func,const int n_all,const int id,lk_ulong **all_set,lk_ulong *req_set[]) { int i,j,k,k1,k2,k3,k4,n_out,n_peel,n_inv,*inv,n_rf,n_ind,n_other,ef,ef1,n_comb; int *gt_store,*gt_store1,*other_ptr,*other_list,*rf_ptr,*jnt_list,ht_size; double max_terms,fill; lk_ulong a,b,c,*tl; struct bin_node *elem; if(!first_hash_block) { if(!(first_hash_block=malloc(sizeof(struct hash_block)))) ABT_FUNC(MMsg); if(!(first_hash_block->elements=malloc(sizeof(struct bin_node)*hb_size))) ABT_FUNC(MMsg); if(!(first_hash_block->idx=malloc(sizeof(lk_ulong)*hb_size))) ABT_FUNC(MMsg); first_hash_block->next=0; first_hash_block->size=hb_size; } hash_block=first_hash_block; while(hash_block) { hash_block->ptr=0; hash_block=hash_block->next; } hash_block=first_hash_block; n_terms=n_comb=0; n_bits=num_bits(n_all); n_inv=element->n_involved; n_peel=element->n_peel; n_out=n_inv-n_peel; inv=element->involved; if(n_bits*n_out>(int)LK_LONG_BIT) { (void)fprintf(stderr,"\nToo many individuals in output R-Function\nn_out = %d, n_all = %d, n_bits = %d, required size = %d, LONG_BIT = %d\n",n_out,n_all,n_bits,n_out*n_bits,(int)LK_LONG_BIT); ABT_FUNC(AbMsg); } max_terms=log((double)n_all)*(double)n_out; hash_mode=(log(2.0)*n_bits*n_outn_rfuncs; rf_array=r_func; if(n_rf>1) gnu_qsort(element->index,(size_t)n_rf,sizeof(int),qs_func); #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL1)) (void)printf("In do_peel_op(), n_inv=%d, n_out=%d, n_rf=%d\n",n_inv,n_out,n_rf); if(CHK_PEEL(TRACE_LEVEL2)) { for(i=0;i",stdout); if(n_out) { for(;in_peel) fputc(',',stdout); print_orig_allele_id(stdout,inv[i]); } } else fputc('*',stdout); fputc('\n',stdout); } #endif if(!(gt_store=calloc((size_t)(5*n_inv+n_rf),sizeof(int)))) ABT_FUNC(MMsg); other_list=gt_store+n_inv; other_ptr=other_list+n_inv; jnt_list=other_ptr+n_inv; rf_ptr=jnt_list+n_inv; gt_store1=rf_ptr+n_rf; for(i=0;iindex[i]; n_ind=r_func[j].n_ind; #ifdef TRACE_PEEL if(CHK_PEEL(TRACE_LEVEL2)) { for(k=0;k=0;k--) { a<<=n_bits; k1=r_func[j].id_list[k]; if(gt_store[k1]) a|=b; else { c|=LK_ONE<flags[i]&(HAP_JNT|HAP_DAT)) { k= -inv[i]; for(j=0;jindex[i]; ef=0; n_ind=r_func[j].n_ind; a=r_func[j].mask; if(a) { b=0; for(k=n_ind-1;k>=0;k--) { b<<=n_bits; k1=r_func[j].id_list[k]; if(gt_store[k1]) b|=gt_store[k1]-1; } b&=a; k1=r_func[j].n_terms; tl=r_func[j].index; for(k=rf_ptr[i];k>=1; } do { if(!i) { ef1=1; break; } rf_ptr[i--]=0; rf_ptr[i]++; j=element->index[i]; a=r_func[j].mask1; k=0; while(a) { if(a&1) gt_store[k]=0; k++; a>>=1; } } while(rf_ptr[i]>=r_func[j].n_terms); i--; } if(ef1) break; } if(ef1) break; for(ef=i=0;i<=n_other;i++) { if(i==n_other) { if(!ef) { for(k=0;k0) { id_array[inv[k]-1].allele[X_MAT]=gt_store[k]; if(element->flags[k]&(HAP_JNT|HAP_DAT)) { j=ped_recode1[inv[k]-1]-1-id; for(k1=0;k1flags[k]&HAD_P) if((ef=check_trans(-inv[k],X_PAT,id,req_set))) break; if(element->flags[k]&HAD_M) if((ef=check_trans(inv[k],X_MAT,id,req_set))) break; if(inv[k]>0 && element->flags[k]&(HAP_JNT|HAP_DAT)) { for(k1=0;k1=0) { other_ptr[i]++; gt_store[other_list[i]]=0; if(other_ptr[i]flags[k1]&(HAP_JNT|HAP_DAT)) { k2=jnt_list[i]; if(inv[k1]>0) { if(gt_store[k2]) { b=LK_ONE<<(gt_store[k2]-1); for(k=other_ptr[i];k0) { for(k=other_ptr[i];kindex[i]; a=r_func[j].mask1; if(a) { k=0; while(a) { if(a&1) gt_store[k]=0; k++; a>>=1; } if(rf_ptr[i]=0); if(i>=0) ef=0; } else i=0; if(ef) break; } if(!n_terms) { free(gt_store); return 1; } i=element->out_index; if(i>=0) { r_func[i].n_terms=n_terms; for(j=0;j No. non-zero terms = %d (%g%% full), non-zero combs %d, %d, %d\n",n_terms,100.0*fill,n_comb,total_terms,total_comb); #endif free(gt_store); return 0; } loki/prepsrc/prep_peel.h0100644000076500007650000000216207646742735014622 0ustar heathheath#ifndef _PREP_PEEL_H_ #define _PREP_PEEL_H_ #include "lk_long.h" #include "shared_peel.h" #include "bin_tree.h" #define HAS_DATA 1 #define IS_PRUNED 2 #define IS_FIXED 4 #define RF_INCLUDED 8 #define WAS_PIVOT 16 #define PEELED 32 #define IS_SINGLETON 64 #define HAS_GDATA 128 #define STABLE_FLAGS 255 #define HAP_MAT 256 #define HAP_PAT 512 #define HAP_M 1024 #define HAP_P 2048 #define CHK_PEEL(x) ((trace_peel&TRACE_MASK)>=x) #define TRACE_LEVEL0 0 #define TRACE_LEVEL1 1 #define TRACE_LEVEL2 2 #define TRACE_LEVEL3 3 #define TRACE_LEVEL4 4 #define TRACE_MASK 7 struct R_Func { int n_ind; int n_terms; int flag; lk_ulong mask; lk_ulong mask1; int *id_list; lk_ulong *index; struct Peelseq_Head *peel_elem; }; struct hash_block { struct hash_block *next; struct bin_node *elements; lk_ulong *idx; int size,ptr; }; extern int do_peel_op(const struct Complex_Element *element,struct R_Func *r_func,const int n_all,const int id,lk_ulong **all_set,lk_ulong *req_set[]); extern void print_orig_allele_id(FILE *fptr,const int i); extern void free_hash_blocks(void); extern int total_terms,total_comb,trace_restrict; #endif loki/prepsrc/prep_utils.c0100644000076500007650000000600707646742735015032 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - CNG, Paris * * * * August 2002 * * * * prep_utils.c: * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #include #include "utils.h" #include "libhdr.h" #include "scan.h" #include "control_parse.h" #include "min_deg.h" #include "prep_utils.h" void print_orig_allele_id(FILE *fptr,const int i) { if(i>0) { print_orig_id(fptr,i,0); (void)fputc('m',fptr); } else { print_orig_id(fptr,-i,0); (void)fputc('p',fptr); } } void add_to_list(const int i,int *j,int *list) { int k; for(k=0;k<(*j);k++) if(list[k]==i) break; if(k==(*j)) list[(*j)++]=i; } int find_id_code(char *buf,int type,int fam) { struct label_data *node=0; int i,flag; char *p; flag=fam<0?1:0; if(type==INTEGER) { i=(int)strtol(buf,&p,10); if(*p) (void)fprintf(stderr,"Garbage after id code '%s'\n",buf); else node=find_node(&i,type,flag); } else node=find_node(buf,type,flag); if(node) i=rec_tab[node->index]; else { if(strcmp("*",buf)) { (void)fprintf(stderr,"Id code '%s' not found\n",buf); i=-1; } else i=0; } if(fam && i>=0) i=rec_tab1[(i-1)*n_orig_families+fam-1]; else if(flag) i=-i; return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "cat_file" void cat_file(FILE *in,FILE *out,char *fname) { char buf[1024]; size_t l; if(fseek(in,0,SEEK_SET)<0) ABT_FUNC("Couldn't seek in input file\n"); do { l=fread(buf,1,1024,in); if(fwrite(buf,1,l,out)!=l) DataFileError(fname); } while(l); } static void blank_ind(const int i,int *blank,const int locus,const int fam) { int j,k; j=ped_recode1[i-1]; if(j && blank[j-1]>=0) { blank[j-1]=fam+1; for(k=0;k<2;k++) id_array[i-1].haplo[k][locus]=0; } } void blank_fam(const int fam,int *blank,const int locus) { int i,k; i=family[fam-1].sire; if(i) blank_ind(i,blank,locus,fam); i=family[fam-1].dam; if(i) blank_ind(i,blank,locus,fam); for(k=0;k to initialize pedigree * * data structures. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include #if HAVE_REGCOMP #include #include #endif #include #include "utils.h" #include "control_parse.h" #include "scan.h" #define INIT_BLOCK_SIZE 128 /* Start allocating memory in blocks of INIT_BLOCK_SIZE records, doubling */ #define MAX_BLOCK_SIZE 512 /* the size if more space required up to MAX_BLOCK_SIZE */ #define S_BLOCK_SIZE 512 /* For string allocation: should be at least as big as BUFFER_SIZE */ #define BUFFER_SIZE 511 /* Maximum size of columns for free format reads */ #define LINE_COUNT 5000 /* How often to print 'At line' */ static char *StringData=0; static char *default_rsformat="\n"; static size_t StringPos; static struct miss_var_tag *miss_var; static struct DataBlock *DataBlock; static struct bin_node *node_strings,*node_ints,*node_ped_int,*node_fam_int,*node_ped_str,*node_fam_str; static int num_nodes; struct label_data **ped_recode,**family_recode,***factor_recode; int *ped_recode1; int ped_size; struct miss_var_tag { struct express **Missing; int nmiss; }; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_scope" static int get_scope(char *p) { int i,j,scope; scope=j=0; while(*p) { i=toupper((int)*p); switch(i) { case '!': j=1; break; case 'P': scope|=j?~ST_PED:ST_PED; j=0; break; case 'F': scope|=j?~ST_FACTOR:ST_FACTOR; j=0; break; case 'G': scope|=j?~(ST_MARKER|ST_HAPLO):(ST_MARKER|ST_HAPLO); j=0; break; case 'I': scope|=j?~ST_INTTYPE:ST_INTTYPE; break; case 'C': case 'R': scope|=j?~ST_REALTYPE:ST_REALTYPE; j=0; break; default: ABT_FUNC("Illegal missing scope\n"); } p++; } return scope; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "process_missing" static void process_missing(struct InFile *infile) { struct Miss *ms; int i,j,col=0,total_miss=0,scope=0; struct express **p; struct var_element *elem; if(!(miss_var=malloc(sizeof(struct miss_var_tag)*infile->ncol))) ABT_FUNC(MMsg); for(i=0;incol;i++) miss_var[i].nmiss=0; ms=Miss; while(ms) { if(ms->scope) scope=get_scope(ms->scope); for(col=j=0;jnvar;j++) if(infile->element[j]) { if(ms->element) { for(i=0;invar;i++) if(ms->element[i]==infile->element[j]) { miss_var[col].nmiss++; total_miss++; } } else if(ms->scope) { elem=infile->element[j]; if(elem->type&scope) { miss_var[col].nmiss++; total_miss++; } } else { miss_var[col].nmiss++; total_miss++; } col++; } ms=ms->next; } if(total_miss) { if(!(p=malloc(sizeof(void *)*total_miss))) ABT_FUNC(MMsg); } else p=0; for(i=0;iscope) scope=get_scope(ms->scope); for(col=j=0;jnvar;j++) if(infile->element[j]) { if(ms->element) { for(i=0;invar;i++) if(ms->element[i]==infile->element[j]) miss_var[col].Missing[miss_var[col].nmiss++]=&ms->Missing; } else if(ms->scope) { elem=infile->element[j]; if(elem->type&scope) miss_var[col].Missing[miss_var[col].nmiss++]=&ms->Missing; } else miss_var[col].Missing[miss_var[col].nmiss++]=&ms->Missing; col++; } ms=ms->next; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "alloc_node" static struct bin_node *alloc_node(const void *s,int type) { struct bin_node *node; struct label_data *data; size_t i; char *p,*p1; if(!(node=malloc(sizeof(struct bin_node)))) ABT_FUNC(MMsg); node->left=node->right=0; node->balance=0; if(!(data=malloc(sizeof(struct label_data)))) ABT_FUNC(MMsg); node->data=data; data->type=type; data->index=num_nodes++; switch(type) { case STRING: p1=(char *)s; i=strlen(p1)+1; if(i>(S_BLOCK_SIZE-StringPos)) { if(!(StringData=malloc(S_BLOCK_SIZE))) ABT_FUNC(MMsg); RemBlock=AddRemem(StringData,RemBlock); StringPos=0; } p=StringData+StringPos; data->data.string=p; if(!syst_var[IGNORE_CASE]) (void)strcpy(p,p1); else { p1=(char *)s; while(*p1) *p++=toupper((int)(*p1++)); *p=0; } StringPos+=i; break; case INTEGER: data->data.value= *(long *)s; break; default: ABT_FUNC("Internal error - invalid type\n"); } return node; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_inode" static struct label_data *find_inode(struct bin_node *node,const long s) { long i; struct label_data *data; data=node->data; i=s-data->data.value; if(i<0) { if(node->left) data=find_inode(node->left,s); else data=0; } else if(i>0) { if(node->right) data=find_inode(node->right,s); else data=0; } return data; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "find_snode" static struct label_data *find_snode(struct bin_node *node,const char *s) { long i; struct label_data *data; data=node->data; if(!syst_var[IGNORE_CASE]) i=strcmp(s,data->data.string); else i=strcasecmp(s,data->data.string); if(i<0) { if(node->left) data=find_snode(node->left,s); else data=0; } else if(i>0) { if(node->right) data=find_snode(node->right,s); else data=0; } return data; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "insert_node" static struct bin_node *insert_node(struct bin_node *node,const void *s,struct label_data **node1,int *balanced,int type) { long i; struct label_data *data; data=node->data; if(type==INTEGER) i=*((long *)s)-data->data.value; else { if(!syst_var[IGNORE_CASE]) i=strcmp(s,data->data.string); else i=strcasecmp((char *)s,data->data.string); } if(i<0) { if(node->left) node->left=insert_node(node->left,s,node1,balanced,type); else { node->left=alloc_node(s,type); *node1=node->left->data; *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node=rotate_left(node); *balanced=1; break; case 0: node->balance=-1; break; case 1: node->balance=0; *balanced=1; } } } else if(i>0) { if(node->right) node->right=insert_node(node->right,s,node1,balanced,type); else { node->right=alloc_node(s,type); *node1=node->right->data; *balanced=0; } if(!(*balanced)) { switch(node->balance) { case -1: node->balance=0; *balanced=1; break; case 0: node->balance=1; break; case 1: node=rotate_right(node); *balanced=1; } } } else { *node1=node->data; *balanced=1; } return node; } struct label_data *find_node(const void *s,int type,int flag) { struct bin_node *node; struct label_data *data=0; if(type==INTEGER) { if(flag) node=node_fam_int; else node=node_ped_int; if(node) data=find_inode(node,*((long *)s)); } else { if(flag) node=node_fam_str; else node=node_ped_str; if(node) data=find_snode(node,(char *)s); } return data; } void free_nodes(void) { if(node_ints) free_bin_tree(node_ints,free); if(node_strings) free_bin_tree(node_strings,free); if(node_ped_int) free_bin_tree(node_ped_int,free); if(node_ped_str) free_bin_tree(node_ped_str,free); if(node_fam_int) free_bin_tree(node_fam_int,free); if(node_fam_str) free_bin_tree(node_fam_str,free); node_ints=node_strings=node_ped_int=node_ped_str=node_fam_int=node_fam_str=0; } static void set_missing(int col,int ncol,int rec,struct DataBlock *db) { unsigned int i,j; i=rec*ncol+col; db->records[i].value=0; j=7-(i&7); i>>=3; db->type[i]|=(unsigned char)(1<>=3; return db->type[i]&(1<type==ST_STRING)) { p=string; while(*p) { if(*p=='.') break; p++; } if(*p) { ep.arg.rvalue=strtod(miss->arg.string,&p); if(!*p) ep.type=ST_REAL; } else { ep.arg.value=strtol(miss->arg.string,&p,10); if(!*p) ep.type=ST_INTEGER; } } if(!ep.type) { ep.type=miss->type; ep.arg=miss->arg; } switch(ep.type) { case ST_STRING: match=!strcmp(string,ep.arg.string); break; case ST_INTEGER: p=string; while(*p) { if(*p=='.') break; p++; } if(*p) { rval=strtod(string,&p); if(!*p && fabs(rval-(double)ep.arg.value)<1.0e-12) match=1; } else { val=strtol(string,&p,10); if(!*p && val==ep.arg.value) match=1; } break; case ST_REAL: rval=strtod(string,&p); if(!*p && fabs(rval-ep.arg.rvalue)<1.0e-12) match=1; break; case 0: break; #ifdef DEBUG default: ABT_FUNC("Internal error - bad missing type\n"); #endif } return match; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "handle_string" static int handle_string(char *string,struct InFile *infile,struct var_element *elem,int col,char *gs) { int i,miss,ncol; char *sptr,ch=0,*p1,*p2,*gs1,flag=0; static char single1[2],single2[2]; struct label_data *node; struct gt_data *gt; long value; ncol=infile->ncol; miss=0; if(miss_var) { for(i=0;itype)) { miss=1; break; } } } if(!miss) { if(elem->type&(ST_ID|ST_SIRE|ST_DAM|ST_FAMILY|ST_FACTOR|ST_HAPLO|ST_MARKER)) { if(elem->type&ST_MARKER) { /* Genotype data - split into fields based on gsformat */ p1=string; p2=0; if(gs) { if(!gs[0]) { single1[0]=*p1++; single2[0]=*p1++; if(*p1) print_scan_err("[%s:%d] %s(): Line %d column %d - >2 characters in simple genotype %s\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1,string); p1=single1; p2=single2; flag=1; } else { while((ch=*(p1++))) { gs1=gs; while(*gs1) { if(ch==*gs1) { *(--p1)=0; break; } gs1++; } if(*gs1) break; } } } else { while((ch=*(p1++))) { if(isspace((int)ch)) { *(--p1)=0; break; } } } if(!flag) { if(ch) { p2=p1+1; qstrip(p2); } p1=string; qstrip(p1); } if(miss_var) { for(i=0;itype)) { p1=0; } if(p2) if(check_miss(p2,miss_var[col].Missing[i],elem->type)) { p2=0; } if(!(p1||p2)) break; } } if(p1||p2) { if(!(gt=malloc(sizeof(struct gt_data)))) ABT_FUNC(MMsg); gt->node1=gt->node2=0; if(elem->type&(ST_INTTYPE)) { if(p1) { value=strtol(p1,&sptr,10); if(*sptr) { if(!syst_var[SKIP_BAD_INTS]) print_scan_err("[%s:%d] %s(): Line %d column %d - Malformed integer %s\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1,p1); miss=1; free(gt); gt=0; } else { if(!node_ints) { node_ints=alloc_node(&value,INTEGER); node=node_ints->data; } else node_ints=insert_node(node_ints,&value,&node,&i,INTEGER); gt->node1=node; } } if(!miss && p2) { value=strtol(p2,&sptr,10); if(*sptr) { if(!syst_var[SKIP_BAD_INTS]) print_scan_err("[%s:%d] %s(): Line %d column %d - Malformed integer %s\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1,p2); miss=1; free(gt); gt=0; } else { if(!node_ints) { node_ints=alloc_node(&value,INTEGER); node=node_ints->data; } else node_ints=insert_node(node_ints,&value,&node,&i,INTEGER); gt->node2=node; } } DataBlock->records[DataBlock->record_ptr*ncol+col].gt_data=gt; } else { if(p1) { if(!node_strings) { node_strings=alloc_node(p1,STRING); node=node_strings->data; } else node_strings=insert_node(node_strings,p1,&node,&i,STRING); gt->node1=node; } if(p2) { if(!node_strings) { node_strings=alloc_node(p2,STRING); node=node_strings->data; } else node_strings=insert_node(node_strings,p2,&node,&i,STRING); gt->node2=node; } DataBlock->records[DataBlock->record_ptr*ncol+col].gt_data=gt; } } else miss=1; } else { if(elem->type&ST_INTTYPE) { value=strtol(string,&sptr,10); if(*sptr) { if(!syst_var[SKIP_BAD_INTS]) print_scan_err("[%s:%d] %s(): Line %d column %d - Malformed integer %s\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1,string); miss=1; } else { if(elem->type&(ST_ID|ST_SIRE|ST_DAM)) { if(!node_ped_int) { node_ped_int=alloc_node(&value,INTEGER); node=node_ped_int->data; } else node_ped_int=insert_node(node_ped_int,&value,&node,&i,INTEGER); } else if(elem->type&(ST_FAMILY)) { if(!node_fam_int) { node_fam_int=alloc_node(&value,INTEGER); node=node_fam_int->data; } else node_fam_int=insert_node(node_fam_int,&value,&node,&i,INTEGER); } else { if(!node_ints) { node_ints=alloc_node(&value,INTEGER); node=node_ints->data; } else node_ints=insert_node(node_ints,&value,&node,&i,INTEGER); } DataBlock->records[DataBlock->record_ptr*ncol+col].node=node; } } else { if(elem->type&(ST_ID|ST_SIRE|ST_DAM)) { if(!node_ped_str) { node_ped_str=alloc_node(string,STRING); node=node_ped_str->data; } else node_ped_str=insert_node(node_ped_str,string,&node,&i,STRING); } else if(elem->type&(ST_FAMILY)) { if(!node_fam_str) { node_fam_str=alloc_node(string,STRING); node=node_fam_str->data; } else node_fam_str=insert_node(node_fam_str,string,&node,&i,STRING); } else { if(!node_strings) { node_strings=alloc_node(string,STRING); node=node_strings->data; } else node_strings=insert_node(node_strings,string,&node,&i,STRING); } DataBlock->records[DataBlock->record_ptr*ncol+col].node=node; } } } else { if(elem->type&ST_INTTYPE) DataBlock->records[DataBlock->record_ptr*ncol+col].value=strtol(string,&sptr,10); else DataBlock->records[DataBlock->record_ptr*ncol+col].rvalue=strtod(string,&sptr); if(*sptr) { if(elem->type&ST_INTTYPE) { if(!syst_var[SKIP_BAD_INTS]) print_scan_err("[%s:%d] %s(): Line %d column %d - Malformed integer %s\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1,string); } else { if(!syst_var[SKIP_BAD_REALS]) print_scan_err("[%s:%d] %s(): Line %d column %d - Malformed floating point number %s\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1,string); } miss=1; } } } return miss; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "update_datablock" static void update_datablock(int ncol) { int i; DataBlock->record_ptr++; if(DataBlock->record_ptr==DataBlock->blocksize) { if(!(DataBlock->next=malloc(sizeof(struct DataBlock)))) ABT_FUNC(MMsg); DataBlock->next->blocksize=DataBlock->blocksize; DataBlock=DataBlock->next; if(DataBlock->blocksizeblocksize*=2; i=DataBlock->blocksize*ncol; if(!(DataBlock->records=malloc(sizeof(union DataRec)*i))) ABT_FUNC(MMsg); if(!(DataBlock->type=calloc((size_t)(i>>3),sizeof(char)))) ABT_FUNC(MMsg); DataBlock->next=0; DataBlock->record_ptr=0; } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "ReadData" void ReadData(char *lfile) { int i,j,ncol,num_records,col,realcol,eor,miss; struct InFile *infile; char *buffer,ch,*string,*string_start,oldchar,*rs,*fs,*gs,*gs1,*tname; int buffersize,fs_reg=0,skip,skip_this; FILE *fptr,*flog; size_t l,string_leng; struct recode_table_tag *recode_table=0; struct format *format; struct var_element *elem; struct sex_def *sd; #ifdef HAVE_REGCOMP regex_t preg; regmatch_t pmatch; #endif infile=Infiles; if(!(StringData=malloc(S_BLOCK_SIZE))) ABT_FUNC(MMsg); RemBlock=AddRemem(StringData,RemBlock); StringPos=0; if(lfile && (tname=add_file_dir(lfile))) { flog=fopen(tname,"a"); free(tname); } else flog=0; if(flog) i=fputs("\n******************** Reading in data ********************\n\n",flog); while(infile) { fs_reg=0; fs=0; rs=rsformat; gs=gsformat; skip=file_skip; if(infile->fformat) { fs=infile->fformat->fs; rs=infile->fformat->rs; gs=infile->fformat->gs; skip=infile->fformat->skip; if(fs) { if(strlen(fs)>1) { #if HAVE_REGCOMP if((i=regcomp(&preg,fs,REG_EXTENDED))) fs=0; else fs_reg=1; #endif } else if(fs[0]==' ') fs=0; } } if(!rs) rs=default_rsformat; if(rs[0]=='\0') rs=0; if(!scan_error_n) { ncol=infile->ncol; if(Miss) process_missing(infile); else miss_var=0; if(infile->shell_flag) { if(!(fptr=popen(infile->name,"r"))) { (void)fprintf(stderr,"Can't execute '%s'.\n",infile->name); perror("read_data()"); scan_error_n++; break; } (void)printf("Reading in output from shell command '%s'\n",infile->name); } else { if(!(fptr=fopen(infile->name,"r"))) { (void)fprintf(stderr,"Can't open data file '%s' for reading.\n",infile->name); perror("read_data()"); scan_error_n++; break; } (void)printf("Reading in data from file '%s'\n",infile->name); } num_records=0; lineno=1; if(!(DataBlock=malloc(sizeof(struct DataBlock)))) ABT_FUNC(MMsg); i=INIT_BLOCK_SIZE*ncol; if(!(DataBlock->records=malloc(sizeof(union DataRec)*i))) ABT_FUNC(MMsg); if(!(DataBlock->type=calloc((size_t)i>>3,sizeof(unsigned int)))) ABT_FUNC(MMsg); DataBlock->next=0; DataBlock->blocksize=INIT_BLOCK_SIZE; DataBlock->record_ptr=0; infile->ncol=ncol; infile->data=DataBlock; format=infile->format; if(format) buffersize=2+format->f_atoms[format->n_atoms-1].pos+format->f_atoms[format->n_atoms-1].size; else buffersize=BUFFER_SIZE+1; if(!(buffer=malloc((size_t)buffersize))) ABT_FUNC(MMsg); col=realcol=0; string=buffer; errno=0; for(;;) { if(format) { if(!fgets(buffer,buffersize,fptr)) { if(errno && errno!=ECHILD) { perror("ReadData()"); abt(__FILE__,__LINE__,"Aborting\n"); } errno=0; break; } l=strlen(buffer); if(lineno>skip) { for(i=0;i<(int)l;i++) if(!isspace((int)buffer[i])) break; if(i<(int)l) { for(col=realcol=0;realcolnvar;realcol++) { elem=infile->element[realcol]; if(elem) { i=format->f_atoms[realcol].pos; if((size_t)i>=l) set_missing(col,ncol,DataBlock->record_ptr,DataBlock); else { j=format->f_atoms[realcol].size; string_start=buffer+i; oldchar=buffer[i+j]; buffer[i+j]=0; if(string_start[0]) qstrip(string_start); miss=string_start[0]?handle_string(string_start,infile,elem,col,gs):1; if(miss) { set_missing(col,ncol,DataBlock->record_ptr,DataBlock); if(elem->type&ST_ID) print_scan_err("[%s:%d] %s(): Line %d column %d - Missing id variable\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1); if(elem->type&ST_FAMILY) print_scan_err("[%s:%d] %s(): Line %d column %d - Missing family variable\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1); } buffer[i+j]=oldchar; } col++; } } update_datablock(ncol); num_records++; } } lineno++; if(!(lineno%LINE_COUNT)) (void)printf("At %d\n",lineno); /* read to end of line */ while(buffer[l-1]!='\n') { if(!fgets(buffer,buffersize,fptr)) { if(errno) { perror("ReadData()"); abt(__FILE__,__LINE__,"Aborting\n"); } break; } l=strlen(buffer); } continue; } l=BUFFER_SIZE; if(l<=(size_t)(string-buffer)) ABT_FUNC("column width exceeds buffer size\n"); l-=(size_t)(string-buffer); errno=0; if(!(l=fread(string,1,l,fptr))) { if(errno) { perror("ReadData()"); abt(__FILE__,__LINE__,"Aborting\n"); } break; } *(string+l)=(char)0; string=buffer; for(;;) { eor=0; skip_this=(lineno<=skip)?1:0; if(fs) { string_start=string; #if HAVE_REGCOMP if(fs_reg) { if(regexec(&preg,string_start,1,&pmatch,0)) { while((ch= *(string++))) { if(ch=='\n') lineno++; if(rs) if(ch==rs[0]) { eor=1; break; } } } else { string=string_start+pmatch.rm_eo; for(i=0;i<(int)pmatch.rm_eo;i++) { ch=string_start[i]; if(ch=='\n') lineno++; if(rs) if(ch==rs[0]) { eor=1; string=string_start+i+1; break; } } if(!eor) string_start[pmatch.rm_so]='\0'; ch=1; } } else #endif { while((ch= *(string++))) { if(ch=='\n') lineno++; if(ch==fs[0]) break; if(rs) if(ch==rs[0]) { eor=1; break; } } } } else { while((ch= *(string++))) { if(ch=='\n') lineno++; if(rs) if(ch==rs[0]) { eor=1; break; } if(!isspace((int)ch)) break; } if(!ch) { string=buffer; break; } string_start=string-1; elem=infile->element[realcol]; if(elem && elem->type&ST_MARKER) { if(gs && *gs && (!isspace((int)*gs) || gs[1])) i=0; else i=1; } else i=0; if(!eor) { while((ch= *(string++))) { if(rs) if(ch==rs[0]) { eor=1; break; } j=0; if(i && gs) { gs1=gs; while(*gs1) if(ch==*(gs1++)) { j=1; break; } } if(j || isspace((int)ch)) { if(!i) break; i--; while((ch=*(string++))) { if(ch=='\n') lineno++; if(rs) if(ch==rs[0]) { eor=1; break; } if(!isspace((int)ch)) break; } if(!ch) break; } } if(ch=='\n') lineno++; } } *(string-1)=(char)0; string_leng=strlen(string_start); if(!ch) { if(buffer!=string_start) (void)memmove(buffer,string_start,string_leng); string=buffer+string_leng; break; } if(string_start[0]) qstrip(string_start); if(!skip_this) { elem=infile->element[realcol]; if(elem && (string_start[0] || !eor)) { miss=string_start[0]?handle_string(string_start,infile,elem,col,gs):1; if(miss) { set_missing(col,ncol,DataBlock->record_ptr,DataBlock); if(elem->type&ST_ID) print_scan_err("[%s:%d] %s(): Line %d column %d - Missing id variable\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1); if(elem->type&ST_FAMILY) print_scan_err("[%s:%d] %s(): Line %d column %d - Missing family variable\n",__FILE__,__LINE__,FUNC_NAME,lineno,col+1); } col++; } } realcol++; if(realcol==infile->nvar || eor || (rs && col==ncol)) { if(col) { for(;colrecord_ptr,DataBlock); num_records++; update_datablock(ncol); } realcol=col=0; if(rs) while(!eor) { while((ch= *(string++))) { if(ch=='\n') lineno++; if(ch==rs[0]) { eor=1; break; } } if(!ch) { string=buffer; if(!(l=fread(string,1,BUFFER_SIZE,fptr))) { if(errno) { perror("ReadData()"); abt(__FILE__,__LINE__,"Aborting\n"); } eor=1; break; } *(string+l)=(char)0; } } if(!(lineno%LINE_COUNT)) (void)printf("At %d\n",lineno); } } } if(miss_var) { for(i=0;ishell_flag) do i=wait(&j); while(i>0); #if HAVE_REGCOMP if(fs_reg) regfree(&preg); #endif infile->n_records=num_records; (void)printf("%d records of %d columns read in\n",num_records,ncol); if(flog) (void)fprintf(flog," Read %d records of %d columns from '%s'\n",num_records,ncol,infile->name); free(buffer); } infile=infile->next; } if(scan_error_n || !num_nodes) return; if(flog && flog!=stdout) (void)fclose(flog); if(!(recode_table=calloc((size_t)num_nodes,sizeof(struct recode_table_tag)))) ABT_FUNC(MMsg); for(i=j=0;itype&ST_NOT_REALLY_REQUIRED)) { memcpy(markers+j,markers+i,sizeof(struct Marker)); j++; } } n_markers=j; if(!j) { free(markers); markers=0; } setup_pedigree(num_nodes,recode_table,lfile); if(scan_error_n) return; for(i=0;isex_exp[i]) { if(sd->sex_exp[i]->type==ST_STRING) if(sd->sex_exp[i]->arg.string) free(sd->sex_exp[i]->arg.string); free(sd->sex_exp[i]); } sex_def=sd->next; free(sd); sd=sex_def; } prune_pedigree(lfile); check_sex2(); count_components(lfile); /* count_relationships(); */ if(OutputFile) Output_Data(); if(OutputRawFile) Output_Raw_Data(); } loki/prepsrc/recode_fact.c0100644000076500007650000002515407646742735015106 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * recode_factors.c: * * * * Recodes factorial data. * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "scan.h" #include "control_parse.h" struct var_element **var_factors=0; int n_factors; static int factor,*tmp_rec; static void check_for_factor(struct bin_node *node,int *i) { int j; struct var_element *elem; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) { elem=sd->element+j; if((elem->type&ST_FACTOR) && !(elem->type&(ST_HAPLO|ST_MARKER|ST_TRAITLOCUS|ST_ID|ST_SIRE|ST_DAM|ST_FAMILY))) (*i)++; } } static void list_factors(struct bin_node *node,int *i) { int j; struct var_element *elem; struct scan_data *sd; sd=node->data; for(j=0;jn_elements;j++) { elem=sd->element+j; if((elem->type&ST_FACTOR) && !(elem->type&(ST_HAPLO|ST_MARKER|ST_TRAITLOCUS|ST_ID|ST_SIRE|ST_DAM|ST_FAMILY))) var_factors[(*i)++]=elem; } } static int tmp_cmp(const void *s1,const void *s2) { int i1,i2; i1=tmp_rec[*(const int *)s1]; i2=tmp_rec[*(const int *)s2]; if(i1type) { case STRING: i=strcasecmp(n1->data.string,n2->data.string); break; case INTEGER: i= n1->data.value - n2->data.value; break; default: ABT_FUNC("Internal error - invalid type\n"); } return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "recode_factors" void recode_factors(int num_nodes,struct recode_table_tag *recode_table) { int i,j,k,ncol,col,ind,*trans,*perm; struct InFile *infile; struct DataBlock *db; struct var_element *elem; n_factors=0; check_vars(root_var,&n_factors,check_for_factor); if(n_factors+n_markers) if(!(factor_recode=calloc((size_t)(n_factors+n_markers),sizeof(struct label_node **)))) ABT_FUNC(MMsg); if(!n_factors) return; (void)fputs("Recoding factors\n",stdout); if(!(var_factors=malloc(sizeof(void *)*n_factors))) ABT_FUNC(MMsg); n_factors=0; check_vars(root_var,&n_factors,list_factors); for(factor=0;factorn_records) { ncol=infile->ncol; for(col=i=0;invar;i++) if(infile->element[i]) { if(elem==infile->element[i]) { db=infile->data; while(db) { for(j=0;jrecord_ptr;j++) if(!check_missing(col,ncol,j,db)) { ind=db->records[j*ncol+col].node->index; if(!recode_table[ind].index) { recode_table[ind].index= ++k; recode_table[ind].node=db->records[j*ncol+col].node; } db->records[j*ncol+col].value=recode_table[ind].index; } db=db->next; } break; } col++; } } infile=infile->next; } elem->n_levels=k; elem->index=factor; if(k) { if(!(factor_recode[factor]=malloc(sizeof(struct label_node *)*k))) ABT_FUNC(MMsg); if(!(perm=malloc(sizeof(int)*k*2))) ABT_FUNC(MMsg); trans=perm+k; for(i=0;in_records) { ncol=infile->ncol; for(col=i=0;invar;i++) if(infile->element[i]) { if(elem==infile->element[i]) { db=infile->data; while(db) { for(j=0;jrecord_ptr;j++) if(!check_missing(col,ncol,j,db)) { k=db->records[j*ncol+col].value; db->records[j*ncol+col].value=trans[k-1]+1; } db=db->next; } break; } col++; } } infile=infile->next; } free(perm); } } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "recode_marker_data" void recode_marker_data(int num_nodes,struct recode_table_tag *recode_table) { int i,j,k,hap[2],ncol,col,marker,nv,nvar,ind,id,haplo[2],haplo1[2],col_list[2],*tmp_perm,gtflag; struct InFile *infile; struct DataBlock *db; struct var_element *elem,*elem1,**elem_list; struct gt_data *gt; (void)fputs("Recoding marker data\n",stdout); for(marker=0;markertype&ST_DATA) { elem1=elem; gtflag=1; } else { elem=markers[marker].hap_element[0]; elem1=markers[marker].hap_element[1]; gtflag=0; } if(!(elem || elem1)) continue; while(infile) { if(infile->n_records) { nvar=infile->nvar; elem_list=infile->element; for(nv=col=i=0;i2-gtflag) ABT_FUNC("Internal error: variable occurs too often in file list\n"); if(nv) { ncol=infile->ncol; db=infile->data; while(db) { for(j=0;jrecord_ptr;j++) { id=(int)db->records[j*ncol+infile->id_col].value; if(!id) ABT_FUNC("Internal error - null id\n"); if(id_array[id-1].haplo[0]) { for(i=0;i<2;i++) { haplo[i]=id_array[id-1].haplo[i][marker]; id_array[id-1].haplo[i][marker]=0; } } else haplo[0]=haplo[1]=0; for(i=0;irecords[j*ncol+col].gt_data; if(gt->node1) { ind=gt->node1->index; if(!recode_table[ind].index) { recode_table[ind].index= ++k; recode_table[ind].node=gt->node1; } if(!id_array[id-1].haplo[0]) { if(!(id_array[id-1].haplo[0]=calloc(2*(size_t)n_markers,sizeof(int)))) ABT_FUNC(MMsg); id_array[id-1].haplo[1]=id_array[id-1].haplo[0]+n_markers; } id_array[id-1].haplo[0][marker]=recode_table[ind].index; } if(gt->node2) { ind=gt->node2->index; if(!recode_table[ind].index) { recode_table[ind].index= ++k; recode_table[ind].node=gt->node2; } if(!id_array[id-1].haplo[0]) { if(!(id_array[id-1].haplo[0]=calloc(2*(size_t)n_markers,sizeof(int)))) ABT_FUNC(MMsg); id_array[id-1].haplo[1]=id_array[id-1].haplo[0]+n_markers; } id_array[id-1].haplo[1][marker]=recode_table[ind].index; } free(gt); gt=db->records[j*ncol+col].gt_data=0; } else { ind=db->records[j*ncol+col].node->index; if(!recode_table[ind].index) { recode_table[ind].index= ++k; recode_table[ind].node=db->records[j*ncol+col].node; } db->records[j*ncol+col].node=0; if(!id_array[id-1].haplo[0]) { if(!(id_array[id-1].haplo[0]=calloc(2*(size_t)n_markers,sizeof(int)))) ABT_FUNC(MMsg); id_array[id-1].haplo[1]=id_array[id-1].haplo[0]+n_markers; } id_array[id-1].haplo[hap[i]][marker]=recode_table[ind].index; } } } if(id_array[id-1].haplo[0]) { for(i=0;i<2;i++) haplo1[i]=id_array[id-1].haplo[i][marker]; for(i=0;i<2;i++) if(haplo[i] && haplo1[i] && haplo[i]!=haplo1[i]) break; if(i<2) for(i=0;i<2;i++) if(haplo[i] && haplo1[i^1] && haplo[i]!=haplo1[i^1]) break; if(i<2) { (void)fprintf(stderr,"Marker %s",markers[marker].var->name); if(markers[marker].index) (void)fprintf(stderr,"(%d)",markers[marker].index); (void)fputs(" - Error: individual ",stderr); print_orig_id(stderr,id,0); print_scan_err(" has inconsistent genotype information\n"); } else { for(i=0;i<2;i++) id_array[id-1].haplo[i][marker]=haplo[i]?haplo[i]:haplo1[i]; } } } db=db->next; } } } infile=infile->next; } markers[marker].element->index=marker; markers[marker].element->n_levels=k; if(k) { if(!(tmp_rec=malloc(sizeof(int)*k*2))) ABT_FUNC(MMsg); tmp_perm=tmp_rec+k; for(i=0;i #include #ifdef USE_DMALLOC #include #endif #include #include #include "utils.h" #include "scan.h" #include "control_parse.h" static int op_stack_size=32,op_stack_n; static struct op_stack *Op_Stack; static struct remember *temp_mem_block,*tmb; static int trace_restrict; static const int promote[]={INTEGER,REAL,LOGICAL,MISSING}; /* Order of promotion */ struct op_type { union arg_type arg; int type; }; #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_op_from_stack" static void get_op_from_stack(struct operation *ops) { if(!op_stack_n) ABT_FUNC("Internal error - empty stack\n"); ops->arg=Op_Stack[--op_stack_n].arg; ops->type=Op_Stack[op_stack_n].type; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "add_to_op_stack" static void add_to_op_stack(const struct operation *ops) { if(op_stack_n==op_stack_size) { op_stack_size*=2; if(!(Op_Stack=realloc(Op_Stack,sizeof(struct op_stack)*op_stack_size))) ABT_FUNC(MMsg); } Op_Stack[op_stack_n].arg=ops->arg; Op_Stack[op_stack_n++].type=ops->type; } static struct bin_node *find_hap(struct bin_node *node,struct var_element *elem) { int k; struct bin_node *nd=0; struct scan_data *sd; if(node->left) { nd=find_hap(node->left,elem); if(nd) return nd; } sd=node->data; for(k=0;kn_elements;k++) if(sd->element+k==elem) return node; if(node->right) nd=find_hap(node->right,elem); return nd; } static void print_op_arg(const struct operation *ops) { struct bin_node *node; struct scan_data *sd; int k; switch(ops->type) { case VARIABLE: node=find_hap(root_var,ops->arg.element); if(node) { sd=node->data; (void)fputs(sd->name,stdout); if(sd->vtype&ST_ARRAY) { for(k=0;kn_elements;k++) if(sd->element+k==ops->arg.element) break; (void)printf("(%d)",k+1); } } else (void)fputs("",stdout); break; case INTEGER: (void)printf("%ld",ops->arg.value); break; case REAL: (void)printf("%f",ops->arg.rvalue); break; case LOGICAL: if(ops->arg.value) (void)fputs("",stdout); else (void)fputs("",stdout); break; case MISSING: (void)fputs("",stdout); break; case STRING: if(ops->arg.string) (void)printf("\"%s\"",ops->arg.string); else (void)fputs("",stdout); break; default: (void)fputs("",stdout); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_op_type" static void get_op_type(const struct operation *ops,struct op_type *type,const int id,const int rec) { const struct var_element *elem; int i,j,k,marker,flag; const struct label_data *node; union { double rval; long val; } val; switch(ops->type) { case LOGICAL: case INTEGER: case MISSING: type->type=ops->type; type->arg.value=ops->arg.value; break; case REAL: type->type=REAL; type->arg.rvalue=ops->arg.rvalue; break; case STRING: type->type=STRING; type->arg.string=ops->arg.string; break; case VARIABLE: elem=ops->arg.element; if(elem->type&(ST_ID|ST_SIRE|ST_DAM|ST_HAPLO|ST_MARKER)) i=0; else if(elem->type&ST_CONSTANT) { for(i=0;i=0 && (elem->type&(ST_ID|ST_SIRE|ST_DAM|ST_FAMILY|ST_FACTOR|ST_HAPLO|ST_MARKER))) { node=0; if(elem->type&ST_ID) node=ped_recode[id-1]; else if(elem->type&(ST_SIRE|ST_DAM|ST_FAMILY|ST_MARKER|ST_HAPLO)) { if(elem->type&ST_SIRE) { j=id_array[id-1].sire; if(j) node=ped_recode[j-1]; } else if(elem->type&ST_DAM) { j=id_array[id-1].dam; if(j) node=ped_recode[j-1]; } else if(elem->type&ST_FAMILY) { j=id_array[id-1].fam_code; if(j) node=family_recode[j-1]; } else if(elem->type&ST_HAPLO) { if(id_array[id-1].haplo[0]) { marker=elem->arg.element->index; k=1; if(markers[marker].hap_element[0]==elem) k=0; else if(markers[marker].hap_element[1]!=elem) ABT_FUNC(IntErr); j=id_array[id-1].haplo[k][marker]; if(j) node=factor_recode[n_factors+marker][j-1]; } } else if(elem->type&ST_MARKER) { type->type=LOGICAL; type->arg.value=0; if(id_array[id-1].haplo[0]) { marker=elem->index; if(id_array[id-1].haplo[0][marker] || id_array[id-1].haplo[0][marker]) type->arg.value=1; } return; } else ABT_FUNC(IntErr); } else if(elem->type&ST_CONSTANT) { if(id_array[id-1].data) if(id_array[id-1].data[i].flag) { j=(int)id_array[id-1].data[i].data.value; node=factor_recode[elem->index][j-1]; } } else if(id_array[id-1].data1) { if(id_array[id-1].data1[rec][i].flag) { j=(int)id_array[id-1].data1[rec][i].data.value; node=factor_recode[elem->index][j-1]; } } if(!node) { type->type=MISSING; type->arg.value=0; } else if(elem->type&ST_INTTYPE) { if(node->type!=INTEGER) ABT_FUNC(IntErr); type->type=INTEGER; type->arg.value=node->data.value; } else { if(node->type!=STRING) ABT_FUNC(IntErr); type->type=STRING; type->arg.string=node->data.string; } return; } else if(i>=0) { flag=0; if(elem->type&ST_CONSTANT) { if(id_array[id-1].data) if(id_array[id-1].data[i].flag) { flag=1; if(elem->type&ST_INTTYPE) val.val=id_array[id-1].data[i].data.value; else val.rval=id_array[id-1].data[i].data.rvalue; } } else if(id_array[id-1].data1) { if(id_array[id-1].data1[rec][i].flag) { flag=1; if(elem->type&ST_INTTYPE) val.val=id_array[id-1].data1[rec][i].data.value; else val.rval=id_array[id-1].data1[rec][i].data.rvalue; } } if(!flag) { type->type=MISSING; type->arg.value=0; } else if(elem->type&ST_INTTYPE) { type->type=INTEGER; type->arg.value=val.val; } else { type->type=REAL; type->arg.rvalue=val.rval; } return; } type->type=MISSING; type->arg.value=0; break; default: ABT_FUNC("Internal error: wrong op type\n"); } return; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "promote_type" static void promote_type(struct op_type *type,const int rtype) { switch(rtype) { case MISSING: case LOGICAL: if(type->type==INTEGER || type->type==REAL) { type->arg.value=1; type->type=LOGICAL; } break; case REAL: if(type->type==INTEGER) type->arg.rvalue=(double)type->arg.value; else ABT_FUNC(IntErr); type->type=REAL; break; default: ABT_FUNC("Internal error: invalid type\n"); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_string_op" static void do_string_op(const int op,const struct op_type *type,const struct op_type *type1,struct operation *res) { char *s,*s1; s=s1=0; if(type->type==STRING) s=type->arg.string; if(type1->type==STRING) s1=type1->arg.string; if(!(s || s1)) ABT_FUNC(IntErr); res->type=LOGICAL; switch(op) { case '+': res->type=STRING; if(s && s1) { if(!(res->arg.string=malloc(strlen(s)+strlen(s1)+1))) ABT_FUNC(MMsg); temp_mem_block=AddRemem(res->arg.string,temp_mem_block); (void)strcpy(res->arg.string,s); (void)strcat(res->arg.string,s1); } else if(s) res->arg.string=s; else if(s1) res->arg.string=s1; break; case '<': if(s && s1) res->arg.value=(strcmp(s,s1)<0)?1:0; else if(s) res->arg.value=type1->arg.value; else res->arg.value=1-type->arg.value; break; case '>': if(s && s1) res->arg.value=(strcmp(s,s1)>0)?1:0; else if(s) res->arg.value=1-type1->arg.value; else res->arg.value=type->arg.value; break; case '=': if(s && s1) res->arg.value=strcmp(s,s1)?0:1; else if(s) res->arg.value=type1->arg.value; else res->arg.value=type->arg.value; break; case NEQSYMBOL: if(s && s1) res->arg.value=strcmp(s,s1)?1:0; else if(s) res->arg.value=1-type1->arg.value; else res->arg.value=1-type->arg.value; break; case GEQSYMBOL: if(s && s1) res->arg.value=(strcmp(s,s1)<=0)?0:1; else if(s) res->arg.value=1-type1->arg.value; else res->arg.value=type->arg.value; break; case LEQSYMBOL: if(s && s1) res->arg.value=(strcmp(s,s1)<=0)?0:1; else if(s) res->arg.value=type1->arg.value; else res->arg.value=1-type->arg.value;; break; case ANDSYMBOL: if(s && s1) res->arg.value=1; else if(s) res->arg.value=type1->arg.value; else res->arg.value=type->arg.value; break; case ORSYMBOL: res->arg.value=1; break; default: ABT_FUNC("Internal error: invalid string operator\n"); } } int try_numeric(struct op_type *type) { long l; double x; char *s; int i=0; l=strtol(type->arg.string,&s,10); if(!(*s)) { type->type=INTEGER; type->arg.value=l; i=1; } else { x=strtod(type->arg.string,&s); if(!(*s)) { type->type=REAL; type->arg.rvalue=x; i=1; } } return i; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_arith_op" static void do_arith_op(const int op,const struct operation *ops,const struct operation *ops1,struct operation *res,const int id, const int rec) { struct op_type type,type1; int i,t,t1; get_op_type(ops,&type,id,rec); if(ops1) get_op_type(ops1,&type1,id,rec); else type1.type=0; if(type.type==STRING) { if(type1.type==STRING) { do_string_op(op,&type,&type1,res); return; } else if(type1.type==LOGICAL) { do_string_op(op,&type,&type1,res); return; } else if(op==ANDSYMBOL || op==ORSYMBOL) { res->type=LOGICAL; if(op==ANDSYMBOL && type1.type==MISSING) res->arg.value=0; else res->arg.value=1; return; } else if(type1.type==MISSING && (op=='=' || op==NEQSYMBOL)) { res->type=MISSING; res->arg.value=0; return; } else if(!try_numeric(&type)) ABT_FUNC("Error: incompatible operators\n"); } else if(type1.type==STRING) { if(type.type==LOGICAL) { do_string_op(op,&type,&type1,res); return; } else if(op==ANDSYMBOL || op==ORSYMBOL) { res->type=LOGICAL; if(op==ANDSYMBOL && type1.type==MISSING) res->arg.value=0; else res->arg.value=1; return; } else if(type.type==MISSING && (op=='=' || op==NEQSYMBOL)) { res->type=MISSING; res->arg.value=0; return; } else if(!try_numeric(&type1)) ABT_FUNC("Error: incompatible operators\n"); } if(ops1) { t=t1= -1; for(i=0;i<4;i++) { if(promote[i]==type.type) t=i; if(promote[i]==type1.type) t1=i; } if(t<0 || t1<0) ABT_FUNC(IntErr); res->type=(t>t1)?promote[t]:promote[t1]; if(res->type!=type.type) promote_type(&type,res->type); if(res->type!=type1.type) promote_type(&type1,res->type); } else res->type=type.type; switch(op) { case '+': if(res->type==REAL) res->arg.rvalue=type.arg.rvalue+type1.arg.rvalue; else res->arg.value=type.arg.value+type1.arg.value; break; case '-': case UMINUS: if(res->type==REAL) { if(ops1) res->arg.rvalue=type.arg.rvalue-type1.arg.rvalue; else res->arg.rvalue= -type.arg.rvalue; } else { if(ops1) res->arg.value=type.arg.value-type1.arg.value; else res->arg.value= -type.arg.value; } break; case '*': if(res->type==REAL) res->arg.rvalue=type.arg.rvalue*type1.arg.rvalue; else res->arg.value=type.arg.value*type1.arg.value; break; case '/': i=0; if(res->type==REAL) { if(type1.arg.rvalue==0.0) i=1; else res->arg.rvalue=type.arg.rvalue/type1.arg.rvalue; } else { if(type1.arg.value==0) i=1; else res->arg.value=type.arg.value/type1.arg.value; } if(i) { res->type=LOGICAL; res->arg.value=0; } break; case '<': if(res->type==REAL) res->arg.value=(type.arg.rvaluearg.value=(type.arg.valuetype!=MISSING) res->type=LOGICAL; break; case '>': if(res->type==REAL) res->arg.value=(type.arg.rvalue>type1.arg.rvalue); else res->arg.value=(type.arg.value>type1.arg.value); if(res->type!=MISSING) res->type=LOGICAL; break; case '=': if(res->type==REAL) res->arg.value=(type.arg.rvalue==type1.arg.rvalue); else res->arg.value=(type.arg.value==type1.arg.value); if(res->type!=MISSING) res->type=LOGICAL; break; case NEQSYMBOL: if(res->type==REAL) res->arg.value=(type.arg.rvalue!=type1.arg.rvalue); else res->arg.value=(type.arg.value!=type1.arg.value); if(res->type!=MISSING) res->type=LOGICAL; break; case GEQSYMBOL: if(res->type==REAL) res->arg.value=(type.arg.rvalue>=type1.arg.rvalue); else res->arg.value=(type.arg.value>=type1.arg.value); if(res->type!=MISSING) res->type=LOGICAL; break; case LEQSYMBOL: if(res->type==REAL) res->arg.value=(type.arg.rvalue<=type1.arg.rvalue); else res->arg.value=(type.arg.value<=type1.arg.value); if(res->type!=MISSING) res->type=LOGICAL; break; case ANDSYMBOL: if(res->type==LOGICAL || res->type==MISSING) res->arg.value=(type.arg.value && type1.arg.value); else { res->arg.value=1; res->type=LOGICAL; } break; case ORSYMBOL: if(res->type==LOGICAL) res->arg.value=(type.arg.value || type1.arg.value); else if(res->type==MISSING) { if(!(type.type==MISSING && type1.type==MISSING)) { res->arg.value=type.arg.value || type1.arg.value; res->type=LOGICAL; } else res->arg.value=0; } else { res->arg.value=1; res->type=LOGICAL; } break; default: ABT_FUNC("Internal error: invalid operator\n"); } } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "do_arith_op" static char *op_name(const int op) { switch(op) { case '+': return "+"; case '-': return "-"; case '*': return "*"; case '/': return "/"; case '<': return "<"; case '>': return ">"; case '=': return "="; case NEQSYMBOL: return "!="; case GEQSYMBOL: return ">="; case LEQSYMBOL: return "<="; case ANDSYMBOL: return "AND"; case ORSYMBOL: return "OR"; case NOTSYMBOL: return "NOT"; case UMINUS: return "-"; default: ABT_FUNC("Internal error: invalid operator\n"); } /* Never gets here */ return "!FAULT!"; } static void do_op(const struct operation *ops,const int id,const int rec) { struct operation result,arg1,arg2; int op; struct op_type type; op=ops->op; if(!ops->type) get_op_from_stack(&arg1); else { arg1.type=ops->type; arg1.arg=ops->arg; } if(trace_restrict>1) (void)fputs(" ",stdout); switch(op) { case 0: if(trace_restrict>1) print_op_arg(&arg1); get_op_type(&arg1,&type,id,rec); result.type=type.type; result.arg=type.arg; break; case NOTSYMBOL: if(trace_restrict>1) { (void)printf(" %s ",op_name(op)); print_op_arg(&arg1); } result.type=LOGICAL; if(arg1.type==LOGICAL || arg1.type==MISSING) result.arg.value=1-arg1.arg.value; else result.arg.value=0; break; case UMINUS: if(trace_restrict>1) { (void)printf(" %s ",op_name(op)); print_op_arg(&arg1); } if(arg1.type==LOGICAL) { result.arg.value=1-arg1.arg.value; result.type=LOGICAL; } else do_arith_op(op,&arg1,0,&result,id,rec); break; default: get_op_from_stack(&arg2); if(trace_restrict>1) { print_op_arg(&arg2); (void)printf(" %s ",op_name(op)); print_op_arg(&arg1); } do_arith_op(op,&arg2,&arg1,&result,id,rec); } if(trace_restrict>1) { (void)printf(" [ = "); print_op_arg(&result); (void)printf(" ]\n"); } add_to_op_stack(&result); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "restrict_data" void restrict_data(void) { int i,j,k,k2,id,marker,rec,res_no; struct var_element *elem; struct Restrict *restriction; struct operation *op,result; struct bin_node *node; struct scan_data *sd; (void)printf("Handling data restrictions\n"); restriction=Restrictions; j=0; while(restriction) { (void)printf("Restriction %d: ",++j); for(i=k=0;invar;i++) { elem=restriction->element[i]; if(!(elem->type&ST_REQUIRED)) continue; if(k++) (void)fputc(',',stdout); node=find_hap(root_var,elem); if(node) { sd=node->data; (void)fputs(sd->name,stdout); if(sd->vtype&ST_ARRAY) { for(k2=0;k2n_elements;k2++) if(sd->element+k2==elem) break; (void)printf("(%d)",k2+1); } } else (void)fputs("",stdout); } if(!restriction->nvar) (void)fputs("",stdout); (void)fputc('\n',stdout); restriction=restriction->next; } trace_restrict=syst_var[TRACE_RESTRICT]; if(!(Op_Stack=malloc(sizeof(struct op_stack)*op_stack_size))) ABT_FUNC(MMsg); for(id=1;id<=ped_size;id++) if(id_array[id-1].data || id_array[id-1].data1 || id_array[id-1].haplo[0]) { if(!(tmb=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); temp_mem_block=tmb; temp_mem_block->pos=0; temp_mem_block->next=0; if(id_array[id-1].flag&4) continue; j=id_array[id-1].nrec; if(j) k2=j; else k2=1; restriction=Restrictions; res_no=0; while(restriction) { res_no++; for(i=0;invar;i++) { elem=restriction->element[i]; elem->type&=~ST_FLAG; } for(rec=0;recOp_List; while(op) { do_op(op,id,rec); op=op->next; } if(trace_restrict) { (void)fputs("ID ",stdout); print_orig_id(stdout,id,0); (void)printf(" Rest. %d, Rec %d ",res_no,rec+1); (void)fputs(" RESULT: ",stdout); } get_op_from_stack(&result); if(op_stack_n) ABT_FUNC("Internal error: some operations remaining on stack\n"); if(result.type!=LOGICAL) { result.arg.value=(result.type==MISSING)?0:1; result.type=LOGICAL; } if(trace_restrict) { print_op_arg(&result); (void)fputs("\n",stdout); } if(result.arg.value) for(i=0;invar;i++) { elem=restriction->element[i]; if(elem->type&ST_CONSTANT) elem->type|=ST_FLAG; } else if(restriction->nvar) { for(i=0;invar;i++) { elem=restriction->element[i]; if(!(elem->type&ST_REQUIRED) || (elem->type&ST_FLAG)) continue; if((elem->type&ST_CONSTANT) && rec<(k2-1)) continue; if(elem->type&ST_ID) { id_array[id-1].flag|=4; if(id_array[id-1].haplo[0]) { free(id_array[id-1].haplo[0]); id_array[id-1].haplo[0]=0; id_array[id-1].haplo[1]=0; } } else if(elem->type&ST_HAPLO) { if(id_array[id-1].haplo[0]) { marker=elem->arg.element->index; if(markers[marker].hap_element[0]==elem) k=0; else k=1; id_array[id-1].haplo[k][marker]=0; } } else if(elem->type&ST_MARKER) { if(id_array[id-1].haplo[0]) { marker=elem->index; id_array[id-1].haplo[0][marker]=id_array[id-1].haplo[1][marker]=0; } } else if(elem->type&ST_CONSTANT) { if(id_array[id-1].data) for(k=0;knext; } FreeRemem(tmb); } free(Op_Stack); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "cleanup_unused" void cleanup_unused(void) { int id,k,k2,k3,k4,rec,*tmp,*tmp1,marker; for(k=0;ktype&(ST_TRAIT|ST_MODEL))) { for(id=0;idtype&(ST_TRAIT|ST_MODEL))) { for(id=0;idtype&(ST_TRAIT|ST_MODEL)) break; k3=ktype&(ST_TRAIT|ST_MODEL)) break; k4=ktype&(ST_TRAIT|ST_MODEL)) { if(!id_array[id].data[k].flag) break; } if(ktype&(ST_TRAIT|ST_MODEL)) { if(!id_array[id].data1[rec][k].flag) break; } if(kn_levels; if(!k) continue; if(!(tmp=calloc((size_t)(k*2),sizeof(int)))) ABT_FUNC(MMsg); tmp1=tmp+k; for(id=0;idn_levels=k3; for(id=0;idpos=0; temp_mem_block->next=0; j=id_array[id-1].nrec; if(j) k2=j; else if(id_array[id-1].data) k2=1; else k2=0; censor=Censored; while(censor) { cens_no++; elem=censor->element; for(rec=0;recOp_List; while(op) { do_op(op,id,rec); op=op->next; } if(trace_restrict) { (void)fputs("ID ",stdout); print_orig_id(stdout,id,0); (void)printf(" Cens. %d, Rec %d ",cens_no,rec+1); (void)fputs(" RESULT: ",stdout); } get_op_from_stack(&result); if(op_stack_n) ABT_FUNC("Internal error: some operations remaining on stack\n"); if(result.type!=LOGICAL && result.type!=MISSING) { result.type=LOGICAL; result.arg.value=1; } if(trace_restrict) { print_op_arg(&result); (void)fputs("\n",stdout); } if(result.arg.value) k=2; else k=4; if(id_array[id-1].data) { for(j=0;jarg.var->data; (void)fprintf(stderr," - No censoring information for %s. Record will be ignored.\n",sd->name); } } } break; } } if(id_array[id-1].nrec && id_array[id-1].data1) { for(j=0;jarg.var->data; (void)fprintf(stderr," - No censoring information for %s. Record will be ignored.\n",sd->name); } } } break; } } } censor=censor->next; } FreeRemem(tmb); } free(Op_Stack); } static struct operation *proc_op(struct operation *op,int id,int rec) { static struct operation result; while(op) { do_op(op,id,rec); op=op->next; } if(trace_restrict) { (void)fputs("ID ",stdout); print_orig_id(stdout,id,0); (void)printf(" Aff. - Rec %d ",rec+1); (void)fputs(" RESULT: ",stdout); } get_op_from_stack(&result); if(op_stack_n) ABT_FUNC("Internal error: some operations remaining on stack\n"); if(result.type!=LOGICAL && result.type!=MISSING) { result.type=LOGICAL; result.arg.value=1; } if(trace_restrict) { print_op_arg(&result); (void)fputs("\n",stdout); } return &result; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "affected_data" void affected_data(void) { int j,k,k2,id,rec; struct operation *result; (void)fputs("Handling affected data codes\n",stdout); trace_restrict=syst_var[TRACE_AFFECTED]; if(!(Op_Stack=malloc(sizeof(struct op_stack)*op_stack_size))) ABT_FUNC(MMsg); for(id=1;id<=ped_size;id++) if(id_array[id-1].data || id_array[id-1].data1) { if(id_array[id-1].flag&4) continue; if(!(tmb=malloc(sizeof(struct remember)))) ABT_FUNC(MMsg); temp_mem_block=tmb; temp_mem_block->pos=0; temp_mem_block->next=0; id_array[id-1].affected=0; j=id_array[id-1].nrec; if(j) k2=j; else if(id_array[id-1].data) k2=1; else k2=0; for(rec=0;rectype!=MISSING) k=result->arg.value?2:1; if(k!=2 && Unaffected) { k=0; result=proc_op(Unaffected,id,rec); if(result->type!=MISSING && result->arg.value) k=1; else if(scan_error_n++=1 for arrays */ int vtype; }; struct var_list { struct var_list *next; struct bin_node *var; int index; }; struct label_data { union { char *string; long value; } data; int type,index,balance; }; struct InFile { struct InFile *next; char *name; int shell_flag; int nvar,ncol,n_records,id_col,family_col; struct var_element **element; struct format *format; struct fformat *fformat; struct DataBlock *data; }; struct Id_Record { int *kids,*famlist; int *haplo[2]; int *mkflag; struct id_data *data,**data1; int sire,dam; int nfam,nkids; int fam_code; int rf_idx; int sex,affected; int family; int component; int group; int flag,nrec,order; int fc_flag; int nhaps[2],ngens,ngens1,sg[2]; int allele[2]; }; struct Family { int *kids; int sire,dam; int nkids; }; struct format { int n_atoms,line; struct format_atom *f_atoms; }; struct Marker { int index; int link; int **order,*o_size; int **allele_trans; struct scan_data *var; struct var_element *element,*hap_element[2]; }; struct format_clause { int n_atoms,fc_size; struct format_atom **f_atoms; }; struct fformat { char *fs; char *rs; char *gs; int skip; }; struct format_atom { int size,pos; }; struct model { struct model *next; struct scan_data *trait; struct model_list *model_list; int index; }; struct model_list { struct model_list *next; struct var_element **element; int nvar; }; struct Link { struct Link *next; char *name; struct var_element **element; int n_loci; int type; }; struct Miss { struct Miss *next; struct express Missing; struct var_element **element; char *scope; int nvar; }; struct op_stack { union arg_type arg; int type; }; struct operation { struct operation *next; union arg_type arg; int type,op; }; struct Restrict { struct Restrict *next; struct operation *Op_List; struct var_element **element; int nvar; int flag; }; struct Censor { struct Censor *next; struct operation *Op_List; struct var_element *element; }; struct gt_data { struct label_data *node1,*node2; }; union DataRec { struct label_data *node; struct gt_data *gt_data; long value; double rvalue; }; struct DataBlock { struct DataBlock *next; unsigned char *type; union DataRec *records; int blocksize,record_ptr; }; struct recode_table_tag { struct label_data *node; int index; }; struct sex_def { struct sex_def *next; struct express *sex_exp[2]; struct var_element *sex_elem; }; extern void WriteData(char *); extern void WriteXMLData(char *); extern void free_nodes(void); extern void setup_pedigree(int,struct recode_table_tag *,char *); extern void recode_factors(int,struct recode_table_tag *); extern void recode_marker_data(int,struct recode_table_tag *); extern int check_missing(int,int,int,struct DataBlock *); extern int Calculate_NRM(char *); extern void check_vars(struct bin_node *,int *,void (*func)(struct bin_node *,int *)); extern void free_infile(struct InFile *); extern void prune_pedigree(char *); extern void count_components(char *); extern void free_restrict(struct Restrict *); extern void affected_data(void); extern void restrict_data(void); extern void print_orig_alleles(FILE *,const int,const int,const int); extern void censored_data(void); extern void cleanup_unused(void); extern void count_relationships(void); extern void Output_Data(void); extern void Output_Raw_Data(void); extern void print_orig_id(FILE *,const int,const int); extern void print_orig_id1(FILE *,const int,const int); extern void print_orig_family(FILE *,const int,const int); extern void print_orig_triple(FILE *,const int); extern void match_records(void); extern void free_var(struct bin_node *); extern void WriteReport(char *); extern void New_DFE(const char *,const int,const char *); extern int Genotype_Elimination(int,char *,int); extern void InitFamilies(char *); extern void check_ymark(void); extern void free_op(struct operation *); extern void yyerror(char *); extern void yyerror1(char *); extern void check_sex(void),check_sex2(void),count_loops(char *),handle_groups(char *),check_inbreeding(char *); extern struct label_data *find_node(const void *,int,int); extern int ReadControl(FILE *,char *,char **); extern struct InFile *Infiles; extern struct bin_node *root_var; extern struct Link *links; extern struct Miss *Miss; extern struct Restrict *Restrictions; extern struct Censor *Censored; extern struct operation *Affected,*Unaffected; extern struct model *Models; extern struct Marker *markers,*traitlocus; extern struct Id_Record *id_array; extern struct var_element **var_factors; extern struct label_data **ped_recode,**family_recode,**group_recode,***factor_recode; extern struct Family *family; extern struct remember *RemBlock; extern int *rec_tab,*rec_tab1; extern char linebuf[],linebuf1[],*Filter,*gsformat,*rsformat,*fsformat,*OutputFile,*OutputLaurFile,*OutputRawFile,*ErrorDir; extern int nfiles,scan_error,scan_error_n,scan_warn_n,file_skip; extern int lineno,lineno1,at_file,at_model,at_use,begin_comm; extern int max_scan_errors,max_scan_warnings,nrm_flag,n_genetic_groups; extern int ped_size,pruned_ped_size,*ped_recode1,n_factors,n_markers,n_id_records,n_nonid_records; extern int n_comp,*comp_size,n_orig_families,n_families,verbose,family_id,sig_caught,catch_sigs,sig_quiet; extern struct sex_def *sex_def; extern struct var_element *group_elem; extern unsigned int RunID; #define MAX_LOOP 16 #define MAX_INCLUDE 16 extern int loop_level,loop_ptr[MAX_LOOP],loop_stat[MAX_LOOP],loop_record,loop_stack_size,comp_sflag; extern int loop_main_ptr,in_loopclause,loop_clause_end,loop_clause_step,loop_clause_ptr,trace_peel,strip_vars; extern struct var_element *loop_clause_element,**id_elements,**nonid_elements; extern FILE *yyin; #define SCAN_ERR 1 #define PED_ERR 8 #define FILE_ERR 16 #define FORMAT_ERR 32 #define LINK_ERR 64 #define NUM_SYSTEM_VAR 16 extern int syst_var[NUM_SYSTEM_VAR]; #define PRUNE_OPTION 0 #define RECODE_OPTION 1 #define NO_EXTRA_ALLELE 2 #define PEEL_OPTION 3 #define TRACE_RESTRICT 4 #define TRACE_CENSORED 5 #define TRACE_AFFECTED 6 #define CORRECT_ERRORS 7 #define PEEL_TRACE 8 #define MULTIPLE_RECORDS 9 #define MULTIVARIATE_TEST 10 #define ERROR_CHECK 11 #define NO_DEFAULT_MISSING 12 #define SKIP_BAD_REALS 13 #define SKIP_BAD_INTS 14 #define IGNORE_CASE 15 #endif loki/prepsrc/scanner.h0100644000076500007650000000047107646742735014301 0ustar heathheath#ifndef _SCANNER_H_ #define _SCANNER_H_ struct token_store { YYSTYPE yylval; int token,line,line1; }; extern struct token_store *loop_stack; extern int yylex(void); extern int yyparse(void); extern void include_control_file(char *); extern char *fname_list[MAX_INCLUDE+1]; extern int list_ptr,iflag; #endif loki/prepsrc/setup_ped.c0100644000076500007650000010020607747751404014623 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * March 1997 * * * * setup_ped.c: * * * * Sets up pedigree structures and recodes ids * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #ifdef USE_DMALLOC #include #endif #include #include #ifdef HAVE_LIMITS_H #include #endif #include "utils.h" #include "control_parse.h" #include "scan.h" int pruned_ped_size,n_comp,*comp_size,verbose=3,comp_sflag,n_orig_families; int *rec_tab,*rec_tab1,n_genetic_groups=1; struct label_data **group_recode; struct Id_Record *id_array=0; void print_orig_family(FILE *fptr,const int id,const int fg) { int fam; fam=id>0?id_array[id-1].fam_code:0; if(fg) { if(!fam || !family_recode[fam-1]) (void)fputs("[*]:",fptr); else if(family_recode[fam-1]->type==STRING) (void)fprintf(fptr,"[%s]:",family_recode[fam-1]->data.string); else (void)fprintf(fptr,"[%ld]:",family_recode[fam-1]->data.value); } else { if(!fam || !family_recode[fam-1]) (void)fputs("* ",fptr); else if(family_recode[fam-1]->type==STRING) (void)fprintf(fptr,"%s ",family_recode[fam-1]->data.string); else (void)fprintf(fptr,"%ld ",family_recode[fam-1]->data.value); } } void print_orig_id1(FILE *fptr,const int id,const int fg) { if(!id) (void)fputc('*',fptr); else if(id<0) (void)fprintf(fptr,"BAD ID [%d]",id); else { if(!ped_recode[id-1]) (void)fputc('*',fptr); else if(ped_recode[id-1]->type==STRING) (void)fputs(ped_recode[id-1]->data.string,fptr); else (void)fprintf(fptr,"%ld",ped_recode[id-1]->data.value); } if(fg) (void)fputc(' ',fptr); } void print_orig_id(FILE *fptr,const int id,const int fg) { if(family_id) print_orig_family(fptr,id,1); print_orig_id1(fptr,id,fg); } void print_orig_triple(FILE *fptr,const int id) { if(family_id) { if(id) { print_orig_family(fptr,id,0); } else (void)fputs("* ",fptr); } if(id) { print_orig_id1(fptr,id,1); print_orig_id1(fptr,id_array[id-1].sire,1); print_orig_id1(fptr,id_array[id-1].dam,1); } else (void)fputs("* * * ",fptr); } static void do_recode(int i,int *id) { int id1; if(ped_recode1[i-1]<0) { (void)fprintf(stderr,"Pedigree Error - Circular pedigree found. Ids in list follow:\n"); print_orig_triple(stderr,i); (void)fputc('\n',stderr); *id= -1; return; } ped_recode1[i-1]= -1; id1=id_array[i-1].sire; if(id1 && !ped_recode1[id1-1]) do_recode(id1,id); if(*id>0) { id1=id_array[i-1].dam; if(id1 && !ped_recode1[id1-1]) do_recode(id1,id); } if(*id<0) { print_orig_triple(stderr,i); (void)fputc('\n',stderr); return; } ped_recode1[i-1]= (*id)++; return; } static void infect(int i,int *group,int *equiv,int *ng) { int j,ids,idd,i1,i2; ids=id_array[i].sire; idd=id_array[i].dam; if(group[i]<0) { (void)fprintf(stderr,"Pedigree Error - Circular pedigree found. Ids in cycle follow:\n"); print_orig_triple(stderr,i+1); (void)fputc('\n',stderr); *ng= -1; return; } group[i]=-1; if(ids && group[ids-1]<1) infect(ids-1,group,equiv,ng); if(*ng>=0 &&idd && group[idd-1]<1) infect(idd-1,group,equiv,ng); if(*ng>=0) { if(ids && group[ids-1]>0) { if(idd && group[idd-1]>0) { i1=equiv[group[ids-1]-1]; i2=equiv[group[idd-1]-1]; if(i1!=i2) for(j=0;j<(*ng);j++) if(equiv[j]==i2) equiv[j]=i1; } group[i]=group[ids-1]; } else if(idd && group[idd-1]>0) group[i]=group[idd-1]; else { equiv[*ng]= *ng; group[i]= ++(*ng); } } else { print_orig_triple(stderr,i+1); (void)fputc('\n',stderr); return; } } static int cmp_comp_size(const void *s1,const void *s2) { int sz1,sz2; sz1=comp_size[*((const int *)s1)]; sz2=comp_size[*((const int *)s2)]; if(sz1sz2) return -1; return 0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "count_components" void count_components(char *LogFile) { int i,j,k,*group,*equiv,*code,*perm,*nbits,ids,idd; FILE *flog; char *tname; n_comp=k=0; if(!(group=calloc((size_t)(3*ped_size),sizeof(int)))) ABT_FUNC(MMsg); equiv=group+ped_size; perm=equiv+ped_size; n_comp=0; for(j=i=0;i1) { for(i=0;i=0;i--) if(comp_size[i]>1) break; if(in_records) { db=infile->data; ncol=infile->ncol; while(db) { for(j=0;jrecord_ptr;j++) { for(col=realcol=0;realcolnvar;realcol++) { elem=infile->element[realcol]; if(elem) { if(elem->type&(ST_FAMILY|ST_ID|ST_SIRE|ST_DAM)) if(!check_missing(col,ncol,j,db)) { i=db->records[j*ncol+col].node->index; if(!recode_table[i].index) { if(elem->type&ST_FAMILY) recode_table[i].index= --k1; else recode_table[i].index= ++k; recode_table[i].node=db->records[j*ncol+col].node; } if((elem->type&ST_FAMILY) || !family_id) db->records[j*ncol+col].value=recode_table[i].index; } col++; } } } db=db->next; } } infile=infile->next; } if(!k) ABT_FUNC("Internal error: No. id levels = 0\n"); /* Count pedigree size and recode again if ids are repeated within families */ if(family_id) { if(!k1) ABT_FUNC("Internal error: No. family levels = 0\n"); k1=-k1; n_orig_families=k1; if(!(family_recode=malloc(sizeof(struct label_node *)*k1))) ABT_FUNC(MMsg); if(!(rec_tab1=calloc((size_t)(k1*k),sizeof(int)))) ABT_FUNC(MMsg); k=0; infile=Infiles; while(infile) { if(infile->n_records) { db=infile->data; ncol=infile->ncol; fam_col=infile->family_col; while(db) { for(j=0;jrecord_ptr;j++) { family=-(int)db->records[j*ncol+fam_col].value-1; if(family<0 || family>=k1) ABT_FUNC("Internal error - bad family code\n"); for(col=realcol=0;realcolnvar;realcol++) { elem=infile->element[realcol]; if(elem) { if(elem->type&(ST_ID|ST_SIRE|ST_DAM)) if(!check_missing(col,ncol,j,db)) { i=db->records[j*ncol+col].node->index; id=recode_table[i].index; s=(id-1)*k1+family; if(!rec_tab1[s]) rec_tab1[s]=++k; db->records[j*ncol+col].value=rec_tab1[s]; } col++; } } } db=db->next; } } infile=infile->next; } } ped_size=k; if(!(ped_recode=malloc(sizeof(struct label_node *)*ped_size))) ABT_FUNC(MMsg); if(!(rec_tab=malloc(sizeof(int *)*num_nodes))) ABT_FUNC(MMsg); for(i=0;i0) { if(family_id) { s=(j-1)*k1; for(k2=0;k2n_records) { /* Find (one of) the column(s) the id is in, and check if file contains other pedigree data */ for(j=i=0;invar;i++) { elem=infile->element[i]; if(elem && (elem->type&(ST_SIRE|ST_DAM))) { j=1; break; } } if(j) {/* Any sire/dam columns in data? */ db=infile->data; ncol=infile->ncol; id_col=infile->id_col; fam_col=infile->family_col; while(db) { for(j=0;jrecord_ptr;j++) { id=(int)db->records[j*ncol+id_col].value; if(!id) ABT_FUNC("Internal error - ID is listed as missing\n"); if(family_id) { family=-(int)db->records[j*ncol+fam_col].value; id_array[id-1].fam_code=family; } for(col=realcol=0;realcolnvar;realcol++) { elem=infile->element[realcol]; if(elem) { if(col!=id_col && col!=fam_col && (elem->type&(ST_ID|ST_SIRE|ST_DAM|ST_FAMILY))) { i=(int)db->records[j*ncol+col].value; if(i) switch(elem->type&(ST_ID|ST_SIRE|ST_DAM|ST_FAMILY)) { case ST_FAMILY: if(family!=-i) { print_orig_id(stderr,id,0); print_scan_err(" changes family code within 1 record\n"); } break; case ST_SIRE: if(id_array[id-1].sire) { if(id_array[id-1].sire!=i) { print_orig_id(stderr,id,0); print_scan_err(" listed with multiple fathers\n"); } } else id_array[id-1].sire=i; break; case ST_DAM: if(id_array[id-1].dam) { if(id_array[id-1].dam!=i) { print_orig_id(stderr,id,0); print_scan_err(" listed with multiple mothers\n"); } } else id_array[id-1].dam=i; break; case ST_ID: if(i!=id) { print_orig_id(stderr,id,0); print_scan_err(" changes id within 1 record\n"); } default: ABT_FUNC("Internal error - weird variable type\n"); } } col++; } } } db=db->next; } } } infile=infile->next; } for(i=0;in_levels) ABT_FUNC("No data for genetic group found\n"); if(!(ct=malloc(sizeof(int)*2*group_elem->n_levels))) ABT_FUNC(MMsg); ct1=ct+group_elem->n_levels; for(i=0;in_levels;i++) ct[i]=0; for(i=0;in_levels))) ABT_FUNC(MMsg); for(k1=k=i=0;in_levels;i++) if(ct[i]) { group_recode[k]=factor_recode[j][i]; ct[k++]=ct[i]; ct1[i]=k; k1+=ct[i]; } n_genetic_groups=k; for(i=0;i1) for(i=0;itype==STRING) { k1=36-fprintf(flog," %s",factor_recode[j][i]->data.string); while((k1--)>0) (void)fputc(' ',flog); } else (void)fprintf(flog," %-12ld",factor_recode[j][i]->data.value); (void)fprintf(flog,"%5d\n",ct[i]); } (void)fclose(flog); } free(ct); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "prune_pedigree" void prune_pedigree(char *LogFile) { int i,i1,j,k,tj,*n_kids=0,sire,dam,*perm; FILE *flog; char *tname; if((verbose&1) && syst_var[PRUNE_OPTION]) (void)printf("Pruning pedigree\n"); /* Flag which individuals have trait and marker data */ for(i=0;itype&ST_TRAIT) && id_array[i].data[k].flag) { id_array[i].flag|=1; break; } } if(!id_array[i].flag && id_array[i].data1) for(j=0;jtype&ST_TRAIT) && id_array[i].data1[j][k].flag) { id_array[i].flag|=1; break; } } } if(id_array[i].group) id_array[i].flag|=1; if(id_array[i].haplo[0]) { for(k=j=0;jsex_elem; sex_exp=sd->sex_exp; sd=sd->next; for(k=0;kindex; if(sex_elem->type&ST_INTTYPE) { if(sex_exp[0]->type!=ST_INTEGER) ABT_FUNC("Type mismatch with sex command\n"); } else if(sex_exp[0]->type!=ST_STRING) ABT_FUNC("Type mismatch with sex command\n"); for(i=0;i0) continue; if(id_array[i].data && id_array[i].data[k].flag) { k1=(int)id_array[i].data[k].data.value; node=factor_recode[j][k1-1]; if(node->type==INTEGER) { for(k2=0;k2<2;k2++) if(node->data.value==sex_exp[k2]->arg.value) break; if(k2==2) id_array[i].sex=-1; else id_array[i].sex=k2+5; } else if(node->type==STRING) { for(k2=0;k2<2;k2++) if(!mystrcmp(node->data.string,sex_exp[k2]->arg.string)) break; if(k2==2) id_array[i].sex=-1; else id_array[i].sex=k2+5; } } } } for(i=0;i=0) { if(id_array[ids-1].sex && (id_array[ids-1].sex&3)!=1) { print_orig_id(stderr,ids,0); if(id_array[ids-1].sex&4) (void)fprintf(stderr," declared as female yet used as a father\n"); else (void)fprintf(stderr," used as both father and mother\n"); er=1; id_array[ids-1].sex= -1; } else id_array[ids-1].sex=1; } if(idd && id_array[idd-1].sex>=0) { if(id_array[idd-1].sex && (id_array[idd-1].sex&3)!=2) { print_orig_id(stderr,idd,0); if(id_array[idd-1].sex&4) (void)fprintf(stderr," declared as male yet used as a mother\n"); else (void)fprintf(stderr," used as both father and mother\n"); er=1; id_array[idd-1].sex= -2; } else id_array[idd-1].sex=2; } } if(er) ABT_FUNC("Pedigree errors - aborting\n"); for(i=0;itype!=LINK_AUTO) sex_reqd=1; linkp=linkp->next; } if(sex_reqd) for(i=0;i2) k=5; cc[1+k]++; if(flog) { inbr_rep(flog,1+k,ids,idd,inbr); if(k==5) { (void)fputs(" -> ",flog); if(ped_recode1[ids-1]1) pivot=ids; if(id_array[idd-1].order>1) { if(pivot) pivot= -1; else pivot=idd; } } if(pivot<0) continue; for(j=0;j1) { if(pivot) break; pivot=kid+1; } } if(j0) id_array[pivot-1].order--; famlist[i]=famlist[--nf]; i= -1; } if(nf) { for(k3=INT_MAX,k2=i=0;i1) k1++; if(id_array[idd-1].order>1) k1++; } for(j=0;j1) k1++; } if(k11) { k4+=id_array[ids-1].order-1; compflag[id_array[ids-1].component-1]=1; id_array[ids-1].order=1; } if(id_array[idd-1].order>1) { k4+=id_array[idd-1].order-1; compflag[id_array[idd-1].component-1]=1; id_array[idd-1].order=1; } } for(j=0;j1) { k4+=id_array[kid].order-1; id_array[kid].order=1; compflag[id_array[kid].component-1]=1; } } k4--; famlist[k2]=famlist[--nf]; } } if(k4) (void)printf("No. loops = %d\n",k4); else (void)fputs("Pedigree has no loops\n",stdout); if(flog) { if(k4) { for(i=j=0;i1?"ts":"t"); for(i=0;i=75) k1=0; } if(k1) (void)fputc('\n',flog); } else (void)fputs("\n Pedigree has no loops\n",flog); (void)fclose(flog); } free(compflag); } static void do_yprint(int i,const int *list,const int ny) { int j,k,ch,locus; print_orig_id(stdout,i+1,1); if(id_array[i].haplo[0]) { for(j=0;jtype==STRING) (void)fputs(factor_recode[n_factors+locus][ch-1]->data.string,stdout); else (void)fprintf(stdout,"%ld",factor_recode[n_factors+locus][ch-1]->data.value); } else (void)fputc('*',stdout); } } (void)fputc('\n',stdout); for(j=0;jnext; i--; } if(!pl) ABT_FUNC("Invalid linkage group\n"); if(pl->type==LINK_Y) ny++; } if(ny) (void)printf("No. y markers = %d\n",ny); else return; if(!(list=malloc(sizeof(int)*ny))) ABT_FUNC(MMsg); ny=0; free(list); for(locus=0;locusnext; i--; } if(pl->type==LINK_Y) list[ny++]=locus; } for(i=0;i #include #ifdef USE_DMALLOC #include #endif #include #include #include "version.h" #include "libhdr.h" #include "ranlib.h" #include "utils.h" #include "scan.h" #include "check_het.h" static struct het_res *het_res; int cmp_p(const void *s1,const void *s2) { double x1,x2; int i; i=*((const int *)s1); x1=het_res[i].p; i=*((const int *)s2); x2=het_res[i].p; if(x1x2) return 1; return 0; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "test_het" void test_het(char *Log) { int locus,n_all,*counts,i,j,k,gt[2],hcount,hc1,*alist,n1; double nn,het,ehet,z,p1,p2; char *mname; time_t time1=0,time2; FILE *flog; fputs("Checking marker heterozygosity\n",stdout); if(!(het_res=malloc(sizeof(struct het_res)*n_markers))) ABT_FUNC(MMsg); for(i=locus=0;locusn_levels; if(n_all>i) i=n_all; } if(i<2) { fputs("No segregating markers found\n",stdout); return; } if(!(counts=malloc(sizeof(int)*i))) ABT_FUNC(MMsg); for(k=i=0;in_levels; if(n_all<2) { fputs("Skipped (< 2 alleles)\n",stdout); continue; } for(i=0;ihcount) p2++; if(sig_caught || (i>=2000 && p1>=100 && p2>=100)) break; } if(sig_caught) fputs("\b\b",stdout); if(het>ehet) { fputs("p(Het>obs)=",stdout); z=p1; het_res[locus].flag=1; } else { fputs("p(Het0) (void)fputc(' ',flog); fprintf(flog,"%.4f %.4f %c%-12g %d\n",het_res[locus].het,het_res[locus].ehet,het_res[locus].flag&2?'~':' ',het_res[locus].p,het_res[locus].n); free(mname); } free(alist); fclose(flog); } free(counts); free(het_res); } loki/prepsrc/write_data.c0100644000076500007650000003555010016644733014754 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * June 1997 * * * * write_data.c: * * * * Write out data files for use by Loki * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #include #include #ifdef USE_DMALLOC #include #endif #include #include #include #include #ifdef HAVE_LIMITS_H #include #endif #include "utils.h" #include "libhdr.h" #include "scan.h" #include "control_parse.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_element_index" static int get_element_index(struct var_element *elem) { int i,j; unsigned long tm; tm=ST_MODEL|ST_TRAIT; if(elem->type&(ST_ID|ST_DAM|ST_SIRE|ST_FAMILY|ST_TRAITLOCUS)) return 0; if(elem->type&ST_MARKER) { for(i=0;itype&ST_CONSTANT) { for(j=i=0;itype&tm) { if(id_elements[i]==elem) return j; j++; } ABT_FUNC("Internal error - couldn't find id element\n"); } for(j=i=0;itype&tm) { if(nonid_elements[i]==elem) return j; j++; } ABT_FUNC("Internal error - couldn't find non-id element\n"); return -1; } #define DataFileError(a) New_DFE(__FILE__,__LINE__,a) void New_DFE(const char *sfile,const int line,const char *file) { (void)fprintf(stderr,"[%s:%d] Error writing to file '%s'\n",sfile,line,file); if(errno) perror("loki"); exit(EXIT_FAILURE); } int print_id_data(struct id_data *s,int type,FILE *fptr) { int er=0,c=0; if(fprintf(fptr,";%x",s->flag)<0) er=1; if(!er) { if(type&ST_FACTOR) c='I'; else if(s->flag&ST_INTTYPE) c='I'; else c='R'; if(fputc(c,fptr)==EOF) er=1; } if(!er) { if(c=='I') { if(fprintf(fptr,"%lx",s->data.value)<0) er=1; } else er=txt_print_double(s->data.rvalue,fptr); } return er; } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "WriteData" void WriteData(char *LogFile) { int i,i1,j,k,k1,k2,k3,n_links,ids,idd,*perm,nrec=0,ntyped=0,n_mk; int id_rec_count=0,nonid_rec_count=0,n_orig_fam1,fam,type; int v2[14],*id_trans=0,*family_recode1=0,n_mod; char *fname; struct Link *linkp; struct model_list *mlist; struct model *model; struct var_element *elem; struct scan_data *sd; unsigned long tm; FILE *fptr; tm=ST_MODEL|ST_TRAIT; if(n_genetic_groups>1) tm|=ST_GROUP; for(i=0;itype&tm) id_rec_count++; for(i=0;itype&(ST_MODEL|ST_TRAIT)) nonid_rec_count++; if(id_rec_count) { if(!(id_trans=malloc(sizeof(int)*id_rec_count))) ABT_FUNC(MMsg); for(i=j=0;itype&(ST_MODEL|ST_TRAIT)) id_trans[j++]=i; else if(id_elements[i]->type&ST_GROUP && n_genetic_groups>1) id_trans[id_rec_count-1]=i; } } (void)fputs("Writing out data file...\n",stdout); errno=0; fname=make_file_name(".opt"); if(!(fptr=fopen(fname,"w"))) abt(__FILE__,__LINE__,"%s(): File Error. Couldn't open '%s' for writing\n",FUNC_NAME,fname); if(fprintf(fptr,"Loki.opt:%x,%s,%s\n",RunID,LogFile?LogFile:"",Filter?Filter:"")<0) DataFileError(fname); if(fclose(fptr)) DataFileError(fname); free(fname); fname=make_file_name(".dat"); if(Filter) { i=child_open(WRITE,fname,Filter); if(!(fptr=fdopen(i,"w"))) DataFileError(fname); if(errno && errno!=ESPIPE) DataFileError(fname); errno=0; } else if(!(fptr=fopen(fname,"w"))) abt(__FILE__,__LINE__,"%s(): File Error. Couldn't open '%s' for writing\n",FUNC_NAME,fname); if(family_id) { if(!(family_recode1=calloc((size_t)n_orig_families,sizeof(int)))) ABT_FUNC(MMsg); for(i=0;i1?1:0; if(id_array[i].data && (id_rec_count-j)) k2+=id_rec_count-j; if(id_array[i].nrec && id_array[i].data1 && nonid_rec_count) { for(k1=0;k1type&(ST_MODEL|ST_TRAIT)) { k2++; nrec++; } } if(id_array[i].haplo[0]) ntyped++; } n_links=0; linkp=links; while(linkp) { n_links++; linkp=linkp->next; } for(n_mk=i=0;in_levels) n_mk++; i=nrm_flag?1:0; i|=family_id?2:0; n_mod=0; model=Models; while(model) { n_mod++; model=model->next; } if(fprintf(fptr,"Loki.dat:%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",RunID,pruned_ped_size, n_comp,n_mk,n_links,id_rec_count,nonid_rec_count,i,k2,nrec,ntyped, traitlocus?1:0,n_genetic_groups,n_mod)<0) DataFileError(fname); for(i=0;i1) if(fprintf(fptr,",%x",id_array[i].group)<0) DataFileError(fname); k2=n_genetic_groups>1?1:0; if(id_array[i].data && (id_rec_count-k2)) { for(k1=0;k1type&(ST_MODEL|ST_TRAIT)) { if(print_id_data(id_array[i].data+k1,id_elements[k1]->type,fptr)) DataFileError(fname); } } if(id_array[i].data1 && nonid_rec_count) { for(k1=0;k1type&(ST_MODEL|ST_TRAIT)) { if(print_id_data(id_array[i].data1[k1]+k2,nonid_elements[k2]->type,fptr)) DataFileError(fname); } } } if(id_array[i].haplo[0]) { if(fputc(';',fptr)==EOF) DataFileError(fname); for(k1=0;k1n_levels && fprintf(fptr,"%x,%x;",id_array[i].haplo[0][k1],id_array[i].haplo[1][k1])<0) DataFileError(fname); } if(ped_recode[i] && ped_recode[i]->type==STRING) { k+=strlen(ped_recode[i]->data.string); type=STRING; } if(fputc('\n',fptr)==EOF) DataFileError(fname); } if(k) k+=pruned_ped_size; if(fprintf(fptr,"LKTR:%x",k)<0) DataFileError(fname); if(family_id) { for(k1=i=0;itype==STRING) k1+=strlen(family_recode[i]->data.string)+1; } if(fprintf(fptr,",%x\n",k1)<0) DataFileError(fname); for(i=0;itype==STRING) { (void)fputs(family_recode[i]->data.string,fptr); (void)fputc('\n',fptr); if(errno) DataFileError(fname); } else { k1=(int)family_recode[i]->data.value; if(fprintf(fptr,"%x\n",k1)<0) DataFileError(fname); } } free(family_recode1); } else (void)fputc('\n',fptr); for(j=0;jdata.string,fptr); (void)putc('\n',fptr); if(errno) DataFileError(fname); } else { if(ped_recode[i]) { k1=(int)ped_recode[i]->data.value; if(fprintf(fptr,"%x",k1)<0) DataFileError(fname); } (void)putc('\n',fptr); if(errno) DataFileError(fname); } } if(n_links) { k=0; linkp=links; while(linkp) { if(linkp->name) k+=strlen(linkp->name)+1; else k++; linkp=linkp->next; } if(fprintf(fptr,"LKLN:%x",k)<0) DataFileError(fname); linkp=links; while(linkp) { if(fprintf(fptr,",%x",linkp->type)<0) DataFileError(fname); linkp=linkp->next; } if(fputc('\n',fptr)==EOF) DataFileError(fname); linkp=links; while(linkp) { if(linkp->name) { if(fprintf(fptr,"%s\n",linkp->name)<0) DataFileError(fname); } else if(fputc('\n',fptr)==EOF) DataFileError(fname); linkp=linkp->next; } } if(n_mk) { for(k=k1=i=0;in_levels) { k+=strlen(markers[i].var->name)+1; k1+=markers[i].element->n_levels; } if(fprintf(fptr,"LKMK:%x,%x\n",k,k1)<0) DataFileError(fname); for(i=0;in_levels && fprintf(fptr,"%s\n",markers[i].var->name)<0) DataFileError(fname); for(i=0;in_levels) { if(markers[i].var->vtype&ST_ARRAY) k=markers[i].index; else k=0; if(fprintf(fptr,"%x",k)<0) DataFileError(fname); if(n_links>1) { if(fprintf(fptr,",%x",markers[i].link-1)<0) DataFileError(fname); } k=markers[i].element->n_levels; if(fprintf(fptr,",%x",k)<0) DataFileError(fname); k1=0; if(factor_recode[n_factors+i][0]->type==STRING) for(j=0;jdata.string); if(fprintf(fptr,",%x\n",k1)<0) DataFileError(fname); if(k1) { for(j=0;jdata.string)<0) DataFileError(fname); } else { for(j=0;jdata.value; if(fprintf(fptr,"%x\n",k1)<0) DataFileError(fname); } } } } if(id_rec_count) { for(k=k1=i=0;iarg.var->data; k+=strlen(sd->name)+1; if(id_elements[i1]->type&ST_FACTOR) k1+=id_elements[i1]->n_levels; } if(fprintf(fptr,"LKIR:%x,%x\n",k,k1)<0) DataFileError(fname); for(i=0;iarg.var->data; (void)fprintf(fptr,"%s\n",sd->name); } for(i1=0;i1type; sd=id_elements[i]->arg.var->data; if(sd->vtype&ST_ARRAY) v2[1]=id_elements[i]->oindex; else v2[1]=0; if(fprintf(fptr,"%x,%x",v2[0],v2[1])<0) DataFileError(fname); if(id_elements[i]->type&ST_FACTOR) { k=id_elements[i]->n_levels; if(fprintf(fptr,",%x",k)<0) DataFileError(fname); if(k) { for(j=0;jtype==STRING) for(k2=0;k2data.string); if(fprintf(fptr,",%x\n",k1)<0) DataFileError(fname); if(k1) { for(k2=0;k2data.string)<0) DataFileError(fname); } else { for(k2=0;k2data.value; if(fprintf(fptr,"%x\n",k1)<0) DataFileError(fname); } } } else if(fputc('\n',fptr)==EOF) DataFileError(fname); } else if(fputc('\n',fptr)==EOF) DataFileError(fname); } } if(nonid_rec_count) { for(k=k1=i=0;itype&(ST_MODEL|ST_TRAIT)) { sd=nonid_elements[i]->arg.var->data; k+=strlen(sd->name)+1; if(nonid_elements[i]->type&ST_FACTOR) k1+=nonid_elements[i]->n_levels; } v2[0]=k; v2[1]=k1; if(fprintf(fptr,"LKNR:%x,%x\n",k,k1)<0) DataFileError(fname); for(i=0;itype&(ST_MODEL|ST_TRAIT)) { sd=nonid_elements[i]->arg.var->data; (void)fprintf(fptr,"%s\n",sd->name); } for(i=0;itype&(ST_MODEL|ST_TRAIT)) { v2[0]=nonid_elements[i]->type; sd=nonid_elements[i]->arg.var->data; if(sd->vtype&ST_ARRAY) v2[1]=nonid_elements[i]->index; else v2[1]=0; if(fprintf(fptr,"%x,%x",v2[0],v2[1])<0) DataFileError(fname); if(nonid_elements[i]->type&ST_FACTOR) { k=nonid_elements[i]->n_levels; if(fprintf(fptr,",%x",k)<0) DataFileError(fname); if(k) { for(j=0;jtype==STRING) for(k2=0;k2data.string); if(fprintf(fptr,",%x\n",k1)<0) DataFileError(fname); if(k1) { for(k2=0;k2data.string)<0) DataFileError(fname); } else for(k2=0;k2data.value; if(fprintf(fptr,"%x\n",k1)<0) DataFileError(fname); } } else if(fputc('\n',fptr)==EOF) DataFileError(fname); } else if(fputc('\n',fptr)==EOF) DataFileError(fname); } } model=Models; while(model) { if(model->trait->vtype&ST_ARRAY) elem=model->trait->element+model->index-1; else elem=model->trait->element; mlist=model->model_list; j=k1=0; while(mlist) { k=mlist->nvar; if(!k) ABT_FUNC("Internal error - empty model_list\n"); j++; k1+=k; mlist=mlist->next; } k=get_element_index(elem); if(fprintf(fptr,"LKMD:%x,%x,%x,%x\n",elem->type,k,j,k1)<0) DataFileError(fname); if(j) { mlist=model->model_list; while(mlist) { k=mlist->nvar; if(fprintf(fptr,"%x",k)<0) DataFileError(fname); for(i=0;ielement[i]; j=get_element_index(elem); if(fprintf(fptr,",%x,%x",elem->type,j)<0) DataFileError(fname); } mlist=mlist->next; if(fputc('\n',fptr)==EOF) DataFileError(fname); } } else ABT_FUNC("Internal error - empty model\n"); model=model->next; } if(fputs("Ldat.end\n",fptr)==EOF) DataFileError(fname); free(perm); if(fclose(fptr)) DataFileError(fname); free(fname); if(id_trans) free(id_trans); if(Filter) do i=wait(&j); while(i>0); } loki/prepsrc/write_report.c0100644000076500007650000003376607747724657015412 0ustar heathheath/**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * June 1997 * * * * write_report.c: * * * * Write report to logfile * * * * Copyright (C) Simon C. Heath 1997, 2000, 2002 * * This is free software. You can distribute it and/or modify it * * under the terms of the Modified BSD license, see the file COPYING * * * ****************************************************************************/ #include #ifdef USE_DMALLOC #include #endif #include #include #include #ifndef DBL_MAX #define DBL_MAX MAXDOUBLE #endif #include "utils.h" #include "scan.h" #include "control_parse.h" #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "WriteReport" void WriteReport(char *LogFile) { int i,j,k,k1,k2,k3,i1,rec,fg,*tmp,nlink,cens=0,comp,temp_size; FILE *flog=0; struct model *model; struct model_list *mlist,**model_list; struct Link *linkp,**llist; struct var_element *elem; struct scan_data *sd; double mean,min,max,y,het,hom; char *tname; if(LogFile && (tname=add_file_dir(LogFile))) { flog=fopen(tname,"a"); free(tname); } if(!flog) return; (void)fputs("\n*********************** Final report ********************\n\n",flog); if(Models) (void)fprintf(flog," Model%s\n\n ",Models->next?"s:":":"); model=Models; k2=0; while(model) { if(model->trait->vtype&ST_ARRAY) (void)fprintf(flog,"%s(%d) = ",model->trait->name,model->index); else (void)fprintf(flog,"%s = ",model->trait->name); j=0; mlist=model->model_list; while(mlist) { j++; mlist=mlist->next; } if(!(model_list=malloc(sizeof(void *)*j))) ABT_FUNC(MMsg); k=j; mlist=model->model_list; while(mlist) { model_list[--j]=mlist; mlist=mlist->next; } for(j=0;jnvar;i++) { elem=mlist->element[i]; sd=elem->arg.var->data; if(sd->vtype&ST_ARRAY) { if(elem->type&ST_MARKER) k1=markers[elem->index].index; else k1=elem->oindex; (void)fprintf(flog,"%s(%d)",sd->name,k1); } else (void)fprintf(flog,"%s",sd->name); if(elem->type&(ST_RANDOM|ST_ID|ST_DAM|ST_SIRE)) { (void)fputc('\'',flog); k2=1; } if(invar-1) (void)fputs("*",flog); } if(jnext; if(model) (void)fputs("\n ",flog); } if(k2) (void)fputs("\n\n ( \' indicates a random effect )",flog); fg=0; for(i=0;itype&(ST_MODEL|ST_TRAIT)) { elem=id_elements[i]; if(elem->type&ST_CENSORED) cens=1; if(elem->type&ST_FACTOR) continue; if(!fg) { (void)fputs("\n\n Name Mean Min Max No. Records\n",flog); (void)fputs(" ---- ---- --- --- -----------\n",flog); fg=1; } mean=0.0; max= -DBL_MAX; min=DBL_MAX; for(k=j=0;jtype&ST_INTTYPE) y=(double)id_array[j].data[i].data.value; else y=id_array[j].data[i].data.rvalue; mean+=y; if(y>max) max=y; if(yarg.var->data; if(sd->vtype&ST_ARRAY) k1=20-fprintf(flog," %s(%d)",sd->name,elem->oindex); else k1=20-fprintf(flog," %s",sd->name); while((k1--)>0) (void)fputc(' ',flog); if(k) { mean/=(double)k; if(elem->type&ST_INTTYPE) (void)fprintf(flog,"%8g %8d %8d %6d\n",mean,(int)min,(int)max,k); else (void)fprintf(flog,"%8g %8g %8g %6d\n",mean,min,max,k); } else (void)fprintf(flog,"%8g %8s %8s %6d\n",mean," "," ",k); } for(i=0;itype&(ST_MODEL|ST_TRAIT)) { elem=nonid_elements[i]; if(elem->type&ST_CENSORED) cens=1; if(elem->type&ST_FACTOR) continue; if(!fg) { (void)fputs("\n\n Name Mean Min Max No. Records\n",flog); (void)fputs(" ---- ---- --- --- -----------\n",flog); fg=1; } mean=0.0; max= -DBL_MAX; min=DBL_MAX; for(k=j=0;jtype&ST_INTTYPE) y=(double)id_array[j].data1[k1][i].data.value; else y=id_array[j].data1[k1][i].data.rvalue; mean+=y; if(y>max) max=y; if(yarg.var->data; if(sd->vtype&ST_ARRAY) k1=20-fprintf(flog," %s(%d)",sd->name,elem->oindex); else k1=20-fprintf(flog," %s",sd->name); while((k1--)>0) (void)fputc(' ',flog); if(k) { mean/=(double)k; if(elem->type&ST_INTTYPE) (void)fprintf(flog,"%8g %8d %8d %6d\n",mean,(int)min,(int)max,k); else (void)fprintf(flog,"%8g %8g %8g %6d\n",mean,min,max,k); } else (void)fprintf(flog,"%8g %8s %8s %6d\n",mean," "," ",k); } fg=0; tmp=0; temp_size=0; for(i=0;itype&(ST_MODEL|ST_TRAIT)) { elem=id_elements[i]; if(!(elem->type&ST_FACTOR)) continue; if(!fg) { (void)fputs("\n\n Name No. levels No. Records\n",flog); (void)fputs(" ---- ---------- -----------\n",flog); fg=1; } if(elem->n_levels>temp_size) { if(tmp) { if(!(tmp=realloc(tmp,sizeof(int)*elem->n_levels))) ABT_FUNC(MMsg); } else if(!(tmp=malloc(sizeof(int)*elem->n_levels))) ABT_FUNC(MMsg); temp_size=elem->n_levels; } for(j=0;jn_levels;j++) tmp[j]=0; for(k=j=0;jn_levels;j++) if(tmp[j]) k2++; sd=elem->arg.var->data; if(sd->vtype&ST_ARRAY) k1=20-fprintf(flog," %s(%d)",sd->name,elem->oindex); else k1=20-fprintf(flog," %s",sd->name); while((k1--)>0) (void)fputc(' ',flog); (void)fprintf(flog,"%5d %5d\n\n",k2,k); for(k=0;kn_levels;j++) { if(tmp[j]) { if(factor_recode[k][j]->type==STRING) { k1=38-fprintf(flog," %s",factor_recode[k][j]->data.string); while((k1--)>0) (void)fputc(' ',flog); } else (void)fprintf(flog," %-14ld",factor_recode[k][j]->data.value); (void)fprintf(flog,"%5d\n",tmp[j]); } } if(k2) (void)fputc('\n',flog); if(k2n_levels;j++) { if(tmp[j]) { factor_recode[k][k1]=factor_recode[k][j]; tmp[j]=k1; k1++; } } for(k=j=0;jn_levels=k2; } } for(i=0;itype&(ST_MODEL|ST_TRAIT)) { elem=nonid_elements[i]; if(!(elem->type&ST_FACTOR)) continue; if(!fg) { (void)fputs("\n\n Name No. levels No. Records\n",flog); (void)fputs(" ---- ---------- -----------\n",flog); fg=1; } if(elem->n_levels>temp_size) { if(tmp) { if(!(tmp=realloc(tmp,sizeof(int)*elem->n_levels))) ABT_FUNC(MMsg); } else if(!(tmp=malloc(sizeof(int)*elem->n_levels))) ABT_FUNC(MMsg); temp_size=elem->n_levels; } for(j=0;jn_levels;j++) tmp[j]=0; for(k=j=0;jn_levels;j++) if(tmp[j]) k2++; sd=elem->arg.var->data; if(sd->vtype&ST_ARRAY) k1=20-fprintf(flog," %s(%d)",sd->name,elem->oindex); else k1=20-fprintf(flog," %s",sd->name); while((k1--)>0) (void)fputc(' ',flog); (void)fprintf(flog,"%5d %5d\n\n",k2,k); for(k=0;kn_levels;j++) { if(factor_recode[k][j]->type==STRING) { k1=38-fprintf(flog," %s",factor_recode[k][j]->data.string); while((k1--)>0) (void)fputc(' ',flog); } else (void)fprintf(flog," %-14ld",factor_recode[k][j]->data.value); (void)fprintf(flog,"%5d\n",tmp[j]); } if(k2) (void)fputc('\n',flog); if(k2n_levels;j++) { if(tmp[j]) { factor_recode[k][k1]=factor_recode[k][j]; tmp[j]=k1; k1++; } } for(k=j=0;jn_levels=k2; } } if(tmp) free(tmp); if(cens) { (void)fputs("\n\n Censored traits:\n\n Name Records Cens. Non Cens.\n",flog); (void)fputs(" ---- ------- ---- ---------\n",flog); for(i=0;itype&ST_CENSORED) { elem=id_elements[i]; if(!elem->type&(ST_MODEL|ST_TRAIT)) continue; for(k=k1=k2=j=0;jarg.var->data; if(sd->vtype&ST_ARRAY) i1=20-fprintf(flog," %s(%d)",sd->name,elem->oindex); else i1=20-fprintf(flog," %s",sd->name); while((i1--)>0) (void)fputc(' ',flog); (void)fprintf(flog," %5d %5d %5d\n",k,k1,k2); } for(i=0;itype&ST_CENSORED) { elem=nonid_elements[i]; if(!elem->type&(ST_MODEL|ST_TRAIT)) continue; for(k=k1=k2=j=0;jarg.var->data; if(sd->vtype&ST_ARRAY) i1=20-fprintf(flog," %s(%d)",sd->name,elem->oindex); else i1=20-fprintf(flog," %s",sd->name); while((i1--)>0) (void)fputc(' ',flog); (void)fprintf(flog," %5d %5d %5d\n",k,k1,k2); } } if(n_markers) { j=0; linkp=links; while(linkp) { j++; linkp=linkp->next; } if(!(llist=malloc(sizeof(void *)*j))) ABT_FUNC(MMsg); nlink=j; linkp=links; while(linkp) { llist[--j]=linkp; linkp=linkp->next; } if(!(tmp=calloc((size_t)n_markers,sizeof(int)))) ABT_FUNC(MMsg); for(i=0;iname?linkp->name:"__Not_Named__"); (void)fprintf(flog," ------ ----------- ----------- ----\n"); for(i=0;in_loci;i++) { j=linkp->element[i]->index; if(markers[j].var->vtype&ST_ARRAY) k=20-fprintf(flog," %s(%d)",markers[j].var->name,markers[j].index); else k=20-fprintf(flog," %s",markers[j].var->name); while((k--)>0) (void)fputc(' ',flog); (void)fprintf(flog,"%5d %5d",linkp->element[i]->n_levels,tmp[j]); hom=het=0.0; for(k2=0;k2n_levels; if(k1>k2) k2=k1; } if(k2) { if(!(tmp=malloc(k2*sizeof(int)))) ABT_FUNC(MMsg); for(j=0;jn_levels) { if(markers[j].var->vtype&ST_ARRAY) (void)fprintf(flog,"\n\n Marker - %s(%d):\n\n Allele No. Records\n",markers[j].var->name,markers[j].index); else (void)fprintf(flog,"\n\n Marker - %s:\n\n Allele No. Records\n",markers[j].var->name); (void)fputs(" ------ -----------\n",flog); k1=markers[j].element->n_levels; for(i=0;ii1) i1=k2; if(k2) { k2=markers[j].allele_trans[comp][k2-1]; if(k2<0 || k2>=k1) ABT_FUNC("Internal error - illegal recoded allele value\n"); tmp[k2]++; } } } for(i=0;itype==STRING) { k=23-fprintf(flog," %s",factor_recode[n_factors+j][i]->data.string); while((k--)>0) (void)fputc(' ',flog); } else (void)fprintf(flog," %-15ld",factor_recode[n_factors+j][i]->data.value); (void)fprintf(flog,"%5d\n",tmp[i]); } } free(tmp); } free(llist); } if(flog!=stdout) (void)fclose(flog); } loki/README0100644000076500007650000000370607646770704011702 0ustar heathheathLoki 2.4.6 - Simon Heath - April 2003 This package contains the source and examples for Loki version 2.3. Loki performs Markov chain Monte Carlo (MCMC) multivariate linkage analysis on general pedigrees. The current package supports analyses on quantitative traits only, although this restriction will be lifted in later versions. For more details see the files in the docs/ subdirectory. Changes from previous versions are (sometimes) listed in the Changes file in this directory. ** Making ** Making the package should hopefully just involve typing: ./configure make Choices for the C compiler and options can be fixed by setting the shell environment variables CC and CFLAGS before running ./configure i.e., CC=gcc CFLAGS='-O2 -pedantic -Wall -W' ./configure make ** Testing ** The package has been mostly tested with gcc and GNU make, though it should work with alternative compilers and make utilities with little or no modification. If you have problems compiling please retry with the GNU tools. Whether or not this works, please send me an emai at heath@hardy.mskcc.org to let me know the machine, operating system, compiler and make utility used, and what error messages were produced. To run the programs against test datasets with known results, type make tests. If you get an output like: JV test 1 JV test 2 GAW9 test JV restart test and no errors reported, then everything was successful. If not, then type: make clean make 2>&1 >error.log and email the file error.log to me at heath@hardy.mskcc.org, with a description of the machine you are using (type uname -a), the compiler and which compiler flags were used. ** Installing ** Installing the package can be done by typing make install. By default, the programs and scripts are installed to the bin sub-directory of the main loki directory. This behaviour can be changed by giving the --prefix option to configure. For example, to install to /usr/local/bin type: ./configure --prefix=/usr/local loki/README.known_systems0100644000076500007650000000072707456557144014624 0ustar heathheathloki_2.3 has been compiled and tested on the following systems: Solaris sparc 5.8/5.7 (gcc) Solaris intel 5.8 (gcc) FreeBSD intel 4.0-4.5 (gcc) OpenBSD intel 2.7-3.1 (gcc) OSF1 V4.0 alpha (gcc,cc) Linux intel 2.2,2.4 (gcc) Linux sparc 2.2,2.4 (gcc) Linux alpha 2.2,2.4 (gcc,ccc [dec compiler]) Irix R10000 6.5 (cc - 32 bit) Irix R10000 6.5 (cc - 64 bit) MacOSX G4 10.04,10.1 (gcc) AIX 4.3.3 (gcc) Information on successes/failures on other systems gratefully received. loki/README.multiple_records0100644000076500007650000000110407513317355015233 0ustar heathheathMultiple records in Loki - change in default behaviour The default for all variables is now CONSTANT. This means that if multiple records (lines) are read in for an individual, checks will be made that they match, and all variables will be assumed to form 1 logical record. If true multiple records are present (i.e., an individual was measured multiple times), then sets of variables can be switched using the (new) MULTIPLE command. To revert back to the previous behaviour (when MULTIPLE was the default) add the following line to the control file. set multiple_records 1 loki/README.parallel_runs0100644000076500007650000000356607513317355014540 0ustar heathheathParallel jobs in Loki There is no support for running an individual Loki job in parallel. However, there it is quite possible to run different jobs on different machines (or on different processors on the same machine) in parallel. This is use in genome screen analyses where different chromosomes or different traits can be analyzed in parallel. The important point to remember is that each loki run *must* be in a separate directory. It is often useful to run a single job multiple times with different random number seeds to verify that the results are consistent across runs. If the runs are performed sequentially then this is OK, because Loki will start each new run, continuing the random number stream from where it finished. Each run will therefore get a different stream of random numbers. However, if the jobs are run in parallel there is a risk that the random number streams may overlap, leading to correlation between the runs. This correlation may or may not lead to correlation between the results from the runs. To avoid this, Loki has multiple independent random number generators. Each generator has the same period (2^19937). To switch from one generator to another it is necessary to add the following line to the parameter file: set rng x where x is an integer between 0 and 60 (this upper limit will increase as more independent generators are found). The generator used is written to the seedfile, so be default subsequent runs will continue with the same generator. Note that RNG 0 is the default generator, which was used by previous versions of Loki. There is no guarantee that RNG 0 is independent to all of the other generators, so it is safest to only use values of x>0 when parallel runs are performed. In conclusion, when performing parallel runs, each run should be run in a separate directory, and each run should be using a different random number generator. loki/test/0040755000076500007650000000000010060041201011735 5ustar heathheathloki/test/control_gaw9.in0100644000076500007650000000364607557750263014742 0ustar heathheath/***************************************************************************** * * * Control file for the GAW9 dataset * * * *****************************************************************************/ Array hap1_left(15),hap1_right(15),D1G(15),q(4),id(3) Filter "COMPRESS" # Compress binary output files (recommended) DataDir = "../data/" # Where the data files are located /* * Phenotype data file * * The format can be explained as follows: * 5x - skip 5 characters * 3(5) - read in 3 fields of 5 characters each * 15 - skip 15 characters * 2 - read in 1 field of 2 characters * 3 - read in 1 field of 3 characters * 6x - skip 6 characters * 6 - read in 1 field of 6 characters * 4(7) - read in 4 fields of 7 characters */ file [5x,3(5),15x,2,3,6x,6,4(7)] DataDir+"gaw9_phenotyp",id,sx,age,ef,q /* Genotype data file */ file [5x,5,15(1x,1,1)] DataDir+"gaw9_d1a1-15",id(1),(hap1_left(i),hap1_right(i),i=1,15) /* Link haplotypes to the appropriate markers */ i=1 do Marker Locus D1G(i)[hap1_left(i),hap1_right(i)] i=i+1 while(i<=15) /* * Only use genotype data where trait data available. The gaw9 dataset has * marker data available on everyone (1497 individuals), but trait data only * on 1000 (non founder) individuals. A more realistic analysis would be to * only use marker data on the 1000 individuals which have trait data. */ use hap1_left,hap1_right where (q(1)) Trait Locus QTL # Define QTL as 1 or more trait loci pedigree id # id(1), id(2), and id(3) defined as id, sire, dam log "log" # Name for log file sex sx 1,2 # sx determines sex: 1=Male, 2=Female /* Set up model */ model q(1)=age+ef+QTL /* Define linkage group(s) */ Link "Chromosome 1",D1G(1),D1G(5),D1G(10),D1G(15) loki/test/control_jv0100644000076500007650000000144307747733677014111 0ustar heathheath# Declare "*" as the symbol for a missing record missing "*" # It can be convenient to put directory names into variables so they can be easily changed. datadir="../data/" # The output file log "log" /* * Read in data from "../data/jvped" * This declares that there are 9 (no more or less) fields per record. * Records will be read in until the end of the file is reached. */ file datadir+"jvped",id,sire,dam,y,all1_1,all1_2,all2_1,all2_2,af # Declare which variables have the pedigree information pedigree id,sire,dam # Link the observed haplotypes to markers marker locus mark1[all1_1,all1_2],mark2[all2_1,all2_2] # We have a trait locus (actually this can be multiple trait loci) trait locus QTL # Define the model model y=QTL # Set up the linkage group link "chromosome 1",mark1,mark2 loki/test/control_jv10100644000076500007650000000151707513317360014146 0ustar heathheath# Declare "*" as the symbol for a missing record missing "*" # It can be convenient to put directory names into variables so they can be easily changed. datadir="../data/" # The output file log "log" /* * Read in data from "../data/jvped1" * The [RS="\n"] clause tells the program that records are separated by * newline characters (\n). This allows the handling of short lines, as * are found in jvped1. */ file [RS="\n"] datadir+"jvped1",id,sire,dam,y,all1_1,all1_2,all2_1,all2_2 # Declare which variables have the pedigree information pedigree id,sire,dam # Link the observed haplotypes to markers marker locus mark1[all1_1,all1_2],mark2[all2_1,all2_2] # We have a trait locus (actually this can be multiple trait loci) trait locus QTL # Define the model model y=QTL+id # Set up the linkage group link "chromosome 1",mark1,mark2 loki/test/control_jv_cens0100644000076500007650000000164407505605476015107 0ustar heathheath# Declare "*" as the symbol for a missing record missing "*" # It can be convenient to put directory names into variables so they can be easily changed. datadir="../data/" # The output file log "log" /* * Read in data from "../data/jvped" * This declares that there are 9 (no more or less) fields per record. * Records will be read in until the end of the file is reached. */ file datadir+"jvped",id,sire,dam,y,all1_1,all1_2,all2_1,all2_2,af # Declare which variables have the pedigree information pedigree id,sire,dam # af (affected status) is discrete discrete af # Link the observed haplotypes to markers marker locus mark1[all1_1,all1_2],mark2[all2_1,all2_2] # We have a trait locus (actually this can be multiple trait loci) trait locus QTL # y is censored when individual is unaffected (af=1) censored y where (af="1") # Define the model model y=QTL # Set up the linkage group link "chromosome 1",mark1,mark2 loki/test/control_jv_lm0100644000076500007650000000151707513317360014555 0ustar heathheath# Declare "*" as the symbol for a missing record missing "*" # It can be convenient to put directory names into variables so they can be easily changed. datadir="../data/" # The output file log "log" /* * Read in data from "../data/jvped1" * The [RS="\n"] clause tells the program that records are separated by * newline characters (\n). This allows the handling of short lines, as * are found in jvped1. */ file [RS="\n"] datadir+"jvped1",id,sire,dam,y,all1_1,all1_2,all2_1,all2_2 # Declare which variables have the pedigree information pedigree id,sire,dam # Link the observed haplotypes to markers marker locus mark1[all1_1,all1_2],mark2[all2_1,all2_2] # We have a trait locus (actually this can be multiple trait loci) trait locus QTL # Define the model model y=QTL+id # Set up the linkage group link "chromosome 1",mark1,mark2 loki/test/control_jv_mg0100644000076500007650000000145207505605477014560 0ustar heathheath# Declare "*" as the symbol for a missing record missing "*" # It can be convenient to put directory names into variables so they can be easily changed. datadir="../data/" # The output file log "log" /* * Read in data from "../data/jvped" * This declares that there are 9 (no more or less) fields per record. * Records will be read in until the end of the file is reached. */ file datadir+"jvped",id,sire,dam,y,all1_1,all1_2,all2_1,all2_2,af # Declare which variables have the pedigree information pedigree id,sire,dam # Link the observed haplotypes to markers marker locus mark1[all1_1,all1_2],mark2[all2_1,all2_2] # We have a trait locus (actually this can be multiple trait loci) trait locus QTL # Define the model model y=QTL+mark1 # Set up the linkage group link "chromosome 1",mark1,mark2 loki/test/loki_test.in0100644000076500007650000000245107522452770014313 0ustar heathheath#!/bin/sh if (echo "testing\c"; echo 1,2,3) | GREP c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | SED s/-n/xn/ | GREP xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi echo $ac_n $5 "... $ac_c" rm -f loki.out log tmp $1 if [ "X$2" != "XNULL" ] then cp test_seedfile seedfile if test -x PREP then PREP $2 > tmp else echo "prep not found" >> error.log fail="YES" fi if [ "X$fail" != "XYES" ] then SED '/* Reading/,/* Exiting/!d' log 2>/dev/null >> tmp if test -x LOKI then LOKI $3 | SED '/^Created by/d' 2>/dev/null >> tmp else echo "loki not found" >> error.log fail="YES" fi fi else if test -x LOKI then LOKI -r $3 | SED '/^Created by/d' 2>/dev/null >> tmp else echo "Loki not found" >> error.log fail="YES" fi fi if [ "X$fail" != "XYES" ] then if test -f loki.out then SED '1,/^--*$/d' loki.out >> tmp if test -f $4 then diff $4 tmp >> $1 if test -s $1 then fail="YES" cat $1 >> error.log fi rm -f tmp seedfile seedfile~ else mv -f tmp $4 fi else echo "Loki failed (no ouptut)" >> error.log fail="YES" fi fi if [ "X$fail" != "XYES" ] then echo "$ac_t""OK" else echo "$ac_t""Failed" fi loki/test/Makefile.in0100644000076500007650000000471107547012161014025 0ustar heathheathSHELL = /bin/sh SED = @SED@ COMPRESS = @COMPRESS@ GREP = @GREP@ PREP = ../prepsrc/prep LOKI = ../lokisrc/loki STDDIR = standards TESTS = jvtst_1 jvtst_2 jvtst_cens jvtst_lm jvtst_mg gaw9_tst jvtst_3 all: loki_test control_gaw9 $(TESTS) .POSIX: .SILENT: $(TESTS) jvtst_1: loki_test ./loki_test $@ control_jv param_jv $(STDDIR)/loki_std_jv 'JV test 1' jvtst_2: loki_test ./loki_test $@ control_jv1 param_jv $(STDDIR)/loki_std_jv1 'JV test 2' jvtst_cens: loki_test ./loki_test $@ control_jv_cens param_jv $(STDDIR)/loki_std_jv_cens 'JV censored data test' jvtst_lm: loki_test ./loki_test $@ control_jv1 param_jv_lm $(STDDIR)/loki_std_jv_lm 'LM sample test' jvtst_mg: loki_test ./loki_test $@ control_jv_mg param_jv_mg $(STDDIR)/loki_std_jv_mg 'Major gene test' gaw9_tst: loki_test control_gaw9 ./loki_test $@ control_gaw9 param_gaw9 $(STDDIR)/loki_std_gaw9 'GAW9 test' jvtst_3: loki_test cp $(STDDIR)/loki_std_jv2.dump loki.dump cp $(STDDIR)/loki_std_jv2.dat loki.dat cp $(STDDIR)/loki_std_jv2.opt loki.opt cp $(STDDIR)/loki_std_jv2.gen loki.gen cp $(STDDIR)/loki_std_jv2.nrm loki.nrm ./loki_test $@ NULL param_jv2 $(STDDIR)/loki_std_jv2 'JV restart test' loki_test: loki_test.in $(SED) s+SED+$(SED)+g loki_test.in|$(SED) s+PREP+$(PREP)+g|\ $(SED) s+LOKI+$(LOKI)+g|$(SED) s+GREP+$(GREP)+g > tmp cp tmp $@ && chmod 755 $@ control_gaw9: control_gaw9.in $(SED) s+COMPRESS+$(COMPRESS)+g control_gaw9.in > tmp cp tmp $@ standard: loki_test control_gaw9 rm -f $(STDDIR)/loki_std_jv $(STDDIR)/loki_std_jv1 $(STDDIR)/loki_std_gaw9 \ $(STDDIR)/loki_std_jv2 $(STDDIR)/loki_std_jv_cens $(STDDIR)/loki_std_jv_lm \ $(STDDIR)/loki_std_jv_mg ./loki_test junk control_jv param_jv $(STDDIR)/loki_std_jv ./loki_test junk control_jv1 param_jv $(STDDIR)/loki_std_jv1 cp loki.dump $(STDDIR)/loki_std_jv2.dump cp loki.dat $(STDDIR)/loki_std_jv2.dat cp loki.opt $(STDDIR)/loki_std_jv2.opt cp loki.gen $(STDDIR)/loki_std_jv2.gen cp loki.nrm $(STDDIR)/loki_std_jv2.nrm ./loki_test junk NULL param_jv2 $(STDDIR)/loki_std_jv2 ./loki_test junk control_jv_cens param_jv $(STDDIR)/loki_std_jv_cens ./loki_test junk control_jv1 param_jv_lm $(STDDIR)/loki_std_jv_lm ./loki_test junk control_jv_mg param_jv_mg $(STDDIR)/loki_std_jv_mg ./loki_test junk control_gaw9 param_gaw9 $(STDDIR)/loki_std_gaw9 rm -f junk install: clean: rm -f *~ core a.out *.bak log logfile tmp loki.* jvtst_* gaw9_tst \ seedfile logfile error.log $(TESTS) distclean: clean rm -f Makefile loki_test control_gaw9 loki/test/param_gaw90100644000076500007650000000100407467703212013727 0ustar heathheathIterations 50 Start Output 0,0 Output frequency 5,5 Output age,ef Start Residual Variance 80.0 Start Mean 0.0 Map 'Chromosome 1' 0.0,60.0 Total Map 360.0 Trait Loci 0,5 Seedfile "test_seedfile",1 Position D1G(1) 0.0 Position D1G(2) 2.0 Position D1G(3) 4.0 Position D1G(4) 6.0 Position D1G(5) 8.0 Position D1G(6) 10.0 Position D1G(7) 12.0 Position D1G(8) 14.0 Position D1G(9) 16.0 Position D1G(10) 18.0 Position D1G(11) 20.0 Position D1G(12) 22.0 Position D1G(13) 24.0 Position D1G(14) 26.0 Position D1G(15) 28.0 loki/test/param_jv0100644000076500007650000000033007505605477013507 0ustar heathheathIterations 200 Start Output 1,1 Output frequency 1,5 Total Map 4.0 Seedfile "test_seedfile",1 Position mark1 0.0 Position mark2 2.0 Frequency mark1 A,0.2 B,0.2 C,0.4 D,0.2 Frequency mark2 116,.4 118,.3 112,.3 loki/test/param_jv20100644000076500007650000000033007505605477013571 0ustar heathheathIterations 300 Start Output 1,1 Output frequency 1,5 Total Map 4.0 Seedfile "test_seedfile",1 Position mark1 0.0 Position mark2 2.0 Frequency mark1 A,0.2 B,0.2 C,0.4 D,0.2 Frequency mark2 116,.4 118,.3 112,.3 loki/test/param_jv_lm0100644000076500007650000000035007505605477014201 0ustar heathheathIterations 200 Start Output 1,1 Output frequency 1,5 Total Map 4.0 Seedfile "test_seedfile",1 Position mark1 0.0 Position mark2 2.0 Frequency mark1 A,0.2 B,0.2 C,0.4 D,0.2 Frequency mark2 116,.4 118,.3 112,.3 set lm_ratio 0.5 loki/test/param_jv_mg0100644000076500007650000000023207505605477014173 0ustar heathheathIterations 200 Start Output 1,1 Output frequency 1,5 Total Map 4.0 Seedfile "test_seedfile",1 Position mark1 0.0 Position mark2 2.0 set lm_ratio 0.5 loki/test/param_lex.l0100644000076500007650000001500510001744012014065 0ustar heathheath%{ /**************************************************************************** * * * Loki - Programs for genetic analysis of complex traits using MCMC * * * * Simon Heath - University of Washington * * * * July 1997 * * * * param_lex.l: * * * * flex (NOT lex!) source for parameter file lexer. * * * ****************************************************************************/ #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef USE_DMALLOC #include #endif #include #include "param_parse.h" #include "loki_scan.h" #include "utils.h" #ifndef YY_STACK_USED #define YY_STACK_USED 0 #endif #ifndef YY_ALWAYS_INTERACTIVE #define YY_ALWAYS_INTERACTIVE 0 #endif #ifndef YY_NEVER_INTERACTIVE #define YY_NEVER_INTERACTIVE 0 #endif #ifndef YY_MAIN #define YY_MAIN 0 #endif extern void yyerror(char *s),print_scan_err(char *fmt, ...); extern int scan_error_n; static int token,i; int tokenpos,lineno=1,lineno1=1; char linebuf[512],linebuf1[512]; static int symbol_lookup(const char *p); static char *get_string(const char *p); static YY_BUFFER_STATE bufstate_list[MAX_INCLUDE]; char *fname_list[MAX_INCLUDE+1]; int list_ptr; static int ln_list[MAX_INCLUDE],ln1_list[MAX_INCLUDE]; %} %x COMMENT %s ISTATE %% .*\n { (void)strncpy(linebuf,yytext,512); (void)strcpy(linebuf1,linebuf); yyless((int)0); BEGIN ISTATE; } <> { if(iflag) { iflag=0; } else { if(--list_ptr<0) yyterminate(); else { free(fname_list[list_ptr+1]); yy_delete_buffer(YY_CURRENT_BUFFER); yy_switch_to_buffer(bufstate_list[list_ptr]); lineno=ln_list[list_ptr]; lineno1=ln1_list[list_ptr]; linebuf[0]=linebuf1[0]=0; } } } [\t ] {tokenpos+=yyleng;} \n.* { lineno++; tokenpos=0; (void)strncpy(linebuf,yytext+1,512); yyless((int)1); } "/*" BEGIN(COMMENT); . {tokenpos+=yyleng;} \n {lineno++; tokenpos=0;} "*/" {BEGIN(ISTATE); tokenpos+=yyleng;} #.*$ ; \"[^\"\n]*[\n\"] { tokenpos+=yyleng; yylval.string=get_string(yytext+1); i=strlen(yylval.string); if(i) yylval.string[i-1]='\0'; return STRING; } \'[^\'\n]*[\n\'] { tokenpos+=yyleng; yylval.string=get_string(yytext+1); i=strlen(yylval.string); if(i) yylval.string[i-1]='\0'; return STRING; } [a-zA-Z][a-zA-Z0-9_]* { token=symbol_lookup(yytext); tokenpos+=yyleng; if(token==STRING) yylval.string=get_string(yytext); return token; } [+-]?([0-9]*\.[0-9]+)|(([0-9]+|([0-9]*\.[0-9]+))E[-+]?[0-9]+) { tokenpos+=yyleng; yylval.rvalue=atof(yytext); return REAL; } [+-]?[0-9]+ { tokenpos+=yyleng; yylval.value=atoi(yytext); return INTEGER; } . { tokenpos+=yyleng; return yytext[0]; } %% void yy_cleanup(void) { yy_delete_buffer(yy_current_buffer); } #ifdef FUNC_NAME #undef FUNC_NAME #endif #define FUNC_NAME "get_string" static char *get_string(const char *s) { char *s1; size_t size; size=strlen(s)+1; if(!(s1=malloc(size))) ABT_FUNC(MMsg); (void)memcpy(s1,s,size); return s1; } static int symbol_lookup(const char *p) { static char *Coms[] = {"RESIDUAL","GENETIC","VARIANCE","POSITION","FREQUENCY", "START","ITERATIONS","SAMPLE","FROM","OUTPUT","MEAN","MAP","TOTAL", "SEED","FILE","SEEDFILE","TRAIT","LOCI","SET","ESTIMATE","IBD", "GROUP","ORDER","MALE","FEMALE","LIMIT","PHENOTYPE", "PHENOTYPES","PHENO","GENOTYPE","GENOTYPES","GENO","COUNTS","DUMP", "TYPE","ANALYZE","NORMAL","STUDENT_T","HAPLO","HAPLOTYPES","INCLUDE", "FUNCTION","HALDANE","KOSAMBI","RECOMB","RECOMBINATION","RECOMBINATIONS", "POLYGENIC","AFFECTED","TIME","VIRTUAL","MARKERS","GRID","COMPRESS","DIR",(char *)0}; static int Com_token[] = {RESIDUAL,GENETIC,VARIANCE,POSITION,FREQUENCY, START,ITERATIONS,SAMPLE,FROM,OUTPUT,MEAN,MAP,TOTAL, SEED,SFILE,SEEDFILE,TRAIT,LOCI,SET,ESTIMATE,IBD, GROUP,ORDER,MALE,FEMALE,LIMIT,PHENO,PHENO,PHENO,GENO,GENO,GENO, COUNTS,DUMP,TYPE,ANALYZE,NORMAL,STUDENT_T,HAPLO,HAPLO,INCLUDE,FUNCTION, HALDANE,KOSAMBI,RECOMB,RECOMB,RECOMB,POLYGENIC,AFFECTED, TIMECOM,VIRTUAL,MARKERS,GRID,COMPRESS,DIR,SYSTEM_VAR,STRING}; static char *Syst[] = {"NO_OVERDOMINANT","TAU_BETA","TAU_MODE","CENSOR_MODE", "DEBUG_LEVEL","LM_RATIO","PEEL_TRACE","BACKUPS", "SI_MODE","IBD_OUTPUT","RNG","GENV_OUT",(char *)0}; int i=0,j; while(Coms[i]) { if(!strcasecmp(Coms[i],p)) break; i++; } if(Com_token[i]==SYSTEM_VAR) { i++; j=0; while(Syst[j]) { if(!strcasecmp(Syst[j],p)) { yylval.value=j; i--; break; } j++; } } return Com_token[i]; } void include_param_file(char *fname) { FILE *fptr; YY_BUFFER_STATE ystate; int i,j; struct stat st1,st2; if(fname) { if(!fname[0]) yyerror("Null filename from INCLUDE command\n"); if(stat(fname,&st1)) { (void)fprintf(stderr,"File: %s\n",fname); yyerror("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } for(i=0;i<=list_ptr;i++) { if(stat(fname_list[i],&st2)) { (void)fprintf(stderr,"File: %s\n",fname_list[i]); yyerror("Include file could not be stat()'d\n"); perror(0); exit(EXIT_FAILURE); } if(st1.st_ino==st2.st_ino && st1.st_dev==st2.st_dev) { for(j=0;j<=list_ptr;j++) { if(j==i) (void)fprintf(stderr,"*%s* -> ",fname_list[j]); else (void)fprintf(stderr,"%s -> ",fname_list[j]); } (void)fprintf(stderr,"%s\n",fname); yyerror("Recursive include files!\n"); exit(EXIT_FAILURE); } } if(list_ptr$stop) { $tmp=$start; $start=$stop; $stop=$tmp; } $start=1 if(!defined($start)); } # Set bin width $bw=$opt{b}?$opt{b}:1; # # Read in linkage group details from loki.out # $file=$opt{f}?$opt{f}:"loki.out"; open FILE,$file or die "Could not open file '$file'\n"; while() { # This should only occur if there is an error last if(/^----/); # Read in model $model=$1 if(/^Model: (.+)/); if(/^Linkage groups:$/) { $fg=1; next; } if($fg==1) { # Check for linkage group names and map lengths if(/(\d+): (.*)$/) { $lg=$1; if($2=~/^(.*) Map range: (.*)/) { $chrom{$lg}=$1; if($2=~/\((-?[0-9.]+)cM to (-?[0-9.]+)cM\)(.*)/) { $map_start[$lg][0]=$1; $map_end[$lg][0]=$2; $chr_length[$lg]=$2-$1; if($3=~/\((-?[0-9.]+)cM to (-?[0-9.]+)cM\)/) { $map_start[$lg][1]=$1; $map_end[$lg][1]=$2; $chr_length[$lg]+=$2-$1; $sex_map=1; } } else { die "Error reading linkage group map range\n"; } } else { die "Error reading linkage group name\n"; } } else { # Check for total map length if(/^Total Map Length: (.*)$/) { if($1=~/(\d\d*\.?\d*)cM(.*)/) { $map_length[0]=$1; $map_length=$1; if($2=~/(\d\d*\.?\d*)cM$/) { $map_length[1]=$1; $map_length+=$1; $sex_map=1; } } else { die "Error reading map lengths\n"; } $fg=2; last; } } } } close FILE; # Now start reading data from loki.pos $file=$opt{p}?$opt{p}:"loki.pos"; open FILE,$file or die "Could not open file '$file'\n"; my($it,$i,$j,$k,$rep,$rep1,$n,$n_qtl,@cnt,@bf,$p,@dist,%tdist,@dist1,$skip,$sw,$sw1,@nq,$nq1,@nq1,@nq2); my(@bin,@bin1,$sx,$x,$kk,$max_x,$max_l,$target,$target1,$nlink,@dist_lnk,$lg1); $target=0; $target1=100; # Set up name and map length for unlinked portion of genome for($sx=0;$sx<=$sex_map;$sx++) { $k=0; foreach $lg(keys %chrom) { $k+=$map_end[$lg][$sx]-$map_start[$lg][$sx]; } if($k>$map_length[$sx]) { print "Total map length $map_length[$sx] less then sum of chromosome lengths $k\nResetting map_length\n"; $map_length[$sx]=$k+1; # Add 1 in case we get some unlinked } $chr_length[0]+=$map_length[$sx]-$k; } $chrom{0}="Unlinked"; my($istty)=1 if -t STDOUT; while() { split; $k=@_; # Skip empty lines next if(!$k); # Get number of iterations from end of line if($_[$k-1]=~/(.*):(\d+)/) { $rep=$2; $skip=0; $rep1=$rep; if($opt{i}) { if($start>$it+$rep) {$skip=1;} elsif($start>$it+1) {$rep1=$it+$rep+1-$start;} if(defined($stop)) { if($stop<=$it) {$skip=2;} elsif($stop<=$it+$rep) {$rep1-=$it+$rep-$stop;} } } if($rep1 && !$skip) { $_[$k-1]=$1; $n_qtl=0; $i=0; undef @dist1; undef @nq; undef @bin1; $nlink=0; # Go though rest of line while($i<$k) { $lg=$_[$i++]; # Linkage group $n=$_[$i++]; # Number of QTLs in linkage group $n_qtl+=$n; # Add on to total QTL count $nq[$lg]=$n; $cnt[$lg]+=$rep1; # Add to count for linkage group $dist1[$lg]=$n; if($lg) { # If linked, go thought QTL positions $nlink+=$n; $j=0; while($j<$n) { for($sx=0;$sx<=$sex_map;$sx++) { $x=$_[$i++]; # Get position $kk=int(($x-$map_start[$lg][$sx])/$bw); # Get offset from start of map, and compute bin $bin1[$sx][$lg]{$kk}=1; # Add count to bin } $j++; die "Invalid number of columns\n" if($i>$k); } } } for($sx=0;$sx<=$sex_map;$sx++) { if($map_length[$sx]>0) { $p=$bw/$map_length[$sx]; # Prior for 1 QTL being linked to a bin $p=1-((1-$p)**$n_qtl); # Prior of at least 1 QTL in bin } else { $p=1; } foreach $lg (keys %chrom) { $j=$bin1[$sx][$lg]; foreach $kk(keys %$j) { $bin[$sx][$lg][$kk]+=$rep1/$p; } } } # Check if switch in QTL number has occurred if($n_qtl!=$nq1) { $sw++; $nq1=$n_qtl; } # Check if switch in number linked has occurred foreach $lg(keys %chrom) { if($lg && ($nq[$lg]!=$nq1[$lg])) { $sw1++; $nq1[$lg]=$nq[$lg]; } } # Accumulate QTL distribution counts for linkage groups foreach $lg(keys %chrom) { my($lg1); $dist[$lg][$dist1[$lg]]+=$rep1; if($lg>1) { foreach $lg1(keys %chrom) { next if(!$lg1 || $lg1>=$lg); if($dist1[$lg]>0 && $dist1[$lg1]>0) { $nq2[$lg][$lg1]+=$rep1; } } } } $dist_lnk[$nlink]+=$rep1; # and overall QTL distribution counts $tdist{$n_qtl}+=$rep1; # Compute BF for linkage if($n_qtl && $map_length) { $i=0; while($i<$k) { $lg=$_[$i++]; # Linkage group $n=$_[$i++]; # Number of QTLs in linkage group $p=$chr_length[$lg]/$map_length; # Prior for single QTL to linkage group $p=1-((1-$p)**$n_qtl); # Prior of at least 1 QTL on linkage group $bf[$lg]+=$rep1/$p; # Add post/prior ratio to @bf $i+=$n*(1+$sex_map) if($lg); # Skip to next record } die "Invalid number of columns\n" if($i>$k); } } $it+=$rep; if(!$opt{q} && $it>=$target1 && $istty) { print "\rAt iteration: $target1"; while($it>=$target1) {$target1+=100;} } last if($skip==2); } } close FILE; print "\r" if($istty && !$opt{q}); # Print report print "----------------------------------------------\n"; if($opt{i}) { $stop=$it if(!defined($stop)); $it=$stop-$start+1; } print"Model: $model\nIterations: $it\n"; if($it) { printf("Switching proportion for QTL no.: %.5f\n",$sw/$it); printf("Switching proportion for linked QTLs: %.5f\n\n",$sw1/$it); if($map_length) { print "Linkage group Count Prop. linked BF\n"; print "----------------------------------------------\n"; } foreach $lg (sort {$a<=>$b} keys %chrom) { if($map_length) { printf("%-13s %8d %.5f %.5f",$chrom{$lg},$cnt[$lg],$cnt[$lg]/$it,$bf[$lg]/$it); if($lg) { for($sx=0;$sx<=$sex_map;$sx++) { $x=$map_start[$lg][$sx]+.5*$bw; $max_l=0; $kk=0; while($x<=$map_end[$lg][$sx]) { $j=$bin[$sx][$lg][$kk++]/$it; if($j>$max_l) { $max_l=$j; $max_x=$x; } $x+=$bw; } printf(" %8.2f %7.2fcM",$max_l,$max_x); } } print "\n"; } else { printf("%-13s %8d %.5f\n",$chrom{$lg},$cnt[$lg],$cnt[$lg]/$it); } } print "\n"; $i=0; foreach $lg (sort {$a<=>$b} keys %chrom) { next if($lg<1); foreach $lg1(sort {$a<=>$b} keys %chrom) { next if(!$lg1); last if($lg1>=$lg); $i=1; printf("%-23s %.5f\n","$chrom{$lg}-$chrom{$lg1}",$nq2[$lg][$lg1]/$it); } } print "\n" if($i); foreach $i(sort {$b<=>$a} keys %tdist) {$k=$i;last;} print "QTL number "; for($i=0;$i<=$k;$i++) {printf " %6d",$i;} print "\n-------------"; for($i=0;$i<=$k;$i++) {printf "-------",$i;} print "\nOverall "; for($i=0;$i<=$k;$i++) {printf " %.4f",$tdist{$i}/$it;} print "\nLinked "; for($i=0;$i<=$k;$i++) {printf " %.4f",$dist_lnk[$i]/$it;} print "\n"; foreach $lg(sort {$a<=>$b} keys %chrom) { printf("%-13s",$chrom{$lg}); for($i=0;$i<=$k;$i++) {printf " %.4f",$dist[$lg][$i]/$it;} print "\n"; if(!$lg) { print "-------------"; for($i=0;$i<=$k;$i++) {printf "-------",$i;} print "\n"; } } } loki/utils/dist.in0100644000076500007650000002034707445627301013444 0ustar heathheath#!+PERLPROG+ # # Script to estimate the Bayes Factor for linkage # for small regions of chromosome and output in # tabular format suitable for gnuplot or other # plotting programs. If gnuplot is installed, # can invoke it directly to produce screen or # postscript plots. # # Usage: dist.pl -q -C -f outfile -p posfile -b binsize # -o psfile -d datafile -c chromosome # -i [start iteration][,:-][stop iteration] # outfile defaults to loki.out # posfile defaults to loki.pos # binsize defaults to 1[cM] # if -c option not set, looks at all chromsomes (linkage groups) fitted # -d sets basename for temporary datafiles # -o psfile instructs the script to get gnuplot to produce a postscript output into psfile # -C turns on colour postscript (only has effect with -o option) # -q does not invoke gnuplot # -i sets iteration range # # Works with loki_2.3 # # Simon Heath - September 2000 # use Getopt::Std; use IO::File; use POSIX qw(tmpnam); use strict; my (%opt,$model,$fg,$ch,$nmk,$lg,$file,$sex_map,$start,$stop,$tmp); my (%chrom,@mkchrom,@mkpos,@mkname,@map_length,@map_start,@map_end); getopts('qCc:b:o:i:d:p:f:h?',\%opt); if($opt{h} || $opt{'?'}) { print "usage: dist.pl -q -C -f outfile -p posfile -b binsize\n -o psfile -d datafile -c chromsome\n -i [start iteration][,:-][stop iteration]\n"; exit(0); } if(defined($opt{c})) { die "Invalid chromosome number\n" if($opt{c}<1); } # -i option sets a range of iterations to consider if($opt{i}) { $tmp=$opt{i}; if($tmp=~/^([1-9][0-9]*)(.*)/) { $start=$1; $tmp=$2; } if($tmp=~/^[,-:](.*)/) { $tmp=$1; if($tmp=~/^([1-9][0-9]*)/) { $stop=$1; } } die "Bad -i option\n" if(!defined($start) && !defined($stop)); if(defined($start) && defined($stop) && $start>$stop) { $tmp=$start; $start=$stop; $stop=$tmp; } $start=1 if(!defined($start)); } $file=$opt{f}?$opt{f}:"loki.out"; $sex_map=0; open FILE,$file or die "Could not open file '$file'\n"; # # We need to get some details about linkage groups, chromosome positions # and map lengths out of the header # while() { # Read in model $model=$1 if(/^Model: (.+)/); # Get rid of qutoes as they mess up Gnuplot $model=~s/\'//g; if(/^Linkage groups:$/) { $fg=1; next; } if($fg==1) { # Check for linkage group names and map lengths if(/(\d+): (.*)$/) { $lg=$1+0; if(!$opt{c} || $lg eq $opt{c}) { if($2=~/^(.*\S)\s+Map range: (.*)/) { $chrom{$lg}=$1; if($2=~/\((-?[0-9.]+)cM to (-?[0-9.]+)cM\)(.*)/) { $map_start[$lg][0]=$1; $map_end[$lg][0]=$2; if($3=~/\((-?[0-9.]+)cM to (-?[0-9.]+)cM\)/) { $map_start[$lg][1]=$1; $map_end[$lg][1]=$2; $sex_map=1; } } else { die "Error reading linkage group map range\n"; } } else { die "Error reading linkage group name\n"; } } # Pick up marker names and positions } elsif(/^\s+(.+)\s+-\s+([\d\.]+)\s*([\d\.]*)/) { if(!$opt{c} || $lg eq $opt{c}) { $mkchrom[$nmk]=$lg; $mkpos[$nmk][0]=$2; $mkpos[$nmk][1]=$3; $mkname[$nmk++]=$1; } } else { # Check for total map length if(/^Total Map Length: (.*)$/) { if($1=~/(\d\d*\.?\d*)cM(.*)/) { $map_length[0]=$1; if($2=~/(\d\d*\.?\d*)cM$/) { $map_length[1]=$1; $sex_map=1; } } else { die "Error reading map lengths\n"; } $fg=2; last; } } } } close FILE; die "No linked chromosomes found\n" unless $fg==2; # Now start reading data from loki.pos $file=$opt{p}?$opt{p}:"loki.pos"; open FILE,$file or die "Could not open file '$file'\n"; my($it,$bw,$rep,$rep1,$i,$j,$k,$x,$kk,$p,$n_qtl,$n); my(@bin,@bin1,@sex,$sx,$skip); $sex[0]="Male"; $sex[1]="Female"; # Set bin width $bw=$opt{b}?$opt{b}:1; while() { split; $k=@_; # Skip empty lines next if(!$k); # Get number of iterations from end of line if($_[$k-1]=~/(.*):(\d+)/) { $rep=$2; $skip=0; $rep1=$rep; if($opt{i}) { if($start>$it+$rep) {$skip=1;} elsif($start>$it+1) {$rep1=$it+$rep+1-$start;} if(defined($stop)) { if($stop<=$it) {$skip=2;} elsif($stop<=$it+$rep) {$rep1-=$it+$rep-$stop;} } } if($rep1 && !$skip) { $_[$k-1]=$1; $i=0; $n_qtl=0; undef @bin1; # Go though rest of line while($i<$k) { $lg=$_[$i++]; # Linkage group $n=$_[$i++]; # Number if QTLs in linkage group $n_qtl+=$n; # Add on to total QTL count if($lg) { # If linked, go thought QTL positions $j=0; while($j<$n) { for($sx=0;$sx<=$sex_map;$sx++) { $x=$_[$i++]; # Get position $kk=int(($x-$map_start[$lg][$sx])/$bw); # Get offset from start of map, and compute bin $bin1[$sx][$lg]{$kk}=1; # Add count to bin } $j++; die "Invalid number of columns\n" if($i>$k); } } } for($sx=0;$sx<=$sex_map;$sx++) { if($map_length[$sx]>0) { $p=$bw/$map_length[$sx]; # Prior for 1 QTL being linked to a bin } else { $p=1; } $p=1-((1-$p)**$n_qtl); # Prior of at least 1 QTL in bin foreach $lg (keys %chrom) { $j=$bin1[$sx][$lg]; foreach $kk(keys %$j) { $bin[$sx][$lg][$kk]+=$rep1/$p; } } } } $it+=$rep; last if($skip==2); } } close FILE; if($opt{i}) { $stop=$it if(!defined($stop)); $it=$stop-$start+1; } if($it) { # Set up temporary files for writing out data my(@name,$name1,@fh,$fh1,$ff,$nch); foreach $lg(keys %chrom) {$nch++;} if($opt{d}) { foreach $lg(keys %chrom) { $name[$lg]=$opt{d}.".dat_".$chrom{$lg}; $name[$lg].="_m" if($sex_map); $fh[$lg]=IO::File->new("> $name[$lg]") or die "Couldn't open data file\n"; if($sex_map) { $name[$lg+$nch]=$opt{d}.".dat_".$chrom{$lg}."_f"; $fh[$lg+$nch]=IO::File->new("> $name[$lg+$nch]") or die "Couldn't open data file\n"; } } } else { foreach $lg(keys %chrom) { for($sx=0;$sx<=$sex_map;$sx++) { do{$name[$lg+$sx*$nch]=tmpnam()} until $fh[$lg+$sx*$nch]=IO::File->new($name[$lg+$sx*$nch],O_RDWR|O_CREAT|O_EXCL); } } } # Set handler to delete files after the script ends if the -d option was not used END { if(!$opt{d}) { foreach $lg(keys %chrom) { for($i=0;$i<=$sex_map;$i++) { unlink($name[$lg+$i*$nch]); } } } } # Write out data foreach $lg(keys %chrom) { for($sx=0;$sx<=$sex_map;$sx++) { $x=$map_start[$lg][$sx]+.5*$bw; $ff=$fh[$lg+$sx*$nch]; $kk=0; while($x<=$map_end[$lg][$sx]) { print $ff $x+.5," ",$bin[$sx][$lg][$kk++]/$it,"\n"; $x+=$bw; } close $ff; } } # Open gnuplot control file if($opt{d}) { $name1=$opt{d}; $fh1=IO::File->new("> $name1") or die "Couldn't open data file\n"; } else { do{$name1=tmpnam()} until $fh1=IO::File->new($name1,O_RDWR|O_CREAT|O_EXCL); } # Set handler to delete file after the script ends if the -d option was not used END {unlink($name1) if(!$opt{d});} # If outputting postscript, set options if($opt{o}) { $j="\"Times-Roman\" 14"; $j="color solid ".$j if($opt{C}); print $fh1 "set term postscript $j\nset output \'$opt{o}\'\n"; print $fh1 "set xlabel \'Position\' 0,-2.5\n"; } # Write rest of gnuplot control file foreach $lg(sort{$a<=>$b} keys %chrom) { # Set axis labels print $fh1 "set ylabel \'L-Score'\nset xlabel \'Position\'\n"; for($sx=0;$sx<=$sex_map;$sx++) { # Set plot title if($sex_map) { print $fh1 "set title \'$model -- $chrom{$lg} - $sex[$sx] map\'\n"; } else { print $fh1 "set title \'$model -- $chrom{$lg}\'\n"; } # Turn off keys, set grid option print $fh1 "set nokey\nset grid\n"; # Set tic marks to correspond to marker positions $n=0; for($i=0;$i<$nmk;$i++) { $ch=$mkchrom[$i]; if($ch eq $lg) { $x=$mkpos[$i][$sx]; if(!$n) { print $fh1 "set xtics rotate ("; } else { print $fh1 ",\\\n"; } print $fh1 "\"".$mkname[$i]."\" ".$x; $n++; } } if($n) { print $fh1 ")\n"; } # Set xrange to correspond to map length print $fh1 "set xrange[$map_start[$lg][$sx]:$map_end[$lg][$sx]]\n"; # Plot print $fh1 "plot \'",$name[$lg+$sx*$nch],"\' u 1:2 w l\n\n"; # Wait for (unless producing postscript) print $fh1 "pause -1\n" if(!$opt{o}); } } close $fh1; # Call postscript if quiet option not set system("gnuplot $name1") if(!$opt{q}); } loki/utils/freq.in0100644000076500007650000000661407470171272013436 0ustar heathheath#!+PERLPROG+ # # Script to estimate marker allele frequencies # from the loki output. Reuires the use of the # output frequency "freqfile" # command in the loki parameter file. # # Usage: freq.pl -l -p ppoint -s spacing freqfile # # -l option outputs in format suitable for LINKAGE data files # -p option sets calculation of confidence limits. # e.g. -p 0.025 will give the 2.5% and 97.5% confidence limits. # This requires more memory and will slow down the script. # This option is ignored if -l option also set. # -s sets the spacing of samples considered (default=1) # -i sets the range of iterations to consider # # Works with loki_2.2 and above # # Simon Heath - September 2000 # use strict; use Getopt::Std; my($flag,@mkname,$nmk,%opt,@freq,@fd,$i,$j,$k,$n,$mk,$ngen,$line,%al); my($idx,@ff,$ffr,@nall,@all,$nflag,$est_aff,$ct,$start,$stop); getopts('lp:s:i:h?',\%opt); if($opt{h} || $opt{'?'}) { print "usage: freq.pl -l -p ppoint -s spacing freqfile\n"; exit(0); } undef $opt{p} if($opt{l}); die "percentage point for confidence limits must be between 0 and 1\n" if($opt{p}<0.0 || $opt{p}>1.0); $opt{s}=1 if($opt{s}<1); # -i option sets a range of iterations to consider if($opt{i}) { my $tmp=$opt{i}; if($tmp=~/^([1-9][0-9]*)(.*)/) { $start=$1; $tmp=$2; } if($tmp=~/^[,-:](.*)/) { $tmp=$1; if($tmp=~/^([1-9][0-9]*)/) { $stop=$1; } } die "Bad -i option\n" if(!defined($start) && !defined($stop)); if(defined($start) && defined($stop) && $start>$stop) { $tmp=$start; $start=$stop; $stop=$tmp; } $start=1 if(!defined($start)); } while(<>) { $line++; if($flag) { split; $j=@_; next if(!$j); $ct++; next if(($ct-1)%$opt{s}); next if($_[0]<$start); last if(defined($stop) && $_[0]>$stop); $idx=1; for($mk=0;$mk<$nmk;$mk++) { my @tmp; for($i=0;$i<$nall[$mk]-$nflag;$i++) { for($k=0;$k<$ngen+$est_aff;$k++) { die "Not enough columns at line $line\n" if($idx>=$j); $tmp[$k]+=$_[$idx]; if($opt{p}) { $ff[$mk][$i][$k][$n]=$_[$idx]; } $freq[$mk][$i][$k]+=$_[$idx++]; } } if($nflag) { for($k=0;$k<$ngen+$est_aff;$k++) { if($opt{p}) { $ff[$mk][$i][$k][$n]=1.0-$tmp[$k]; } $freq[$mk][$i][$k]+=1.0-$tmp[$k]; } } } $n++; } else { if(/^---*$/) {$flag=1;} elsif(/^\d+ (\S+): (.*)$/) { $mkname[$nmk]=$1; @fd=split ' ',$2; $nall[$nmk]=@fd; for($i=0;$i<$nall[$nmk];$i++) { $all[$nmk]{$i}=$fd[$i]; } if($fd[$i-1]=~/\((.*)\)/) { $nflag=1; $all[$nmk]{$i-1}=$1; } $nmk++; } elsif(/No. genetic groups: (\d+)/) { $ngen=$1; } elsif(/Estimating allele frequencies amongst affecteds/) { $est_aff=1; } } } if($n) { for($mk=0;$mk<$nmk;$mk++) { print "3 $nall[$mk] # $mkname[$mk]" if($opt{l}); print "\n"; $j=$all[$mk]; %al=%$j; foreach $i(sort {$al{$a}<=>$al{$b}} keys %al) { if($opt{l}) { printf "%.6f ",$freq[$mk][$i][0]/$n; } else { printf "%-10s",$mkname[$mk]; printf " %-8s",$al{$i}; for($k=0;$k<$ngen+$est_aff;$k++) { printf " %.4f",$freq[$mk][$i][$k]/$n; if($opt{p}) { $ffr=$ff[$mk][$i][$k]; my @tmp=sort{$a<=>$b}@$ffr; printf " (%.4f-%.4f) ",$tmp[$n*$opt{p}],$tmp[$n*(1.0-$opt{p})]; } } } print "\n" unless $opt{l}; } print "\n\n" if($opt{l}); } } loki/utils/hist.c0100644000076500007650000001347107445627301013264 0ustar heathheath#include #include #include #include #include #include #include #include #include #include #include #include #include int isfpdigit(char c) { if(c=='.' || c=='-' || (c>='0' && c<='9')) return 1; return 0; } int main(int argc,char *argv[]) { int i,j,c,k,l,idx=1,nbins=20,err=0,ofreq=1,min_set=0,max_set=0; unsigned int *bins; double min,max,t,nn,tx,x,*binps=0; FILE *fptr; char buf[512],*p,*p1,*Outfile=0,*Infile=0,*PFile=0; min=max=0.0; t=tx=0.0; if(argc==1) err=2; else while ((c=getopt(argc,argv,"hcfo:r:b:i:p:"))!=-1) switch(c) { case 'r': p=optarg; x=strtod(p,&p1); if(p1!=p) { min=x; min_set=1; } if(*p1) { if(*p1!=':' && *p1!=',' && *p1!='-') err=1; p1++; x=strtod(p1,&p); if(p1!=p) { max=x; max_set=1; } if(*p) err=1; } break; case 'o': l=strlen(optarg); if(Outfile) free(Outfile); if(!(Outfile=(char *)malloc(l+1))) { (void)fprintf(stderr,"hist: out of memory error\n"); exit(EXIT_FAILURE); } (void)strcpy(Outfile,optarg); break; case 'p': l=strlen(optarg); if(PFile) free(PFile); if(!(PFile=(char *)malloc(l+1))) { (void)fprintf(stderr,"hist: out of memory error\n"); exit(EXIT_FAILURE); } (void)strcpy(PFile,optarg); break; case 'b': nbins=atoi(optarg); break; case 'i': idx=atoi(optarg); break; case 'c': ofreq=0; break; case 'f': ofreq=1; break; case 'h': case '?': err=2; } if(err==1) { (void)fprintf(stderr,"Invalid range specified.\n"); (void)fprintf(stderr,"Use -r min:max or -r min or -r :max to set range\n"); exit(EXIT_FAILURE); } if(err) { (void)fprintf(stderr,"usage: hist [-cfh] [-i index] [-b bins] [-r min:max] [-o file] [-p file] [file]\n"); (void)fprintf(stderr," -c Output counts.\n"); (void)fprintf(stderr," -f Output frequencies (default).\n"); (void)fprintf(stderr," -h Display this help.\n"); (void)fprintf(stderr," -i index Specify which column to read.\n"); (void)fprintf(stderr," -b bins Specify the number of bins.\n"); (void)fprintf(stderr," -r min:max Set range.\n"); (void)fprintf(stderr," -o file Send output to file.\n"); (void)fprintf(stderr," -p file Read in points for bins from file.\n"); exit(EXIT_FAILURE); } if(optind 1\n"); exit(EXIT_FAILURE); } if(idx<1) { (void)fprintf(stderr,"Column index must be >0\n"); exit(EXIT_FAILURE); } if(PFile) { if(max_set || min_set) (void)fprintf(stderr,"Warning - range is ognored when -p option specified\n"); if(!(fptr=fopen(PFile,"r"))) { (void)fprintf(stderr,"Can't open '%s' for input\n",PFile); exit(EXIT_FAILURE); } j=0; while(fgets(buf,512,fptr)) if(sscanf(buf,"%lf",&x)==1) { if(j) { if(x<=tx) { (void)fprintf(stderr,"Points must be ordered in file '%s'\n",PFile); exit(EXIT_FAILURE); } } j++; tx=x; } if(j<3) { (void)fprintf(stderr,"Insufficient points read in from file '%s'\n",PFile); exit(EXIT_FAILURE); } nbins=j-1; if(!(binps=(double *)malloc(sizeof(double)*j))) { (void)fprintf(stderr,"hist: out of memory error\n"); exit(EXIT_FAILURE); } (void)fseek(fptr,0,0); k=0; while(fgets(buf,512,fptr)) if(sscanf(buf,"%lf",&x)==1) { binps[k++]=x; if(k==j) break; } (void)fclose(fptr); free(PFile); min=binps[0]; max=binps[j-1]; min_set=max_set=1; } if(Infile) { if(!(fptr=fopen(Infile,"r"))) { (void)fprintf(stderr,"Can't open '%s' for input\n",Infile); exit(EXIT_FAILURE); } } else { fptr=stdin; if(!(min_set && max_set)) { (void)fprintf(stderr,"The range *must* be completely specified if input is not from a file!\n"); exit(EXIT_FAILURE); } } if(!(max_set && min_set)) { j=0; while(fgets(buf,512,fptr)) { p=buf; for(i=0;imax) max=t; } else max=t; } j=1; } } (void)fseek(fptr,0,0); } tx=(max-min)/(double)(nbins); if(!(bins=(unsigned int *)malloc(sizeof(unsigned int)*nbins))) { (void)fprintf(stderr,"hist: out of memory error\n"); exit(EXIT_FAILURE); } for(i=0;i=min) { for(j=0;j=0 && j$hi) { $tmp=$lo; $lo=$hi; $hi=$tmp; } } # -i option sets a range of iterations to consider if($opt{i}) { $tmp=$opt{i}; if($tmp=~/^([1-9][0-9]*)(.*)/) { $start=$1; $tmp=$2; } if($tmp=~/^[,-:](.*)/) { $tmp=$1; if($tmp=~/^([1-9][0-9]*)/) { $stop=$1; } } die "Bad -i option\n" if(!defined($start) && !defined($stop)); if(defined($start) && defined($stop) && $start>$stop) { $tmp=$start; $start=$stop; $stop=$tmp; } $start=1 if(!defined($start)); } # Set default number of genetic groups $ngroup=1; # Used to store columns where to find interesting quantitities # -1 means not known $it_col=-1; # Iteration count $tv_col=-1; # Total genetic variance $resvar_col=-1; # Residual variance $mean_col=-1; # Grand mean $max_col=-1; # No. fixed output columns $n_cov=-1; # No. covariate columns $ngroup=1; # No. genetic groups $tau_col=-1; $tau_mode=-1; $out_type=-1; # Output type # Open output file if specified, otherwise we use STDOUT if($opt{o}) { open OFILE,">".$opt{o} or die "Couldn't open output file ",$opt{o},"\n"; } else { open OFILE,">&STDOUT" or die "Couldn't dup STDOUT\n"; } $sex_map=0; $i=$opt{x}+$opt{C}+$opt{D}; die "Can not specify more that 1 of the options C,D,x at once.\n" if($i>1); $opt{x}=1 unless $i; $file=$opt{f}?$opt{f}:"loki.out"; open FILE,$file or die "Could not open file '$file'\n"; # Go though file while() { $line++; if($flag) { # Parse the data portion of the file split; # Iteration number $iter=$_[0]; if($opt{i}) { next if($iter<$start); last if(defined($stop) && $iter>$stop); } $nc=@_; next if($nc<$max_col); if($version==-1) { $i=$max_col+$_[6]; last if($nc<$max_col); $ngroup=$_[7]; } else {$i=$max_col;} $max_col1=$i; if($opt{C}) { for($i=0;$i<$max_col1;$i++) {print OFILE " $_[$i]";} print OFILE "\n"; next; } # Total variance $tv1=0; #first get non-genetic variance for($j=0;$j<$nrand;$j++) { if($rand_fg[$j]==2) { $sz=$_[$rand_col[$j]]; $tv1+=$sz; } } # Now get genetic variance if($tv_col>=0) {$tv=$_[$tv_col];} else { # Not specified, must calculate $tv=0; for($j=0;$j<$nrand;$j++) { $sz=$_[$rand_col[$j]]; $sz*=$sz if($rand_fg[$j]==1); if($rand_fg[$j]!=2) {$tv+=$sz;} } } # Count QTL's $nqtl=0; $nqtl1=0; while($i<$nc) { $lg=$_[$i]; die "Illegal linkage group $lg at line $line column ",$i+1,"\n" if($lg && !$chrom{$lg}); $i+=1+$sex_map if($lg || !$out_type); $i+=4+$ngroup; if($tv_col<0) { $sz=$_[$i-1]; $tv+=$sz*$sz; } $nqtl++; if($lg) { $nqtl1++; } } # If QTL numbers are given, check against what we found if($out_type<2) { die "Mismatch in QTL numbers ($nqtl,$_[1]) at line $line\n" if($nqtl!=$_[1]); die "Mismatch in linked QTL numbers ($nqtl1,$_[2]) at line $line\n" if($nqtl1!=$_[2]); } # Get residual variance if(!$resvar_set) { # Do we know where it is ? if($resvar_col>=0) {$resvar=$_[$resvar_col];} # if not, guess elsif($out_type<2) {$resvar=$_[4];} else {$resvar=$_[2];} } # Total non-genetic variance $tv1+=$resvar; # Print out a 'standard' (across output types) set of columns if($opt{D}) { # Get Mean if(!$mean_set) { if($mean_col>=0) {$mean=$_[$mean_col];} elsif($out_type<2) {$mean=$_[3];} else {$mean=$_[1];} } # get Tau if($tau_col>=0) {$tau=$_[$tau_col];} elsif($tau_mode>=0) { if($tau_mode==2) {$tau=$resvar*$tau_beta;} else {$tau=$tau_beta;} } else { # Must be a very early version, assume that we know where tau is... $tau=$_[5]; } print OFILE "$iter $nqtl $nqtl1 $mean $resvar $tau "; printf OFILE "%g",$tv; # Are we on a recent version with all column info? if($out_col_flag) { for($i=1;$i<$max_col1;$i++) { print OFILE " $_[$i]" if(!$no_output[$i]); } # This is more complicated } else { if(!$out_type) {$i=8;} elsif($out_type<2) {$i=6;} else {$i=3}; for(;$i<$max_col1;$i++) { print OFILE " $_[$i]"; } } print OFILE "\n"; # Extract information about linked QTL's } elsif($opt{x} && $nqtl) { # Go through QTL's $i=$max_col1; while($i<$nc) { $lg=$_[$i]; if($lg eq $opt{c}) { $j=$i+1; if($lg) { $x1=$_[$j++]; $x2=$_[$j++] if($sex_map); } # Select QTL based on linkage group and range if(!$lg || !$opt{r} || ((!defined($lo) || $x1>=$lo) && (!defined($hi) || $x1<=$hi))) { print OFILE $iter; # Print position if linked if($lg) { print OFILE " $x1"; print OFILE " $x2" if($sex_map); } for($k=0;$k<2+$ngroup;$k++) {print OFILE " ",$_[$j++];} $sz=$_[$j]; print OFILE " $sz"; $sz*=$sz; if($tv>0.0) {printf OFILE " %g",$sz/$tv;} else {print OFILE " 0.0";} if(($tv1+$tv)>0.0) {printf OFILE " %g\n",$sz/($tv+$tv1)} else {print OFILE " 0.0\n";} } } $i+=1+$sex_map if($lg || !$out_type); $i+=4+$ngroup; } } # We've reached the end of the header } elsif(/^--*/) { $flag=1; # $max_col will not be set if working with an earlier version if($max_col<0) { # but $n_cov should be set unless ... if($n_cov>=0) { if($out_type<0) {$out_type=1;} $max_col=3+$n_cov; $version=1; if(!$out_type) {$max_col+=5;} elsif($out_type==1) {$max_col+=3;} } else { # ... we are working with a genuine v2.0 copy $out_type=0; $max_col=8; $version=-1; } } } elsif(!$flag) { # First parse the header if(/^Output format: (\d+)/) { $out_type=$1; next; } if(/^Created by loki (\d+).(\d+).(\d+).*:/) { $version=2 if($1>2 || ($1==2 && $2>=3)); next; } # Pull out linkage group information if it is there if(/^Linkage groups:$/) { $link_fg=1; next; } if($link_fg==1) { # Check for linkage group names and map lengths if(/(\d+): (.*)$/) { $lg=$1; if($2=~/^(.*) Map range: (.*)/) { $chrom{$lg}=$1; if($2=~/\((-?[0-9.]+)cM to (-?[0-9.]+)cM\)(.*)/) { $map_start[$lg][0]=$1; $map_end[$lg][0]=$1; if($3=~/\((-?[0-9.]+)cM to (-?[0-9.]+)cM\)/) { $map_start[$lg][1]=$1; $map_end[$lg][1]=$1; $sex_map=1; } } else { die "Error reading linkage group map range\n"; } } else {$chrom{$lg}=$1;} } elsif(/^\s+(.+) - ([\d\.]+)\s*([\d\.]*)/) { if(!$opt{c} || $lg eq $opt{c}) { $mkchrom[$nmk]=$lg; $mkpos[$nmk][0]=$2; $mkpos[$nmk][1]=$3; $mkname[$nmk++]=$1; } } else { # Check for total map length if(/^Total Map Length: (.*)$/) { if($1=~/(\d\d*\.?\d*)cM(.*)/) { $map_length[0]=$1; if($2=~/(\d\d*\.?\d*)cM$/) { $map_length[1]=$1; $sex_map=1; } } else { die "Error reading map lengths\n"; } $link_fg=2; next; } } } $model=$1 if(/^Model: (.+)/); if($link_fg<3) { if(/^Output columns:$/) { $link_fg=3; $out_col_flag=1; next; } elsif(/Output covariate data:$/) { $link_fg=4; } } elsif($link_fg>2) { if(/(\d+): (.*)/) { $col[$1]=$2; $tmp=$1-1; if($link_fg==4) { $link_fg=3; if(!$tmp) {$adj=6;} } $tmp+=$adj; if($2 eq "Total genetic variance") { $tv_col=$tmp; $no_output[$tmp]=1; } elsif($2 eq "Additive variance") { $rand_fg[$nrand]=0; $rand_col[$nrand++]=$tmp; } elsif($2=~/^Additional random variance for/) { $rand_fg[$nrand]=2; $rand_col[$nrand++]=$tmp; } elsif($2=~/\S+ size$/) { $rand_fg[$nrand]=1; $rand_col[$nrand++]=$tmp; } elsif($2 eq "Residual variance") { $resvar_col=$tmp; $no_output[$tmp]=1; } elsif($2 eq "Grand mean") { $mean_col=$tmp; $no_output[$tmp]=1; } elsif($2 eq "Tau") { $tau_col=$tmp; $no_output[$tmp]=1; } elsif($2 eq "No. QTL's in model") { $no_output[$tmp]=1; } elsif($2 eq "No. linked QTL's") { $no_output[$tmp]=1; } elsif($2 eq "No. covariate columns") { $no_output[$tmp]=1; } elsif($2 eq "No. genetic groups") { $no_output[$tmp]=1; } } elsif(/No. covariate columns: (\d+)/) { $n_cov=$1; } elsif(/No. fixed output columns: (\d+)/) { $max_col=$1; } elsif(/No. genetic groups: (\d+)/) { $ngroup=$1; } elsif(/^Sex specific map$/) { $sex_map=1; } elsif(/^Residual variance: ([0-9-.]+)/) { $resvar_set=1; $resvar=$1; } elsif(/^Grand mean: ([0-9-.]+)/) { $mean_set=1; $mean=$1; } elsif(/^Tau Mode: ([0-9]+)/) { $tau_mode=$1; } elsif(/^Tau Beta: ([0-9.]+)/) { $tau_beta=$1; } } } } loki/utils/Makefile.in0100644000076500007650000000211307522447435014211 0ustar heathheathSHELL = /bin/sh CC = @CC@ MY_CFLAGS = @CFLAGS@ @extra_cflags@ SED = @SED@ PERL = @PERL@ CP = @CP@ CHMOD = @CHMOD@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ INSTALL_PERM = 755 CFLAGS = $(MY_CFLAGS) -I../include LDFLAGS = LIBS = -lm ALL_LIBS = $(LIBS) SRC = qavg.c hist.c PROGS = qavg hist SCRIPTS = loki_ext count dist freq sort_error all: qavg hist qavg: qavg.c $(CC) $(CFLAGS) -o $@ qavg.c $(LDFLAGS) $(ALL_LIBS) hist: hist.c $(CC) $(CFLAGS) -o $@ hist.c ../bin: mkdir ../bin scripts: ../bin for file in $(SCRIPTS); do \ $(SED) 's!+PERLPROG+!$(PERL)!' $$file.in > $(bindir)/$$file.pl; \ $(CHMOD) $(INSTALL_PERM) $(bindir)/$$file.pl; \ done install: $(PROGS) scripts for file in $(PROGS); do \ $(CP) $$file $(bindir)/; \ $(CHMOD) $(INSTALL_PERM) $(bindir)/$$file ; \ done clean: rm -f *~ *.o *.a *.bak a.out core seedfile depend distclean: clean rm -f Makefile *.pl $(PROGS) rm -rf ../bin depend: $(SRC) ../include/config.h @MAKEDEPEND@ -I../include $(DMALLOC_INC) $(SRC) touch depend # DO NOT DELETE THIS LINE -- make depend depends on it. loki/utils/qavg.c0100644000076500007650000001366007445627301013253 0ustar heathheath#include #include #include #include #include #include #include #define BLKSIZE 4096 static int bufsize,ncol,maxcol,**coldata,*ncols,*cols,blkptr,ldsize,rec,*nn; static char *buf,*MMsg="Out of memory error\n"; static double *sum,*sum2,*min,*max,**linedata,*data; static double addlog(double x1,double x2) { double y,r; y=.5*(x1+x2); r=(log(cosh(x1-y))+y+log(2.0)); return r; } static void abt(char *s) { (void)fputs(s,stderr); exit(EXIT_FAILURE); } static char *read_line(FILE *fptr) { char *p; int i=0; size_t l; for(;;) { p=fgets(buf+i,bufsize-i,fptr); if(p) { l=strlen(buf); if(buf[l-1]!='\n') { i=bufsize-1; bufsize*=2; if(!(buf=realloc(buf,(size_t)bufsize))) abt(MMsg); } else break; } else break; } return p; } static void add_data(double x,int col,int flag) { double *data1; int *cols1; if(blkptr>=BLKSIZE) { if(col>=BLKSIZE) abt("No. columns > BLKSIZE\n"); if(!(data1=malloc(sizeof(double)*BLKSIZE))) abt(MMsg); if(!(cols1=malloc(sizeof(int)*BLKSIZE))) abt(MMsg); (void)memcpy(data1,data+blkptr-col,col*sizeof(double)); (void)memcpy(cols1,cols+blkptr-col,col*sizeof(int)); linedata[rec]=data1; coldata[rec]=cols1; data=data1; cols=cols1; blkptr=col; } data[blkptr]=x; cols[blkptr++]=flag; } static void read_cols(FILE *fptr,int logopt,int start,int ppoint) { int i,line=0,nc; char *p,*p1; double x; if(!buf) { /* Allocate initial buffers */ bufsize=256; if(!(buf=malloc((size_t)bufsize))) abt(MMsg); maxcol=8; if(!(sum=malloc(sizeof(double)*maxcol))) abt(MMsg); if(!(sum2=malloc(sizeof(double)*maxcol))) abt(MMsg); if(!(nn=malloc(sizeof(int)*maxcol))) abt(MMsg); if(!(min=malloc(sizeof(double)*maxcol))) abt(MMsg); if(!(max=malloc(sizeof(double)*maxcol))) abt(MMsg); for(i=0;i=0.0) { if(!(data=malloc(sizeof(double)*BLKSIZE))) abt(MMsg); if(!(cols=malloc(sizeof(int)*BLKSIZE))) abt(MMsg); ldsize=32; if(!(linedata=malloc(sizeof(double *)*ldsize))) abt(MMsg); if(!(coldata=malloc(sizeof(int *)*ldsize))) abt(MMsg); if(!(ncols=malloc(sizeof(int *)*ldsize))) abt(MMsg); blkptr=0; } } while(read_line(fptr)) { line++; if(line=0.0) { if(rec>=ldsize) { ldsize*=2; if(!(linedata=realloc(linedata,sizeof(double *)*ldsize))) abt(MMsg); if(!(coldata=realloc(coldata,sizeof(int *)*ldsize))) abt(MMsg); if(!(ncols=realloc(ncols,sizeof(int *)*ldsize))) abt(MMsg); } linedata[rec]=data+blkptr; coldata[rec]=cols+blkptr; ncols[rec]=0; } while(*p) { while(isspace((int)*p)) p++; if(*p) { if(nc>=maxcol) { i=maxcol; maxcol*=2; if(!(sum=realloc(sum,sizeof(double)*maxcol))) abt(MMsg); if(!(sum2=realloc(sum2,sizeof(double)*maxcol))) abt(MMsg); if(!(nn=realloc(nn,sizeof(int)*maxcol))) abt(MMsg); if(!(min=realloc(min,sizeof(double)*maxcol))) abt(MMsg); if(!(max=realloc(max,sizeof(double)*maxcol))) abt(MMsg); for(;i0.0) { sum[nc]=addlog(sum[nc],x); sum2[nc]=addlog(sum[nc],2.0*x); } else { sum[nc]=x; sum2[nc]=2.0*x; } } if(xmax[nc]) max[nc]=x; nn[nc]++; if(ppoint>=0.0) add_data(x,nc,1); } else { if(ppoint>=0.0) add_data(0.0,nc,0); } nc++; p=p1; while(*p && !isspace((int)*p)) p++; } } if(ppoint>=0.0) ncols[rec]=nc; rec++; if(nc>ncol) ncol=nc; } return; } static int cmp_doubles(const void *s1,const void *s2) { double x1,x2; x1=*((const double *)s1); x2=*((const double *)s2); if(x1>x2) return 1; if(x2>x1) return -1; return 0; } int main(int argc, char *argv[]) { char *p; FILE *fptr; int i,j,k,c,start=0,logopt=0; double ppoint=-1.0,x,v,*tx=0,z; while((c=getopt(argc,argv,"lr:p:"))!=-1) switch(c) { case 'l': logopt=1; break; case 'r': start=(int)strtol(optarg,&p,10); if(p==optarg) { (void)fprintf(stderr,"Invalid starting row number '%s' given to -r option\n",optarg); exit(EXIT_FAILURE); } break; case 'p': ppoint=strtod(optarg,&p); if(p==optarg || ppoint<0.0 || ppoint>1.0) { (void)fprintf(stderr,"Invalid %% point '%s' given to -p option\n",optarg); exit(EXIT_FAILURE); } break; } if(optind>=argc) read_cols(stdin,logopt,start,ppoint); else for(i=optind;i=0 && rec) { if(!(tx=malloc(sizeof(double)*rec))) abt(MMsg); } for(i=0;i0.0?sum[i]/(double)nn[i]:0.0; v=nn[i]>1.0?(sum2[i]-sum[i]*x)/(double)(nn[i]-1):0.0; (void)printf("Col %d - Mean = %g SD = %g n = %d Range %g -> %g\n",i+1,x,sqrt(v),nn[i],min[i],max[i]); } else { x=nn[i]>0.0?sum[i]-log((double)nn[i]):0.0; (void)printf("Col %d - Mean = %g n = %d Range %g -> %g\n",i+1,x,nn[i],min[i],max[i]); } if(ppoint>=0.0 && nn[i]) { for(z=0.0,k=j=0;j0.0) { if(tx[k]<=0.0) z++; } else { if(tx[k]>=0.0) z++; } k++; } if(k!=nn[i]) abt("Internal error - mismatch in record count\n"); z/=(double)k; qsort(tx,(size_t)k,sizeof(double),cmp_doubles); (void)printf(" Q1 = %g, Q2 = %g, Q3 = %g, %g%% Lim = %g -> %g, p = %g\n",tx[(int)(nn[i]*.25)], tx[(int)(nn[i]*.5)],tx[(int)(nn[i]*.75)],100.0*ppoint,tx[(int)(nn[i]*ppoint)],tx[(int)(nn[i]*(1.0-ppoint))],z); } } return 0; } loki/utils/sort_error.in0100755000076500007650000000263707445627301014706 0ustar heathheath#!+PERLPROG+ -w use strict; # # Script to read marker error files and count the number of times each # nuclear family, and each individual family member, is flagged as # having an error. The output has one line per nuclear family, with the # first column being the number of errors in that family, the second and # third columns being the parents and the subsequenct columns being the # family members with their individual error counts. # # Usage: sort_error.pl [dir] # # Reads in all *.err files in specified directory (defaults to current) # # Simon Heath - January 2002 # my($i,$k,@fd,$fam,%cc,%dd,%count,@fi,@ff,$id,$ids,$idd,$td,$file); $k=0; @ARGV=('.') unless @ARGV; while($td=shift) { $td=~s/\/+$//; opendir(DIR,$td) or die "can't opendir $td :$!"; while(defined($file=readdir(DIR))) { if($file=~/\.err$/) { $file=$td."/".$file; open FILE,$file or die "can't open $file: $!"; while() { @fd=split; $fam=$fd[1]."_#_".$fd[2]; $count{$fam}++; $fi[$k]=$fd[0]; $ff[$k++]=$fam; $cc{$fd[0]}++; } close FILE; } } } foreach $fam(keys %count) { if($fam=~/^(.*)_#_(.*)$/) { $ids=$1; $idd=$2; } else { $ids="?"; $idd="?"; } print "$count{$fam} $ids $idd "; undef %dd; for($i=0;$i<$k;$i++) { if($ff[$i] eq $fam) { $id=$fi[$i]; $dd{$id}++; } } foreach $id(sort {$dd{$b}<=>$dd{$a}} keys %dd) { print $id,"(",$dd{$id},") "; } print "\n"; }